#include #include #include #include "TROOT.h" #include "TFile.h" #include "TGraph.h" #include "km3net-dataformat/offline/Evt.hh" #include "km3net-dataformat//definitions/reconstruction.hh" #include "JAAnet/JAAnetToolkit.hh" #include "JROOT/JGraph.hh" #include "JROOT/JRootToolkit.hh" #include "JSupport/JMultipleFileScanner.hh" #include "JSupport/JSupport.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to monitor dynamical calibration of Evt formatted data. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; using namespace KM3NETDAQ; JMultipleFileScanner inputFile; JLimit_t& numberOfEvents = inputFile.getLimit(); string outputFile; int debug; try { JParser<> zap("Example program to monitor dynamical calibration of Evt formatted data."); zap['f'] = make_field(inputFile); zap['n'] = make_field(numberOfEvents) = JLimit::max(); zap['o'] = make_field(outputFile) = "dynamics.root"; zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } JGraph_t gn; JGraph_t g0; JGraph_t g1; while (inputFile.hasNext()) { STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl); const Evt* evt = inputFile.next(); if (has_reconstructed_jppmuon(*evt)) { const Trk& trk = get_best_reconstructed_jppmuon(*evt); const bool gandalf = has_jppmuon_gandalf(trk); DEBUG("coverage " << FIXED(15,0) << evt->t.AsDouble() << ' ' << setw(2) << trk.rec_stages.size() << ' ' << FIXED(4,2) << getW(trk, JPP_COVERAGE_ORIENTATION, 0.0) << ' ' << FIXED(4,2) << getW(trk, JPP_COVERAGE_ORIENTATION, 0.0) << endl); if (!gandalf) { gn.put(evt->t.AsDouble(), 0.0); } g0.put(evt->t.AsDouble(), getW(trk, JPP_COVERAGE_ORIENTATION, 0.0)); g1.put(evt->t.AsDouble(), getW(trk, JPP_COVERAGE_POSITION, 0.0)); } } STATUS(endl); TFile out(outputFile.c_str(), "recreate"); out << JGraph(gn, "G[!gandalf]"); out << JGraph(g0, "G[orientation]"); out << JGraph(g1, "G[position]"); out.Write(); out.Close(); }