38 const char*
const Mass_t =
"Mass";
39 const char*
const Volume_t =
"Volume";
52 THROW(
JNoValue,
"getWnorm(): Mising normalisation in header.");
74int main(
int argc,
char **argv)
86 JAbstractHistogram_t
X;
101 JParser<> zap(
"Example program to histogram neutrino effective mass for triggered events using offline files.");
106 = JAbstractHistogram_t(100, 1.0, 100.0);
107 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
108 zap[
'C'] =
make_field(cylinder,
"Cylinder to compute visible energy depositions")
110 zap[
'm'] =
make_field(margin,
"Extra margin to consider visible energy depositions")
112 zap[
'e'] =
make_field(epsilon,
"Minimal amount of visible energy assigned to events") = 1e-8;
113 zap[
'O'] =
make_field(option,
"Result option")
115 zap[
'T'] =
make_field(trigger_mask,
"Trigger mask")
121 catch(
const exception &error) {
122 FATAL(error.what() << endl);
130 const double Xmin =
X.getLowerLimit();
131 const double Xmax =
X.getUpperLimit();
132 const int Xnbins =
X.getNumberOfBins();
145 NOTICE(
"Scanning file type " << scanner->getName() << endl);
146 DEBUG (header << endl);
150 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
152 Evt*
event = in.next();
164 Wnorm = getWnorm(header);
166 }
else if (uuid_is_null(event->header_uuid) == 0) {
170 MultiHead::const_iterator i = multiheader.
find(mergedUUID.
uuid,
true);
172 if (i == multiheader.cend()) {
173 FATAL(
"Could not find header corresponding to UUID: " <<
JUUID(event->header_uuid) << endl);
176 const JHead header1(*i);
177 DEBUG(header1 << endl);
179 Wnorm = getWnorm(header1);
185 FATAL(
"Mising normalisation in event/header." << endl);
190 if (
can.getVolume() == 0.0) {
194 can.addMargin(margin);
200 double EvisHad = Evis - EvisLL;
202 if (Evis == 0) Evis = epsilon;
203 if (EvisLL == 0) EvisLL = epsilon;
204 if (EvisHad == 0) EvisHad = epsilon;
207 const double x1 = logx ? log10(Evis) : Evis;
208 const double x2 = logx ? log10(EvisLL) : EvisLL;
209 const double x3 = logx ? log10(EvisHad) : EvisHad;
213 (logx ? log(10.0) *
primary.E * hm0->GetBinWidth(1) : hm0->GetBinWidth(1)) /
216 if (option == Mass_t) {
218 }
else if (option == Volume_t) {
225 hm0[interactionID0]->Fill(x0, y);
226 hm1[interactionID0]->Fill(x1, y);
227 hm2[interactionID0]->Fill(x2, y);
228 hm3[interactionID0]->Fill(x3, y);
230 hm0[interactionID1]->Fill(x0, y);
231 hm2[interactionID1]->Fill(x2, y);
232 hm1[interactionID1]->Fill(x1, y);
233 hm3[interactionID1]->Fill(x3, y);
240 hm0[interactionID2]->Fill(x0, y);
241 hm1[interactionID2]->Fill(x1, y);
242 hm2[interactionID2]->Fill(x2, y);
243 hm3[interactionID2]->Fill(x3, y);
245 hm0[interactionID3]->Fill(x0, y);
246 hm2[interactionID3]->Fill(x2, y);
247 hm1[interactionID3]->Fill(x1, y);
248 hm3[interactionID3]->Fill(x3, y);
257 out << hm0 << hm1 << hm2 << hm3;
int main(int argc, char **argv)
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Dynamic ROOT object management.
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
ROOT TTree parameter settings of various packages.
const JHead & getHeader() const
Get header.
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
Exception for missing value.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
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.
JCylinder3D getCylinder(const JHead &header)
Get cylinder corresponding to the positions of generated tracks (i.e.
bool has_leading_lepton(const Evt &event)
Auxiliary function to check if an event contains the leading lepton of a neutrino interaction.
const Trk & get_primary(const Evt &evt)
Auxiliary function to retrieve the primary track of an event.
JEvtWeighter getEventWeighter
Function object for mapping header to event weighter.
int getInteractionID(const Evt &event, const bool useScatteringType=true, const bool useDecayType=true)
Retrieve interaction identifier.
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).
double getVisibleEnergyLeadingLepton(const Trk &, const JCylinder3D &)
double getVisibleEnergy(const Trk &, const JCylinder3D &)
Get the visible energy of a track.
JMultiHead getMultiHeader(const JMultipleFileScanner_t &file_list)
Get multi-header corresponding to a given file list.
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.
Helper class for event weighing.
void configure(const JEvtWeight &weighter)
Configuration.
JEvtWeight & getEvtWeighter() const
Get reference to event-weighter.
Auxiliary data structure to store multiple headers and bookkeep event-weight normalisations.
JUUID getHeaderUUID(const Evt &event) const
Get the header UUID corresponding to the given event.
The cylinder used for photon tracking.
JRange_t cosT
Cosine zenith angle range
double numberOfEvents
Number of events.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
Auxiliary base class for list of file names.
const_iterator find(const uuid_t &uuid, const bool useCache=false) const
Find header with given UUID.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.