#include #include #include #include "km3net-dataformat/offline/Head.hh" #include "km3net-dataformat/offline/MultiHead.hh" #include "km3net-dataformat/offline/Evt.hh" #include "JDAQ/JDAQEventIO.hh" #include "JDAQ/JDAQTimesliceIO.hh" #include "JDAQ/JDAQSummarysliceIO.hh" #include "JTrigger/JTriggerParameters.hh" #include "JSupport/JSupport.hh" #include "JSupport/JParallelFileScanner.hh" #include "JSupport/JFileRecorder.hh" #include "JSupport/JSummaryFileRouter.hh" #include "JSupport/JMeta.hh" #include "JReconstruction/JEvt.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Program to set fit status according match of history with list of application types. * * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; typedef JTYPELIST::typelist typelist; typedef JSingleFileScanner JSingleFileScanner_t; JSingleFileScanner_t inputFile; JFileRecorder outputFile; JLimit_t& numberOfEvents = inputFile.getLimit(); vector apps; int debug; try { JParser<> zap("Program to set fit status according match of history with list of application types."); zap['f'] = make_field(inputFile); zap['o'] = make_field(outputFile) = "history.root"; zap['n'] = make_field(numberOfEvents) = JLimit::max(); zap['A'] = make_field(apps); zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } outputFile.open(); outputFile.put(JMeta(argc, argv)); while (inputFile.hasNext()) { STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl); JFIT::JEvt out = *inputFile.next(); for (JFIT::JEvt::iterator i = out.begin(); i != out.end(); ++i) { i->setStatus(i->getHistory().getStatus(apps) ? COMPLETE_CHAIN : INCOMPLETE_CHAIN); } outputFile.put(out); } STATUS(endl); JSingleFileScanner::typelist> io(inputFile); io >> outputFile; outputFile.close(); }