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 );
129 TH1D hM(
"hM",
"effective mass (can) [kg]" ,
numberOfBins, volume.getXmin(), volume.getXmax());
130 TH1D hm(
"hm",
"effective mass (instrumented) [kg]",
numberOfBins, volume.getXmin(), volume.getXmax());
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);
194 while (
in.hasNext() ) {
196 STATUS(
"event: " << setw(10) <<
in.getCounter() <<
'\r');
DEBUG(endl);
198 const Evt*
event =
in.next();
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() );
217 if (
in.getCounter() == 0 ) {
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.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
bool is_gseagen(const JHead &header)
Check for generator.
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)...
static const double DENSITY_SEA_WATER
Fixed environment values.
double E
Energy [GeV] (either MC truth or reconstructed)
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Auxiliary class for histogramming of effective volume.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
JPosition3D getPosition(const Vec &pos)
Get position.
void addMargin(const double D)
Add (safety) margin.
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.
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.