Auxiliary program to attach PMTs to detector.
More...
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Auxiliary program to attach PMTs to detector.
- Author
- mdejong
Definition in file JAttachPMTs.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 18 of file JAttachPMTs.cc.
24 string detectorFile_a;
25 string detectorFile_b;
31 JParser<> zap(
"Auxiliary program to attach PMTs to detector.");
33 zap[
'a'] =
make_field(detectorFile_a,
"detector file w/o PMTs");
34 zap[
'f'] =
make_field(detectorFile_b,
"detector file with PMTs");
40 catch(
const exception &error) {
41 FATAL(error.what() << endl);
48 load(detectorFile_a, detector_a);
49 load(detectorFile_b, detector_b);
51 catch(
const JException& error) {
55 detector_a.comment.add(JMeta(argc,argv));
57 if (detector_a.setToLatestVersion()) {
58 NOTICE(
"Set detector version to " << detector_a.getVersion() << endl);
61 for (JDetector::iterator module_b = detector_b.begin(); module_b != detector_b.end(); ++module_b) {
63 for (JDetector::iterator module_a = detector_a.begin(); module_a != detector_a.end(); ++module_a) {
65 if (module_a->getID() == module_b->getID()) {
67 DEBUG(
"Attach PMTs in module " << setw(10) << module_a->getID() << endl);
69 module_b->set ( module_a->getPosition());
70 module_b->swap(*module_a);
80 catch(
const JException& error) {
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
#define DEBUG(A)
Message macros.