Go to the documentation of this file.
44 inline double getE0(
const Evt& evt)
54 for (
size_t i = 1; i != evt.
mc_trks.size(); ++i) {
91 inline double getE1(
const Evt& evt)
99 for (
size_t i = 1; i != evt.
mc_trks.size(); ++i) {
126 int main(
int argc,
char **argv)
132 JLimit_t& numberOfEvents = inputFile.getLimit();
139 JParser<> zap(
"Example program to verify generator data.");
143 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
149 catch(
const exception &error) {
150 FATAL(error.what() << endl);
157 TH1D h0 (
"h0", NULL, 1001, -1.0, +1.0);
158 TH1D job(
"job", NULL, 10001, -5000.5, +5000.5);
160 TH1D hn (
"hn", NULL, 2001, -0.5, +2000.5);
161 TH1D he (
"he", NULL, 1000, 0.0, 10.0);
172 const Evt*
event = inputFile.
next();
175 job.Fill((
double) track->
type);
180 const double E0 = getE0(*event);
181 const double E1 = getE1(*event);
185 const Trk& neutrino =
event->mc_trks[0];
187 cout << endl <<
"--------------------------------------------------------" << endl;
188 cout <<
"event: " << setw(8) <<
event->mc_id <<
" energy [GeV] distance [m]" << endl;
190 for (
size_t i = 0; i !=
event->mc_trks.size(); ++i) {
192 const Trk& track =
event->mc_trks[i];
195 cout << setw(32) << left << particle.
name <<
' ' <<
FIXED(7,3) << track.
E <<
" " <<
FIXED(7,3) << (track.
pos - neutrino.
pos).len() << endl;
197 cout << setw(32) << left <<
"balance" <<
' ' <<
FIXED(7,3) << E0 - E1 << endl;
200 h0.Fill((E0 - E1)/E0);
210 he.Fill(log10(track->
E));
215 hn.Fill((Double_t)
n);
std::vector< Trk > mc_trks
MC: list of MC truth tracks
Auxiliary class for defining the range of iterations of objects.
Auxiliary data structure for floating point format specification.
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
static const JPDB & getInstance()
Get particle data book.
double E
Energy (either MC truth or reconstructed)
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
std::string name
name of particle
Utility class to parse command line options.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
int main(int argc, char **argv)
counter_type getCounter() const
Get counter.
virtual const pointer_type & next()
Get next element.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
int type
MC: particle type in PDG encoding.
virtual bool hasNext()
Check availability of next element.
Vec pos
postion of the track at time t
const JParticle & getPDG(const int pdg) const
Get particle corresponding to given PDG code.
Auxiliary class to handle particle name, codes and mass.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose class for object reading from a list of file names.
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
#define DEBUG(A)
Message macros.