#include #include #include #include "JTools/JWeight.hh" #include "JSupport/JMultipleFileScanner.hh" #include "JSupport/JSupport.hh" #include "JReconstruction/JEvt.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to sum fit quality. */ int main(int argc, char **argv) { using namespace std; using namespace JPP; JMultipleFileScanner inputFile; JLimit_t& numberOfEvents = inputFile.getLimit(); int debug; try { JParser<> zap("Auxiliary program to sum fit quality."); 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); } JWeight W("Quality"); while (inputFile.hasNext()) { STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl); const JEvt* evt = inputFile.next(); if (!evt->empty()) { if (evt->begin()->getQ() >= 0.0) { W.put(evt->begin()->getQ()); } } } STATUS(endl); cout << "Total quality " << FIXED(12,1) << W.getTotal() << ' ' << FIXED(12,1) << W.getError()<< endl; }