#include #include #include #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "JDetector/JLocationRouter.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to print module identifier for a given module location. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string detectorFile; JLocation location; int debug; try { JParser<> zap("Auxiliary program to print module identifier for a given module location." "\nInteractive mode in absence of option -L ."); zap['a'] = make_field(detectorFile, "Detector file"); zap['L'] = make_field(location, "Module location") = JLocation(); zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } JDetector detector; try { load(detectorFile, detector); } catch(const JException& error) { FATAL(error); } const JLocationRouter router(detector); if (location != JLocation()) { cout << router.getModule(location).getID() << endl; } else { while (cin >> location && location != JLocation()) { cout << router.getModule(location).getID() << endl; } } }