#include #include #include #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "JDetector/JModuleGeometry.hh" #include "JFit/JPoint3DEstimator.hh" #include "JIO/JFileStreamIO.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Program to convert detector to ntuples. * \author mdejong */ int main(int argc, char **argv) { using namespace std; string detectorFile; string outputFile; int debug; try { JParser<> zap("Program to convert detector to ntuples."); zap['a'] = make_field(detectorFile); zap['o'] = make_field(outputFile); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } using namespace JPP; JDetector detector; try { load(detectorFile, detector); } catch(const JException& error) { FATAL(error); } JFileStreamWriter out(outputFile.c_str()); for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) { const JEstimator center(module->begin(), module->end()); JModuleGeometry geometry(JDAQUTCExtended(), module->getID(), center, JEulerAngle3D()); out.store(geometry); } out.close(); }