28 const char*
const Mass_t =
"Mass";
29 const char*
const Volume_t =
"Volume";
39 int main(
int argc,
char **argv)
43 using namespace KM3NETDAQ;
55 JParser<> zap(
"Example program to histogram neutrino effective mass for triggered events.");
59 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
61 zap[
'O'] =
make_field(option,
"Result option") = Mass_t, Volume_t;
66 catch(
const exception &error) {
67 FATAL(error.what() << endl);
72 double Xmin = numeric_limits<double>::max();
73 double Xmax = numeric_limits<double>::lowest();
79 const JVolume volume(scanner->getHeader(), logx);
81 if (volume.getXmin() < Xmin) { Xmin = volume.
getXmin(); }
82 if (volume.getXmax() > Xmax) { Xmax = volume.getXmax(); }
91 NOTICE(
"Scanning file type " << scanner->getName() << endl);
92 DEBUG (header << endl);
94 const JEvtWeight& weighter = scanner->getEvtWeighter();
96 if (!header.
is_valid(&JHead::genvol)) {
97 FATAL(
"Mising normalisation in header." << endl);
102 if (header.
is_valid(&JHead::cut_nu))
107 while (scanner->hasNext()) {
109 STATUS(
"event: " << setw(10) << scanner->getCounter() <<
'\r');
DEBUG(endl);
111 const Evt*
event = scanner->next();
114 double x = logx ?
log10(primary.
E) : primary.
E;
117 (logx ? log(10.0) * primary.
E * hm->GetBinWidth(1) : hm->GetBinWidth(1)) /
120 if (option == Mass_t) {
122 }
else if (option == Volume_t) {
126 hm[primary.
type]->Fill(x, y);
138 FATAL(error << endl);
Utility class to parse command line options.
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
Double_t getXmin() const
Get minimal abscissa value.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
double getVolume(const JType< JEvtWeightGSeaGen > &type, const Evt &evt)
Get volume of given event according given weighter.
double numberOfEvents
Number of events.
const Trk & get_primary(const Evt &evt)
Get primary.
static const double DENSITY_SEA_WATER
Fixed environment values.
Dynamic ROOT object management.
double E
Energy [GeV] (either MC truth or reconstructed)
Auxiliary class for histogramming of effective volume.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Abstract base class for event weighing.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
set_variable E_E log10(E_{fit}/E_{#mu})"
static const double PI
Mathematical constants.
JRange_t cosT
Cosine zenith angle range.
General purpose messaging.
int type
MC: particle type in PDG encoding.
Auxiliary base class for list of file names.
std::vector< filescanner_type >::iterator iterator
Utility class to parse command line options.
const JHead & getHeader() const
Get header.
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
std::vector< filescanner_type >::const_iterator const_iterator
int numberOfBins
number of bins for average CDF integral of optical module
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.