#include #include #include #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "JDetector/JDetectorSupportkit.hh" #include "JGeometry3D/JPosition3D.hh" #include "JSupport/JMeta.hh" #include "Jeep/JeepToolkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to generate detector file with set of modules. * * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string outputFile; int detectorID; string variant; set moduleID; JLocation location; JPosition3D pos; int debug; try { JParser<> zap("Auxiliary program to generate detector files."); zap['o'] = make_field(outputFile, "detector file"); zap['D'] = make_field(detectorID, "detector identifier") = 1001; zap['V'] = make_field(variant, "detector version") = getDetectorVersions(); zap['M'] = make_field(moduleID, "list of module identifiers") = JPARSER::initialised(); zap['L'] = make_field(location, "location of module(s)") = JLocation(1, 1); zap['P'] = make_field(pos, "position of module(s)") = JPosition3D(0.0, 0.0, 0.0); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } JDetector detector(detectorID, variant, JDetectorHeader()); detector.comment.add(JMeta(argc,argv)); for (const auto id : moduleID) { JModule module = getModule(id); module.set(pos); module.setLocation(location); detector.push_back(module); } try { store(outputFile, detector); } catch(const JException& error) { FATAL(error); } return 0; }