#include #include #include #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "JDetector/JPMTParametersMap.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to create PMT parameters map. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string detectorFile; int debug; JPMTParametersMap parameters; try { JParser<> zap("Example program to create PMT parameters map."); zap['a'] = make_field(detectorFile) = ""; zap['P'] = make_field(parameters) = JPARSER::initialised(); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } if (detectorFile != "") { JDetector detector; try { load(detectorFile, detector); } catch(const JException& error) { FATAL(error); } for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) { for (unsigned int pmt = 0; pmt != module->size(); ++pmt) { const JPMTIdentifier id(module->getID(), pmt); parameters[id] = parameters.getDefaultPMTParameters(); } } } cout << parameters; }