#include #include #include #include #include "JDAQ/JDAQSummarysliceIO.hh" #include "JSupport/JMultipleFileScanner.hh" #include "JSupport/JSupport.hh" #include "JTools/JQuantile.hh" #include "Jeep/JPrint.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to histogram KM3NETDAQ::JDAQSummaryslice. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; JMultipleFileScanner<> inputFile; JLimit_t& numberOfEvents = inputFile.getLimit(); int debug; try { JParser<> zap("Example program to histogram summary data."); zap['f'] = make_field(inputFile); zap['n'] = make_field(numberOfEvents) = JLimit::max(); zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } for (JMultipleFileScanner<>::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) { int run = -1; JQuantile Q[2]; for (JMultipleFileScanner in(*i); in.hasNext(); ) { STATUS("event: " << setw(10) << in.getCounter() << '\r'); DEBUG(endl); JDAQSummaryslice* summary = in.next(); if (run == -1) { run = summary->getRunNumber(); } for (JDAQSummaryslice::const_iterator frame = summary->begin(); frame != summary->end(); ++frame) { if (!frame->testHighRateVeto() && !frame->testFIFOStatus()) { Q[0].put(frame->getUDPNumberOfReceivedPackets() == (frame->getUDPMaximalSequenceNumber() + 1) ? 1.0 : 0.0); Q[1].put(frame->hasUDPTrailer() ? 1.0 : 0.0); } } } cout << setw(8) << run << ' ' << FIXED(6,4) << Q[0].getMean() << ' ' << FIXED(6,4) << Q[1].getMean() << endl; } STATUS(endl); }