45{
49
52 bool logx;
55 std::string option;
58
59
60 try {
61
62 JParser<> zap(
"Example program to histogram neutrino effective mass for triggered events.");
63
66 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
69 zap[
'O'] =
make_field(option,
"Result option") = Mass_t, Volume_t;
72
73 zap(argc, argv);
74 }
75 catch(const exception &error) {
76 FATAL(error.what() << endl);
77 }
78
79 try {
80
82
83 double Xmin = numeric_limits<double>::max();
84 double Xmax = numeric_limits<double>::lowest();
85
87
88 Xmin = (logx ? log10(
X.getLowerLimit()) :
X.getLowerLimit());
89 Xmax = (logx ? log10(
X.getUpperLimit()) :
X.getUpperLimit());
90
91 } else {
92
94
95 const JVolume volume(scanner->getHeader(), logx);
96
97 if (volume.getXmin() < Xmin) { Xmin = volume.getXmin(); }
98 if (volume.getXmax() > Xmax) { Xmax = volume.getXmax(); }
99 }
100 }
101
103
105
107
108 NOTICE(
"Scanning file type " << scanner->getName() << endl);
109 DEBUG (header << endl);
110
111 const JEvtWeight& weighter = scanner->getEvtWeighter();
112
114 FATAL(
"Mising normalisation in header." << endl);
115 }
116
118
121 else
123
125
126 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
127
129
131 const Evt*
event = ps;
133
135
138 double w = (
getVolume(weighter, *event) /
139 (logx ? log(10.0) *
primary.E * hm->GetBinWidth(1) : hm->GetBinWidth(1)) /
140 Wnorm);
141
142 if (option == Mass_t) {
144 } else if (option == Volume_t) {
146 }
147
149 }
150 }
152 }
153
155
156 out << hm;
157
158 out.Close();
159 }
161 FATAL(error << endl);
162 }
163}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int numberOfBins
number of bins for average CDF integral of optical module
const JHead & getHeader() const
Get header.
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
Auxiliary class for trigger mask.
bool hasTriggerMask(const JDAQTriggerMask &mask) const
Has trigger bit pattern.
double getVolume(const JType< JEvtWeightGSeaGen > &type, const Evt &evt)
Get volume of given event according given weighter.
const Trk & get_primary(const Evt &evt)
Auxiliary function to retrieve the primary track of an event.
static const double PI
Mathematical constants.
static const double DENSITY_SEA_WATER
Fixed environment values.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
static const JDAQTriggerMask TRIGGER_MASK_ON
Trigger mask on;.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Abstract base class for event weighing.
Auxiliary class for histogramming of effective volume.
JRange_t cosT
Cosine zenith angle range
double numberOfEvents
Number of events.
General purpose class for multiple pointers.
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
Auxiliary base class for list of file names.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
virtual bool hasNext() override
Check availability of next element.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.