Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAAnetToolkit.hh
Go to the documentation of this file.
1 #ifndef __JAANET__JAANETTOOLKIT__
2 #define __JAANET__JAANETTOOLKIT__
3 
4 #include <stdlib.h>
5 #include <limits>
6 #include <algorithm>
7 
15 
16 #include "JLang/JException.hh"
17 #include "JTools/JRange.hh"
20 #include "JGeometry3D/JAxis3D.hh"
21 #include "JGeometry3D/JTrack3D.hh"
22 #include "JGeometry3D/JTrack3E.hh"
23 #include "JGeometry3D/JVertex3D.hh"
25 #include "JTrigger/JHitL0.hh"
26 #include "JDetector/JTimeRange.hh"
28 #include "JDetector/JPMTRouter.hh"
29 #include "JAAnet/JParticleTypes.hh"
30 
31 
32 /**
33  * \file
34  *
35  * Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
36  * \author mdejong
37  */
38 namespace JAANET {}
39 namespace JPP { using namespace JAANET; }
40 
41 /**
42  * Extensions to AAnet data format.
43  */
44 namespace JAANET {
45 
54  using JTRIGGER::JHitL0;
58  using JTOOLS::JRange;
59 
60  /**
61  * AAshower reconstruction type for AAnet.
62  */
63  static const int AASHOWER_RECONSTRUCTION_TYPE = 101;
64 
65  /**
66  * Enumeration of hit types based on km3 codes.
67  */
68  enum JHitType_t {
69  HIT_TYPE_MUON_DIRECT = +5, //!< Direct light from muon
70  HIT_TYPE_MUON_SCATTERED = -5, //!< Scattered light from muon
71  HIT_TYPE_DELTARAYS_DIRECT = +4, //!< Direct light from delta-rays
72  HIT_TYPE_DELTARAYS_SCATTERED = -4, //!< Scattered light from delta-rays
73  HIT_TYPE_BREMSSTRAHLUNG_DIRECT = +3, //!< Direct light from Bremsstrahlung
74  HIT_TYPE_BREMSSTRAHLUNG_SCATTERED = -3, //!< Scattered light from Bremsstrahlung
75  HIT_TYPE_SHOWER_DIRECT = +99, //!< Direct light from primary shower
76  HIT_TYPE_SHOWER_SCATTERED = -99, //!< Scattered light from primary shower
77  HIT_TYPE_NOISE = -1, //!< Random noise
78  HIT_TYPE_UNKNOWN = 0 //!< Unknown source
79  };
80 
81 
82  /**
83  * Get true time of hit.
84  *
85  * \param hit hit
86  * \return true time of hit
87  */
88  inline double getTime(const Hit& hit)
89  {
90  // if IGAIN = 0 in km3 program, then pure_xx values are not set.
91 
92  if (hit.pure_a == 0.0)
93  return hit.t;
94  else
95  return hit.pure_t;
96  }
97 
98 
99  /**
100  * Get true charge of hit.
101  *
102  * \param hit hit
103  * \return true charge of hit
104  */
105  inline double getNPE(const Hit& hit)
106  {
107  // if IGAIN = 0 in km3 program, then pure_xx values are not set.
108 
109  if (hit.pure_a == 0.0)
110  return hit.a;
111  else
112  return hit.pure_a;
113  }
114 
115 
116  /**
117  * Verify hit origin.
118  *
119  * \param hit hit
120  * \return true if noise; else false
121  */
122  inline bool is_noise(const Hit& hit)
123  {
124  return hit.type == HIT_TYPE_NOISE;
125  }
126 
127 
128  /**
129  * Get time range (i.e.\ time between earliest and latest hit) of Monte Carlo event.\n
130  * Note that the global event time in not taken into account.
131  *
132  * \param event event
133  * \return time range
134  */
135  inline JTimeRange getTimeRange(const Evt& event)
136  {
138 
139  for (std::vector<Hit>::const_iterator hit = event.mc_hits.begin(); hit != event.mc_hits.end(); ++hit) {
140  if (!is_noise(*hit)) {
141  time_range.include(getTime(*hit));
142  }
143  }
144 
145  return time_range;
146  }
147 
148 
149  /**
150  * Get time range (i.e.\ time between earliest and latest hit) of Monte Carlo event.\n
151  * The resulting time range is larger than or equal to the given time window.\n
152  * Note that the global event time in not taken into account.
153  *
154  * \param event event
155  * \param T_ns time window [ns]
156  * \return time range
157  */
158  inline JTimeRange getTimeRange(const Evt& event, const JTimeRange& T_ns)
159  {
160  JTimeRange time_range = getTimeRange(event);
161 
162  if (time_range.getLength() < T_ns.getLength()) {
163  time_range.setLength(T_ns.getLength());
164  }
165 
166  return time_range;
167  }
168 
169 
170  /**
171  * Get position.
172  *
173  * \param v vector
174  * \return position
175  */
176  inline JPosition3D getPosition(const Vec& v)
177  {
178  return JPosition3D(v.x, v.y, v.z);
179  }
180 
181 
182  /**
183  * Get position.
184  *
185  * \param track track
186  * \return position
187  */
188  inline JPosition3D getPosition(const Trk& track)
189  {
190  return getPosition(track.pos);
191  }
192 
193 
194  /**
195  * Get direction.
196  *
197  * \param v vector
198  * \return direction
199  */
201  {
202  return JDirection3D(v.x, v.y, v.z);
203  }
204 
205  /**
206  * Get direction.
207  *
208  * \param track track
209  * \return direction
210  */
211  inline JDirection3D getDirection(const Trk& track)
212  {
213  return getDirection(track.dir);
214  }
215 
216 
217  /**
218  * Get axis.
219  *
220  * \param track track
221  * \return axis
222  */
223  inline JAxis3D getAxis(const Trk& track)
224  {
225  return JAxis3D(getPosition(track), getDirection(track));
226  }
227 
228 
229  /**
230  * Get track.
231  *
232  * \param track track
233  * \return track
234  */
235  inline JTrack3E getTrack(const Trk& track)
236  {
237  return JTrack3E(JTrack3D(getAxis(track), track.t), track.E);
238  }
239 
240 
241  /**
242  * Get vertex.
243  *
244  * \param track track
245  * \return vertex
246  */
247  inline JVertex3D getVertex(const Trk& track)
248  {
249  return JVertex3D(getPosition(track), track.t);
250  }
251 
252 
253  /**
254  * Get transformation.
255  *
256  * \param track track
257  * \return transformation
258  */
260  {
261  return JTransformation3D(getPosition(track), getDirection(track));
262  }
263 
264 
265  /**
266  * Get transformation.
267  *
268  * \param hit hit
269  * \return hit
270  */
271  inline JHitL0 getHit(const Hit& hit)
272  {
273  using namespace JPP;
274 
275  return JHitL0(JDAQPMTIdentifier(hit.dom_id, hit.channel_id), JAxis3D(getPosition(hit.pos), getDirection(hit.dir)), JHit(hit.t, hit.tot) );
276  }
277 
278 
279  /**
280  * Get transformation.
281  *
282  * \param hit hit
283  * \param router module router
284  * \return hit
285  */
286  inline JHitL0 getHit(const Hit& hit, const JModuleRouter& router)
287  {
288  using namespace JPP;
289 
290  const JPMT& pmt = router.getModule(hit.dom_id).getPMT(hit.channel_id);
291 
292  return JHitL0(JDAQPMTIdentifier(hit.dom_id, hit.channel_id), pmt.getAxis(), JHit(getTime(hit.tdc, pmt.getCalibration()), getToT(hit.tot, pmt.getCalibration())));
293  }
294 
295 
296  /**
297  * Get transformation.
298  *
299  * \param hit hit
300  * \param router pmt router
301  * \return hit
302  */
303  inline JHitL0 getHit(const Hit& hit, const JPMTRouter& router)
304  {
305  using namespace JPP;
306 
307  const JPMT& pmt = router.getPMT(hit.pmt_id);
308 
309  return JHitL0(JDAQPMTIdentifier(hit.dom_id, hit.channel_id), pmt.getAxis(), JHit(getTime(hit.tdc, pmt.getCalibration()), getToT(hit.tot, pmt.getCalibration())));
310  }
311 
312 
313  /**
314  * Test whether given track is a photon or neutral pion.
315  *
316  * \param track track
317  * \return true if photon or neutral pion; else false
318  */
319  inline bool is_photon (const Trk& track) { return ( track.type == TRACK_TYPE_PHOTON ||
320  abs(track.type) == TRACK_TYPE_NEUTRAL_PION); }
321 
322  /**
323  * Test whether given track is a neutrino.
324  *
325  * \param track track
326  * \return true if neutrino; else false
327  */
328  inline bool is_neutrino(const Trk& track) { return (abs(track.type) == TRACK_TYPE_NUE ||
329  abs(track.type) == TRACK_TYPE_NUMU ||
330  abs(track.type) == TRACK_TYPE_NUTAU); }
331 
332  /**
333  * Test whether given track is a (anti-)electron.
334  *
335  * \param track track
336  * \return true if (anti-)electron; else false
337  */
338  inline bool is_electron(const Trk& track) { return (abs(track.type) == TRACK_TYPE_ELECTRON); }
339 
340  /**
341  * Test whether given track is a (anti-)muon.
342  *
343  * \param track track
344  * \return true if (anti-)muon; else false
345  */
346  inline bool is_muon (const Trk& track) { return (abs(track.type) == TRACK_TYPE_MUON); }
347 
348  /**
349  * Test whether given track is a (anti-)tau.
350  *
351  * \param track track
352  * \return true if (anti-)tau; else false
353  */
354  inline bool is_tau (const Trk& track) { return (abs(track.type) == TRACK_TYPE_TAU); }
355 
356  /**
357  * Test whether given track is a charged pion.
358  *
359  * \param track track
360  * \return true if charged pion; else false
361  */
362  inline bool is_pion (const Trk& track) { return (abs(track.type) == TRACK_TYPE_CHARGED_PION_PLUS); }
363 
364  /**
365  * Test whether given track is a (anti-)proton.
366  *
367  * \param track track
368  * \return true if (anti-)proton; else false
369  */
370  inline bool is_proton (const Trk& track) { return (abs(track.type) == TRACK_TYPE_PROTON); }
371 
372  /**
373  * Test whether given track is a (anti-)neutron.
374  *
375  * \param track track
376  * \return true if (anti-)neutron; else false
377  */
378  inline bool is_neutron (const Trk& track) { return (abs(track.type) == TRACK_TYPE_NEUTRON); }
379 
380  /**
381  * Test whether given track is a hadron
382  *
383  * \param track track
384  * \return true if hadron; else fails
385  */
386  inline bool is_hadron (const Trk& track) { return (!is_neutrino(track) &&
387  !is_electron(track) &&
388  !is_muon (track) &&
389  !is_tau (track)); }
390 
391  /**
392  * Test whether given track corresponds to given particle type.
393  *
394  * \param track track
395  * \param type particle type
396  * \return true if matches the corresponding particle; else false
397  */
398  inline bool has_particleID (const Trk& track, const int type) { return (track.type == type); }
399 
400  /**
401  * Test whether given event has an incoming neutrino.
402  *
403  * \param evt event
404  * \return true if neutrino; else false
405  */
406  inline bool has_neutrino(const Evt& evt)
407  {
408  return !evt.mc_trks.empty() && is_neutrino(evt.mc_trks[0]);
409  }
410 
411  /**
412  * Get incoming neutrino.
413  *
414  * \param evt event
415  * \return neutrino
416  */
417  inline const Trk& get_neutrino(const Evt& evt)
418  {
419  if (has_neutrino(evt))
420  return evt.mc_trks[0];
421  else
422  THROW(JIndexOutOfRange, "This event has no neutrino.");
423  }
424 
425  /**
426  * Count the number of electrons in a given event
427  *
428  * \param evt event
429  * \return number of electrons
430  */
431  inline int count_electrons(const Evt& evt)
432  {
433  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_electron);
434  }
435 
436  /**
437  * Test whether given event has an electron.
438  *
439  * \param evt event
440  * \return true if event has electron; else false
441  */
442  inline bool has_electron(const Evt& evt)
443  {
444  return count_electrons(evt) != 0;
445  }
446 
447  /**
448  * Get first electron from the event tracklist
449  *
450  * \param evt event
451  * \return electron
452  */
453  inline const Trk& get_electron(const Evt& evt)
454  {
455  if (count_electrons(evt) > 0)
456  return *std::find_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_electron);
457  else
458  THROW(JIndexOutOfRange, "This event has no electron.");
459  }
460 
461  /**
462  * Test whether given hit was produced by an electron
463  *
464  * Warning: This method will only work with the output of KM3Sim.
465  * For JSirene or KM3, you should check if <tt>track.id == hit.origin</tt> instead.
466  *
467  * \param hit hit
468  * \return true if hit was produced by an electron; else false
469  */
470  inline bool from_electron(const Hit& hit)
471  {
472  return hit.type == GEANT4_TYPE_ELECTRON || hit.type == GEANT4_TYPE_ANTIELECTRON;
473  }
474 
475  /**
476  * Count the number of muons in a given event
477  *
478  * \param evt event
479  * \return number of muons
480  */
481  inline int count_muons(const Evt& evt)
482  {
483  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_muon);
484  }
485 
486  /**
487  * Test whether given event has a muon.
488  *
489  * \param evt event
490  * \return true if event has muon; else false
491  */
492  inline bool has_muon(const Evt& evt)
493  {
494  return count_muons(evt) != 0;
495  }
496 
497  /**
498  * Get first muon from the event tracklist
499  *
500  * \param evt event
501  * \return muon
502  */
503  inline const Trk& get_muon(const Evt& evt)
504  {
505  if (count_muons(evt) > 0)
506  return *std::find_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_muon);
507  else
508  THROW(JIndexOutOfRange, "This event has no muon.");
509  }
510 
511  /**
512  * Test whether given hit was produced by a muon
513  *
514  * Warning: This method will only work with the output of KM3Sim.
515  * For JSirene or KM3, you should check if <tt>track.id == hit.origin</tt> instead.
516  *
517  * \param hit hit
518  * \return true if hit was produced by a muon; else false
519  */
520  inline bool from_muon(const Hit& hit)
521  {
522  return hit.type == GEANT4_TYPE_MUON || hit.type == GEANT4_TYPE_ANTIMUON;
523  }
524 
525  /**
526  * Count the number of taus in a given event
527  *
528  * \param evt event
529  * \return number of taus
530  */
531  inline int count_taus(const Evt& evt)
532  {
533  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_tau);
534  }
535 
536  /**
537  * Test whether given event has a tau.
538  *
539  * \param evt event
540  * \return true if event has tau; else false
541  */
542  inline bool has_tau(const Evt& evt)
543  {
544  return count_taus(evt) != 0;
545  }
546 
547  /**
548  * Get first tau from the event tracklist
549  *
550  * \param evt event
551  * \return tau
552  */
553  inline const Trk& get_tau(const Evt& evt)
554  {
555  if (count_taus(evt) > 0)
556  return *std::find_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_tau);
557  else
558  THROW(JIndexOutOfRange, "This event has no tau.");
559  }
560 
561  /**
562  * Test whether given hit was produced by a tau
563  *
564  * Warning: This method will only work with the output of KM3Sim.
565  * For JSirene or KM3, you should check if track.id == hit.origin instead.
566  *
567  * \param hit hit
568  * \return true if hit was produced by a tau; else false
569  */
570  inline bool from_tau(const Hit& hit)
571  {
572  return hit.type == GEANT4_TYPE_TAU || hit.type == GEANT4_TYPE_ANTITAU;
573  }
574 
575  /**
576  * Count the number of hadrons in a given event (not including neutral pions)
577  *
578  * \param evt event
579  * \return number of hadrons
580  */
581  inline int count_hadrons(const Evt& evt)
582  {
583  return std::count_if(evt.mc_trks.begin(), evt.mc_trks.end(), is_hadron);
584  }
585 
586  /**
587  * Test whether given hit was produced by a hadronic shower
588  *
589  * Warning: This method will only work with the output of KM3Sim.
590  * For JSirene or KM3, you should check if track.id == hit.origin instead.
591  *
592  * \param hit hit
593  * \return true if hit was produced by a hadron; else false
594  */
595  inline bool from_hadron(const Hit& hit)
596  {
597  return (!from_electron(hit) && !from_muon(hit) && !from_tau(hit));
598  }
599 
600  /**
601  * Auxiliary function to get average direction and total energy of a hadronic cascade
602  *
603  * \param evt event
604  * \return cascade (default if there are no hadrons)
605  */
606  inline Trk get_hadronic_cascade(const Evt& evt)
607  {
608  Trk cascade;
609 
610  for (std::vector<Trk>::const_iterator track = evt.mc_trks.begin(); track != evt.mc_trks.end(); ++track) {
611  if (is_hadron(*track)) {
612  cascade.E += track->E;
613  cascade.dir += track->dir * track->E;
614  cascade.t = track->t;
615  cascade.pos = track->pos;
616  }
617  }
618 
619  cascade.dir.normalize();
620 
621  return cascade;
622  }
623 
624  /**
625  * Add time offset to mc event;
626  * according to current definition, the absolute time of the event is defined by the track "t" attribute;
627  * this could change in the future if the global attribute mc_t is assigned to this purpose.
628  *
629  * \param evt event
630  * \param tOff time offset [ns]
631  */
632  inline void add_time_offset(Evt& evt, const double tOff)
633  {
634  for (std::vector<Trk>::iterator p = evt.mc_trks.begin(); p != evt.mc_trks.end(); p++) {
635  p->t += tOff;
636  }
637  }
638 }
639 
640 #endif
bool from_tau(const Hit &hit)
Test whether given hit was produced by a tau.
Router for direct addressing of PMT data in detector data structure.
Definition: JPMTRouter.hh:33
JVertex3D getVertex(const Trk &track)
Get vertex.
static const JRange< double, std::less< double > > DEFAULT_RANGE
Default range.
Definition: JRange.hh:569
bool is_electron(const Trk &track)
Test whether given track is a (anti-)electron.
int count_electrons(const Evt &evt)
Count the number of electrons in a given event.
JHitType_t
Enumeration of hit types based on km3 codes.
Exceptions.
Scattered light from primary shower.
Vec pos
hit position
Definition: Hit.hh:25
bool is_proton(const Trk &track)
Test whether given track is a (anti-)proton.
const Trk & get_muon(const Evt &evt)
Get first muon from the event tracklist.
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
const JModule & getModule(const JObjectID &id) const
Get module parameters.
JTrack3E getTrack(const Trk &track)
Get track.
Direct light from delta-rays.
double t
track time [ns] (when the particle is at pos )
Definition: Trk.hh:17
double z
Definition: Vec.hh:14
Scattered light from muon.
JTransformation3D getTransformation(const Trk &track)
Get transformation.
void add_time_offset(Evt &evt, const double tOff)
Add time offset to mc event; according to current definition, the absolute time of the event is defin...
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
bool has_electron(const Evt &evt)
Test whether given event has an electron.
int count_muons(const Evt &evt)
Count the number of muons in a given event.
Auxiliary methods for selection of reconstructed tracks.
Router for direct addressing of module data in detector data structure.
Vec dir
track direction
Definition: Trk.hh:16
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
bool has_particleID(const Trk &track, const int type)
Test whether given track corresponds to given particle type.
int pmt_id
global PMT identifier as found in evt files
Definition: Hit.hh:20
Scattered light from Bremsstrahlung.
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT.
Definition: JPMTRouter.hh:90
unsigned int tdc
hit tdc (=time in ns)
Definition: Hit.hh:16
Direct light from Bremsstrahlung.
double getTime(const Hit &hit)
Get true time of hit.
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:18
double y
Definition: Vec.hh:14
3D track with energy.
Definition: JTrack3E.hh:29
Direct light from primary shower.
Acoustics hit.
JRange< double > JTimeRange
Type definition for time range.
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
Definition: JTransitTime.sh:36
static const int AASHOWER_RECONSTRUCTION_TYPE
AAshower reconstruction type for AAnet.
bool is_noise(const Hit &hit)
Verify hit origin.
JTimeRange getTimeRange(const Evt &event)
Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.
Basic data structure for L0 hit.
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
Axis object.
Definition: JAxis3D.hh:38
double pure_t
photon time before pmt simultion (MC only)
Definition: Hit.hh:28
double getToT(const T &tot, const JCalibration &cal)
Get calibrated time-over-threshold of hit.
double a
hit amplitude (in p.e.)
Definition: Hit.hh:24
double x
Definition: Vec.hh:14
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
Trk get_hadronic_cascade(const Evt &evt)
Auxiliary function to get average direction and total energy of a hadronic cascade.
const Trk & get_electron(const Evt &evt)
Get first electron from the event tracklist.
JAxis3D getAxis(const Trk &track)
Get axis.
Data structure for PMT geometry and calibration.
Definition: JPMT.hh:47
double pure_a
amptitude before pmt simution (MC only)
Definition: Hit.hh:29
Direct access to PMT in detector data structure.
Vec dir
hit direction; i.e. direction of the PMT
Definition: Hit.hh:26
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:174
Range of values.
Definition: JRange.hh:34
Vec & normalize()
Normalise this vector.
Definition: Vec.hh:159
bool is_photon(const Trk &track)
Test whether given track is a photon or neutral pion.
bool from_hadron(const Hit &hit)
Test whether given hit was produced by a hadronic shower.
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:22
Direct access to module in detector data structure.
bool is_pion(const Trk &track)
Test whether given track is a charged pion.
Vec pos
postion of the track at time t [m]
Definition: Trk.hh:15
int count_taus(const Evt &evt)
Count the number of taus in a given event.
Definition: Hit.hh:8
const Trk & get_tau(const Evt &evt)
Get first tau from the event tracklist.
Direct light from muon.
Auxiliary class to define a range between two values.
bool has_muon(const Evt &evt)
Test whether given event has a muon.
std::vector< Hit > mc_hits
MC: list of MC truth hits.
Definition: Evt.hh:44
double t
hit time (from calibration or MC truth)
Definition: Hit.hh:23
Data structure for L0 hit.
Definition: JHitL0.hh:27
int dom_id
module identifier from the data (unique in the detector).
Definition: Hit.hh:14
Scattered light from delta-rays.
Definition of particle types.
unsigned int tot
tot value as stored in raw data (int for pyroot)
Definition: Hit.hh:17
bool has_tau(const Evt &evt)
Test whether given event has a tau.
JDirection3D getDirection(const Vec &v)
Get direction.
unsigned int channel_id
PMT channel id {0,1, .., 31} local to moduke.
Definition: Hit.hh:15
double getNPE(const Hit &hit)
Get true charge of hit.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
bool is_neutron(const Trk &track)
Test whether given track is a (anti-)neutron.
Exception for accessing an index in a collection that is outside of its range.
Definition: JException.hh:90
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
bool is_hadron(const Trk &track)
Test whether given track is a hadron.
JHitL0 getHit(const Hit &hit)
Get transformation.
bool is_tau(const Trk &track)
Test whether given track is a (anti-)tau.
data_type v[N+1][M+1]
Definition: JPolint.hh:707
bool from_electron(const Hit &hit)
Test whether given hit was produced by an electron.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:12
int type
particle type or parametrisation used for hit (mc only)
Definition: Hit.hh:30
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:45
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:19
int count_hadrons(const Evt &evt)
Count the number of hadrons in a given event (not including neutral pions)
JPosition3D getPosition(const Vec &v)
Get position.
bool from_muon(const Hit &hit)
Test whether given hit was produced by a muon.