#include #include #include #include #include "JDAQ/JDAQTimesliceIO.hh" #include "JDAQ/JDAQEvaluator.hh" #include "JROOT/JROOTClassSelector.hh" #include "JSupport/JTreeScanner.hh" #include "JSupport/JSupport.hh" #include "JSupport/JAutoTreeScanner.hh" #include "Jeep/JTimer.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Program to test ordered reading using JSUPPORT::JTreeScanner. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; JMultipleFileScanner<> inputFile; JROOTClassSelector selector; JLimit numberOfEvents; int debug; try { JParser<> zap("Program to test ordered reading from a ROOT TTree."); zap['f'] = make_field(inputFile); zap['C'] = make_field(selector) = getROOTClassSelection(); zap['n'] = make_field(numberOfEvents) = JLimit(); zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } JTreeScanner<>::debug = debug; JAutoTreeScanner zmap = JType(); JTreeScannerInterface* ps = zmap[selector]; JTimer timer; timer.start(); ps->configure(inputFile, numberOfEvents); timer.stop(); timer.print(cout, milli_t); while (ps->hasNext()) { JDAQTimeslice* p = ps->next(); cout << *p << endl; } }