45{
48
50 JLimit_t& numberOfEvents = inputFile.getLimit();
54
55 try {
56
57 JParser<> zap(
"Example program to verify generator data.");
58
64
66 }
67 catch(const exception &error) {
69 }
70
71
73
75
77
79
80 TH1D h0 (
"h0",
"Energy conservation",
81 2000, -100.0, 100.0);
82
83 TH1D h1 (
"h1",
"Momentum conservation",
84 1000, 0.0, 100.0);
85
86 TH1D job (
"job",
"Particle types",
87 10001, -5000.5, +5000.5);
88
89 TH2D hv (
"hv",
"Logarithmic visible energy as function of logarithmic initial state energy",
90 100,
log10(Erange.getLowerLimit()),
log10(Erange.getUpperLimit()),
91 100,
log10(Erange.getLowerLimit()),
log10(Erange.getUpperLimit()));
92 TH1D ha (
"ha",
"Angle between neutrino-direction and visible-energy-weighted direction",
93 200, -1.0, 1.0);
94
95 TH2D hV (
"hV",
"Logarithmic hadronic visible energy as function of logarithmic total visible energy",
96 100,
log10(Erange.getLowerLimit()),
log10(Erange.getUpperLimit()),
97 100,
log10(Erange.getLowerLimit()),
log10(Erange.getUpperLimit()));
98 TH1D hA (
"hA",
"Angle between visible-energy-weighted direction and hadronic-visible-energy-weighted direction",
99 200, -1.0, 1.0);
100
101 TH1D hn (
"hn",
"Number of muons per event",
102 2001, -0.5, +2000.5);
103 TH1D he (
"he",
"Muon energies",
104 1000, 0.0, 10.0);
105 TH2D hp (
"hp",
"Muon positions",
106 100, 0.0, 2.0e5,
107 200, 0.0, 1.5e3);
108
109 while (inputFile.hasNext()) {
110
112
113 const Evt*
event = inputFile.next();
114
117 }
118
120
121 const Trk& neutrino =
event->mc_trks[0];
122
125
126 const double E0 =
getE0(*event);
127 const double E1 =
getE1(*event);
128
130
132 NOTICE(
"event: " <<
RIGHT(8) << event->mc_id <<
RIGHT(67) <<
"energy [GeV] momentum (x, y, z) [GeV] distance [m]" <<
endl);
133
134 for (size_t i = 0; i != event->mc_trks.size(); ++i) {
135
136 const Trk&
track =
event->mc_trks[i];
137
141
143 }
145 }
146
147 h0.Fill( E0 - E1 );
148 h1.Fill((
P0 -
P1).len());
149
152
155
157
160
163
166 }
167 }
168
169
171
173
178 }
179 }
180
182 }
183
185
186 out.Write();
187 out.Close();
188
189 return 0;
190}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_STRING(A)
Make string.
Template definition of a multi-dimensional oscillation probability interpolation table.
JDirection3D getDirection(const Vec &dir)
Get direction.
Vec getP0(const Evt &evt)
Get momentum vector of the initial state of a neutrino interaction.
JCylinder3D getCylinder(const JHead &header)
Get cylinder corresponding to the positions of generated tracks (i.e.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
double getE1(const Evt &evt)
Get final state energy of a neutrino interaction.
double getE0(const Evt &evt)
Get initial state energy of a neutrino interaction.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Vec getP1(const Evt &evt)
Get momentum vector of the final state of a neutrino interaction.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double getVisibleEnergyLeadingLepton(const Trk &, const JCylinder3D &)
Vec getVisibleEnergyVectorLeadingLepton(const Evt &event, const JCylinder3D &can=getMaximumContainmentVolume())
Get visible energy vector of the leading lepton of a neutrino interaction.
double getVisibleEnergy(const Trk &, const JCylinder3D &)
Get the visible energy of a track.
Vec getVisibleEnergyVector(const Trk &track, const JCylinder3D &can=getMaximumContainmentVolume())
Get the visible energy vector of a track.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
static int ROOT_IO_VERSION
Streamer version as obtained from ROOT file.
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
static const JPDB & getInstance()
Get particle data book.
The cylinder used for photon tracking.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
Auxiliary data structure for alignment of data.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Vec pos
postion [m] of the track at time t
The Vec class is a straightforward 3-d vector, which also works in pyroot.