#include #include #include #include "JDAQ/JDAQEventIO.hh" #include "JSupport/JSingleFileScanner.hh" #include "JSupport/JSupport.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to find the largest event in a file. * \author lnauta */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; JSingleFileScanner inputFile; int debug; try { JParser<> zap("Example program to find the largest event in a file."); zap['f'] = make_field(inputFile); zap['d'] = make_field(debug) = 1; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } unsigned int overlays = 0; counter_type index = -1; while (inputFile.hasNext()) { STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl); const JDAQEvent* event = inputFile.next(); if (event->getOverlays() > overlays) { overlays = event->getOverlays(); index = inputFile.getCounter() - 1; } } STATUS(endl); cout << "Largest number of overlays " << overlays << endl; cout << "JConvert -f " << inputFile.getFilename() << " -n " << index << ":1" << endl; }