#include #include #include #include "JDAQ/JDAQSummarysliceIO.hh" #include "JSupport/JMultipleFileSampler.hh" #include "JSupport/JRandomSampler.hh" #include "JSupport/JSupport.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Program to test sampling of summary data using the JSUPPORT::JMultipleFileSampler class. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; JMultipleFileSampler inputFile; JLimit_t numberOfEvents; UInt_t seed; int debug; try { JParser<> zap("Program to test sampling of summary data."); zap['f'] = getOption(inputFile.get,true>(), "inputFile"); zap['R'] = getOption(inputFile.getSampler(), "sampler") = JPARSER::initialised(); zap['n'] = make_field(numberOfEvents); zap['S'] = make_field(seed) = 0; zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } gRandom->SetSeed(seed); for (counter_type i = 0; i != numberOfEvents && inputFile.hasNext(); ++i) { cout << "event: " << setw(8) << i << flush; JDAQSummaryslice* summary = inputFile.next(); cout << " index " << setw(8) << summary->getFrameIndex() << endl; } }