88 using namespace KM3NETDAQ;
106 JParser<> zap(
"Example program to histogram neutrino effective mass for triggered events.");
110 zap[
'R'] =
make_field(wall,
"Addition margin around the volume in which the considered events must reside") = 0.0;
111 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
114 zap[
'a'] =
make_field(detectorFile,
"Detector file: if not provided, trigger fraction is not calculated") =
"";
118 catch(
const exception &error) {
119 FATAL(error.what() << endl);
128 if (detectorFile !=
"") {
148 double Xmin = numeric_limits<double>::max();
149 double Xmax = numeric_limits<double>::lowest();
157 const JVolume volume(header, logx);
159 if (volume.getXmin() < Xmin) { Xmin = volume.getXmin(); }
160 if (volume.getXmax() > Xmax) { Xmax = volume.getXmax(); }
162 volumes.push_back(volume);
166 canvol.addMargin(wall);
168 if (can.
getVolume() > canvol.getVolume()) { canvol = can; }
178 if (inst.getVolume() > instvol.getVolume()) { instvol = inst; }
190 TH1::SetDefaultSumw2();
200 const size_t scannerIndex =
distance(scanners.begin(), scanner);
202 const JVolume& volume = volumes[scannerIndex];
204 NOTICE(
"JEffectiveMass1D: Instrumented volume dimensions (zmin, zmax, r): " << instvol.getZmin() <<
" " << instvol.getZmax() <<
" " << instvol.getRadius() << endl );
210 NOTICE(
"Scanning generated events for file type " << scannerIndex << endl);
212 while (scanner->hasNext()) {
214 STATUS(
"event: " << setw(10) << scanner->getCounter() <<
'\r');
DEBUG(endl);
216 const Evt*
event = scanner->next();
222 const bool isValid1 = (canvol.is_inside(vertex) || hasIntersectingMuon(*event, canvol));
223 const bool isValid2 = (instvol.is_inside(vertex) || hasIntersectingMuon(*event, instvol));
226 hNM[primary.
type]->Fill(volume.getX(primary.
E), isValid1 ? scanner->getWeight(*event) : 0.0);
229 hNm[primary.
type]->Fill(volume.getX(primary.
E), isValid2 ? scanner->getWeight(*event) : 0.0);
234 if (scanner->getCounter() == 0) {
235 FATAL(
"JEffectiveMass1D: generated events not stored in the input file, JTriggerEfficiency should be run without option -O");
242 NOTICE(
"Scanning triggered events for file type " << scannerIndex << endl);
246 while (
in.hasNext()) {
248 STATUS(
"event: " << setw(10) <<
in.getCounter() <<
'\r');
DEBUG(endl);
252 const Evt*
event = mp;
258 const bool isValid1 = (canvol.is_inside(vertex) || hasIntersectingMuon(*event, canvol));
259 const bool isValid2 = (instvol.is_inside(vertex) || hasIntersectingMuon(*event, instvol));
261 hM[primary.
type]->Fill(volume.getX(primary.
E), isValid1 ?
in.getWeight(*event) : 0.0);
262 hm[primary.
type]->Fill(volume.getX(primary.
E), isValid2 ?
in.getWeight(*event) : 0.0);
277 const int pdgID = *
i;
279 hM[pdgID]->Divide(hNM[pdgID]);
281 hm[pdgID]->Divide(hNm[pdgID]);
JVertex3D getVertex(const Trk &track)
Get vertex.
Utility class to parse command line options.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
const Trk & get_primary(const Evt &evt)
Get primary.
static const double DENSITY_SEA_WATER
Fixed environment values.
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...
#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.
int type
MC: particle type in PDG encoding.
double getVolume() const
Get volume.
Auxiliary base class for list of file names.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
std::vector< filescanner_type >::iterator iterator
const JHead & getHeader() const
Get header.
Data structure for position in three dimensions.
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
Template event-weighter-associated file scanner.
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.
std::vector< filescanner_type >::const_iterator const_iterator
int numberOfBins
number of bins for average CDF integral of optical module
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.
The cylinder used for photon tracking.