TG4HitSegment.h
Go to the documentation of this file.
1 #ifndef TG4HitSegment_hxx_seen
2 #define TG4HitSegment_hxx_seen
3 
4 #include <TLorentzVector.h>
5 #include <TObject.h>
6 
7 #include <map>
8 #include <vector>
9 
10 namespace EDepSim {class PersistencyManager;}
12 
13 /// A container for the hit segment information.
14 typedef std::vector<TG4HitSegment> TG4HitSegmentContainer;
15 
16 /// A map with one entry per sensitive detector using the TG4HitSegment object
17 /// to summarize hits.
18 typedef std::map<std::string,TG4HitSegmentContainer> TG4HitSegmentDetectors;
19 
20 /// Save the amount and location of energy deposition. It contains the global
21 /// position of the starting point and stopping point of the track segment
22 /// that created the hit. The energy should be assumed to be deposited
23 /// uniformly between the two points (the length of the segment can, and
24 /// should, be limited in G4, so that shouldn't be a bad assumption). Both
25 /// the total and secondary energy deposition is saved. The definition of the
26 /// secondary energy depends on the configuration of the simulation, but
27 /// generally, it refers to the amount of energy going into scintillation.
28 class TG4HitSegment : public TObject {
30 public:
31  typedef std::vector<Int_t> Contributors;
32 
34  : PrimaryId(0), EnergyDeposit(0), SecondaryDeposit(0),
35  TrackLength(0), Start(0,0,0,0), Stop(0,0,0,0) {}
36  virtual ~TG4HitSegment();
37 
38  /// The track id of the most important particle associated with this hit
39  /// segment.
40  int GetPrimaryId() const {return PrimaryId;}
41 
42  /// The total energy deposit in this hit.
43  double GetEnergyDeposit() const {return EnergyDeposit;}
44 
45  /// The "secondary" energy deposit in this hit. Generally, this is used to
46  /// help simulate the amount of energy emitted as scintillation light,
47  /// i.e. opticalphotons, and is part of the total energy deposit. The
48  /// remaining energy will be deposited as ionization. In this model (in
49  /// argon), the mean number of quanta created will be <N_q> =
50  /// (fEnergyDeposit)/(19.5*eV), N_q should be fluctuated around <N_q>,
51  /// N_ph = N_q*fSecondaryDeposit/fEnergyDeposit, and N_e = N_q - N_ph.
52  /// Thd fSecondaryDeposit value already includes the binomial fluctuation,
53  /// so don't fluctuate N_ph or N_e.
54  double GetSecondaryDeposit() const {return SecondaryDeposit;}
55 
56  /// The total charged track length in this hit. This includes the
57  /// contribution from all of the secondary particles (e.g. delta-rays)
58  /// that are included in this hit.
59  double GetTrackLength() const {return TrackLength;}
60 
61  /// The starting position of the segment.
62  const TLorentzVector& GetStart() const {return Start;}
63 
64  /// The stopping position of the segment.
65  const TLorentzVector& GetStop() const {return Stop;}
66 
67  /// The TrackId for each trajectory that contributed to this hit. This
68  /// could contain the TrackId of the primary particle, but not
69  /// necessarily.
70  Contributors Contrib;
71 
72 // The public fields are deprecated but still supported by default in the
73 // current version.
74 #define EDEPSIM_USE_PUBLIC_FIELDS
75 
76 #if defined(EDEPSIM_USE_PUBLIC_FIELDS)&&!defined(EDEPSIM_FORCE_PRIVATE_FIELDS)&&!defined(__CINT__)
77 public:
78 #ifdef EDEPSIM_WARN_PUBLIC_FIELDS
79 #warning Using deprecated public fields. Please consider using the accessor. For example, to access PrimaryId, use GetPrimaryId().
80 #endif
81 #else
82 private:
83 #endif
84 
85  /// The track id of the most important particle associated with this hit
86  /// segment.
87  Int_t PrimaryId;
88 
89  /// The total energy deposit in this hit.
90  Float_t EnergyDeposit;
91 
92  /// The "secondary" energy deposit in this hit. Generally, this is used to
93  /// help simulate the amount of energy emitted as scintillation light,
94  /// i.e. opticalphotons, and is part of the total energy deposit. The
95  /// remaining energy will be deposited as ionization. In this model (in
96  /// argon), the mean number of quanta created will be <N_q> =
97  /// (fEnergyDeposit)/(19.5*eV), N_q should be fluctuated around <N_q>,
98  /// N_ph = N_q*fSecondaryDeposit/fEnergyDeposit, and N_e = N_q - N_ph.
99  /// Thd fSecondaryDeposit value already includes the binomial fluctuation,
100  /// so don't fluctuate N_ph or N_e.
102 
103  /// The total charged track length in this hit. This includes the
104  /// contribution from all of the secondary particles (e.g. delta-rays)
105  /// that are included in this hit.
106  Float_t TrackLength;
107 
108  /// The starting position of the segment.
109  TLorentzVector Start;
110 
111  /// The stopping position of the segment.
112  TLorentzVector Stop;
113 
115 };
116 #endif
Float_t TrackLength
double GetEnergyDeposit() const
The total energy deposit in this hit.
Definition: TG4HitSegment.h:43
std::map< std::string, TG4HitSegmentContainer > TG4HitSegmentDetectors
Definition: TG4HitSegment.h:18
TLorentzVector Stop
The stopping position of the segment.
Float_t EnergyDeposit
The total energy deposit in this hit.
Definition: TG4HitSegment.h:90
std::vector< TG4HitSegment > TG4HitSegmentContainer
A container for the hit segment information.
Definition: TG4HitSegment.h:11
int GetPrimaryId() const
Definition: TG4HitSegment.h:40
Construct a module from components.
Definition: TG4HitSegment.h:10
std::vector< Int_t > Contributors
Definition: TG4HitSegment.h:31
Float_t SecondaryDeposit
double GetTrackLength() const
Definition: TG4HitSegment.h:59
double GetSecondaryDeposit() const
Definition: TG4HitSegment.h:54
Contributors Contrib
Definition: TG4HitSegment.h:70
const TLorentzVector & GetStop() const
The stopping position of the segment.
Definition: TG4HitSegment.h:65
TLorentzVector Start
The starting position of the segment.
#define Start
Definition: config.cpp:1229
const TLorentzVector & GetStart() const
The starting position of the segment.
Definition: TG4HitSegment.h:62