39 typedef JTriggeredFileScanner<JEvt> JTriggeredFileScanner_t;
40 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
42 JTriggeredFileScanner_t inputFileA;
43 JTriggeredFileScanner_t inputFileB;
51 JParser<> zap(
"Example program to compare fit results from two files.");
56 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
62 catch(
const exception& error) {
63 FATAL(error.what() << endl);
68 inputFileA.setLimit(numberOfEvents);
69 inputFileB.setLimit(numberOfEvents);
86 TH1D hA(
"h[A]", NULL, 100, -3.0, +2.3);
87 TH1D hB(
"h[B]", NULL, 100, -3.0, +2.3);
94 while (inputFileA.hasNext() && inputFileB.hasNext()) {
96 STATUS(
"event: " << setw(10) << inputFileA.getCounter() <<
'\r');
DEBUG(endl);
98 multi_pointer_type psA = inputFileA.next();
99 multi_pointer_type psB = inputFileB.next();
103 while (psA.get<Evt>()->mc_id < psB.get<Evt>()->mc_id && inputFileA.hasNext()) { psA = inputFileA.next(); }
104 while (psB.get<Evt>()->mc_id < psA.get<Evt>()->mc_id && inputFileB.hasNext()) { psB = inputFileB.next(); }
106 if (!psA.is_valid()) {
continue; }
107 if (!psB.is_valid()) {
continue; }
109 if (psA.get<Evt>()->mc_id == psB.get<Evt>()->mc_id) {
117 if (muon ==
event->mc_trks.end()) {
continue; }
119 if (evtA->empty()) {
continue; }
120 if (evtB->empty()) {
continue; }
122 JEvt::const_iterator fitA = evtA->begin();
123 JEvt::const_iterator fitB = evtB->begin();
128 hA.Fill(log10(angleA));
129 hB.Fill(log10(angleB));
131 h2.Fill(fitB->getQ() - fitA->getQ(), angleB - angleA);
133 if (angleA > angle_Deg) {
134 manager.Fill(*fitA, *fitB, angleB < angle_Deg);
void insert(const JKey &key, const Int_t nx, const Double_t xmin, const Double_t xmax, const double logx=false)
Insert set of histograms.
Utility class to parse command line options.
double getAngle(const JFirst_t &first, const JSecond_t &second)
Get space angle between objects.
Auxiliary class to manage set of histograms.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
angular resolution [rad] from JGandalf.cc
JLimit JLimit_t
Type definition of limit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
angular resolution [rad] from JGandalf.cc
uncorrected energy [GeV] from JEnergy.cc
number of hits from JGandalf.cc
number of photo-electrons up to the barycentre from JStart.cc
Data structure for set of track fit results.
distance between first and last hits in metres from JStart.cc
JDirection3D getDirection(const Vec &v)
Get direction.
number of photo-electrons along the whole track from JStart.cc
#define DEBUG(A)
Message macros.