#include #include #include #include "JDAQ/JDAQSummarysliceIO.hh" #include "JPhysics/JK40Rates.hh" #include "JDetector/JDetector.hh" #include "JDetector/JDetectorToolkit.hh" #include "JDetector/JDetectorSimulator.hh" #include "JDetector/JPMTParametersMap.hh" #include "JDetector/JK40DefaultSimulator.hh" #include "JDetector/JPMTDefaultSimulator.hh" #include "JDetector/JCLBDefaultSimulator.hh" #include "JTrigger/JTriggerParameters.hh" #include "JSupport/JFileRecorder.hh" #include "JSupport/JSupport.hh" #include "JSupport/JMeta.hh" #include "JSummaryslice/JSummaryslice.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to write summary data. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; JFileRecorder::typelist> outputFile; int numberOfEvents; string detectorFile; JTriggerParameters parameters; JPMTParametersMap pmtParameters; JK40Rates rates_Hz; int run_number; int debug; try { JParser<> zap("Auxiliary program to create summary data."); zap['n'] = make_field(numberOfEvents); zap['o'] = make_field(outputFile); zap['a'] = make_field(detectorFile); zap['@'] = make_field(parameters) = JPARSER::initialised(); zap['P'] = make_field(pmtParameters) = JPARSER::initialised(); zap['B'] = make_field(rates_Hz) = JPARSER::initialised(); zap['R'] = make_field(run_number) = 1; zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } JDetector detector; try { load(detectorFile, detector); } catch(const JException& error) { FATAL(error); } JPMTParametersMap::Throw(false); JDetectorSimulator simbad(detector); simbad.reset(new JPMTDefaultSimulator(pmtParameters, detector)); simbad.reset(new JK40DefaultSimulator(rates_Hz)); simbad.reset(new JCLBDefaultSimulator()); outputFile.open(); outputFile.put(JMeta(argc, argv)); outputFile.put(parameters); for (int frame_index = 1; frame_index <= numberOfEvents; ++frame_index) { NOTICE("event: " << setw(10) << frame_index << '\r'); DEBUG(endl); JSummaryslice summary(JDAQChronometer(detector.getID(), run_number, frame_index, getTimeOfFrame(frame_index)), simbad); outputFile.put(summary); } NOTICE(endl); outputFile.close(); }