#include #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "JSupport/JMeta.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to detach PMTs from detector. * * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string detectorFile; string outputFile; int debug; try { JParser<> zap("Auxiliary program to detach PMTs from detector."); zap['a'] = make_field(detectorFile, "detector file"); zap['o'] = make_field(outputFile, "detector file without PMTs"); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } JDetector detector; try { load(detectorFile, detector); } catch(const JException& error) { FATAL(error); } detector.comment.add(JMeta(argc,argv)); if (detector.setToLatestVersion()) { NOTICE("Set detector version to " << detector.getVersion() << endl); } for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) { DEBUG("Detach PMTs in module " << setw(10) << module->getID() << endl); module->clear(); } try { store(outputFile, detector); } catch(const JException& error) { FATAL(error); } }