40 int main(
int argc,
char **argv)
44 using namespace KM3NETDAQ;
61 JParser<> zap(
"Example program to histogram neutrino effective mass for triggered events.");
65 zap[
'R'] =
make_field(wall,
"Addition margin around the volume in which the considered events must reside") = 0.0;
66 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
69 zap[
'a'] =
make_field(detectorFile,
"Detector file: if not provided, trigger fraction is not calculated") =
"";
73 catch(
const exception &error) {
74 FATAL(error.what() << endl);
92 if (detectorFile !=
"") {
106 const JHead buffer(head);
111 const JVolume volume(head, logx);
121 NOTICE(
"JVolume1D: Instrumented volume dimensions (zmin, zmax, r): " << instvol.getZmin() <<
" " << instvol.getZmax() <<
" " << instvol.getRadius() << endl );
138 NOTICE(
"JVolume1D: Scanning triggered events." << endl);
139 while (inputFile.hasNext()) {
141 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
145 const Evt*
event = ps;
151 const double E = neutrino.
E;
157 hM.Fill(volume.
getX(E), canvol.is_inside(vertex) ? 1.0 : 0.0);
160 hm.Fill(volume.
getX(E), instvol.is_inside(vertex) ? 1.0 : 0.0);
165 hM.Fill(volume.
getX(E), volume.
getW(hM.GetXaxis(),
E));
170 WARNING(
"JEffectiveMass1D: cannot find neutrino in triggered event " << inputFile.getCounter() );
183 TH1D* hNM = (TH1D*) hM.Clone(
"hNM");
187 TH1D* hNm = (TH1D*) hm.Clone(
"hNm");
190 NOTICE(
"JVolume1D: Scanning generated events." << endl);
204 const double E = neutrino.
E;
206 hNM->Fill(volume.
getX(E), canvol.is_inside(vertex) ? 1.0 : 0.0);
207 hNm->Fill(volume.
getX(E), instvol.is_inside(vertex) ? 1.0 : 0.0);
211 WARNING(
"JVolume1D: cannot find neutrino in generated event " << inputFile.getCounter() );
218 FATAL(
"JVolume1D: generated events not stored in the input file, JTriggerEfficiency should be run without option -O");
Utility class to parse command line options.
Double_t getXmin() const
Get minimal abscissa value.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
bool is_gseagen(const JHead &header)
Check for generator.
Synchronously read DAQ events and Monte Carlo events (and optionally other events).
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
Double_t getXmax() const
Get maximal abscissa value.
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
static const double DENSITY_SEA_WATER
Fixed environment values.
double E
Energy [GeV] (either MC truth or reconstructed)
Data structure for detector geometry and calibration.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Auxiliary class for histogramming of effective volume.
virtual bool hasNext() override
Check availability of next element.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Double_t getW(TAxis *axis, const Double_t E) const
Get bin width corrected energy spectrum dependent weight.
JPosition3D getPosition(const Vec &pos)
Get position.
void addMargin(const double D)
Add (safety) margin.
General purpose messaging.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
virtual const pointer_type & next() override
Get next element.
counter_type getCounter() const
Get counter.
Data structure for position in three dimensions.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
do set_variable DETECTOR_TXT $WORKDIR detector
General purpose class for multiple pointers.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
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.