#include #include #include #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "JDetector/JDetectorSupportkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to generate custom detector file with one optical module. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string outputFile; int id; JLocation location; map t0; int debug; try { JParser<> zap("Auxiliary program to generate custom detector file with one optical module."); zap['o'] = make_field(outputFile); zap['M'] = make_field(id, "Module identifier"); zap['L'] = make_field(location, "Module location"); zap['P'] = make_field(t0, "PMT time offsets") = JPARSER::initialised(); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } JDetector detector(1001, getLatestDetectorVersion(), getARCADetectorHeader()); detector.comment.add("Test"); JModule module = getModule(id, location); for (const auto& pmt : t0) { module[pmt.first].setCalibration(pmt.second); } module.compile(); detector.push_back(module); try { store(outputFile, detector); } catch(const JException& error) { FATAL(error); } }