sandreco  1.0.8
A modular reconstruction software for SAND
EDEPHit.h
1 #pragma once
3 
4 #include <TG4Event.h>
5 #include <common/sand.h>
6 
7 #include <map>
8 #include <vector>
9 
17 class EDEPHit {
18  public:
23  EDEPHit() = default;
24 
25  explicit EDEPHit(const TG4HitSegment& hit, int i = -1)
26  : start_(hit.GetStart()),
27  stop_(hit.GetStop()),
28  energy_deposit_(hit.GetEnergyDeposit()),
29  secondary_deposit_(hit.GetSecondaryDeposit()),
30  track_length_(hit.GetTrackLength()),
31  contrib_(hit.Contrib.at(0)),
32  primary_id_(hit.GetPrimaryId()),
33  h_index(i) {};
45  EDEPHit(const sand::vec_4d& start,
46  const sand::vec_4d& stop,
47  double energy_deposit,
48  double secondary_deposit,
49  double track_length,
50  int contrib,
51  int primary_id,
52  int i)
53  : start_(start),
54  stop_(stop),
55  energy_deposit_(energy_deposit),
56  secondary_deposit_(secondary_deposit),
57  track_length_(track_length),
58  contrib_(contrib),
59  primary_id_(primary_id),
60  h_index(i) {};
64  ~EDEPHit() {};
65 
70  const sand::vec_4d& GetStart() const { return start_; };
71 
76  const sand::vec_4d& GetStop() const { return stop_; };
77 
82  const double& GetEnergyDeposit() const { return energy_deposit_; };
83 
88  const double& GetSecondaryDeposit() const { return secondary_deposit_; };
89 
94  const double& GetTrackLength() const { return track_length_; };
95 
100  const int& GetContrib() const { return contrib_; };
101 
106  const int& GetPrimaryId() const { return primary_id_; };
107 
112  const int& GetId() const { return h_index; };
113 
114  private:
115  sand::vec_4d start_{};
116  sand::vec_4d stop_{};
117  double energy_deposit_{};
118  double secondary_deposit_{};
119  double track_length_{};
120  int contrib_{-1};
121  int primary_id_{-1};
122  int h_index{-1};
123 };
124 
128 using EDEPHitsMap = std::map<sand::subdetector_t, std::vector<EDEPHit>>;
Represents a hit in a detector.
Definition: EDEPHit.h:17
EDEPHit()=default
Constructor for EDEPHit.
const double & GetTrackLength() const
Get the track length of the hit.
Definition: EDEPHit.h:94
const int & GetId() const
Get the ID of the hit.
Definition: EDEPHit.h:112
const sand::vec_4d & GetStart() const
Get the start position of the hit.
Definition: EDEPHit.h:70
const sand::vec_4d & GetStop() const
Get the stop position of the hit.
Definition: EDEPHit.h:76
EDEPHit(const sand::vec_4d &start, const sand::vec_4d &stop, double energy_deposit, double secondary_deposit, double track_length, int contrib, int primary_id, int i)
Constructor for EDEPHit.
Definition: EDEPHit.h:45
const double & GetSecondaryDeposit() const
Get the secondary deposition of the hit.
Definition: EDEPHit.h:88
~EDEPHit()
Destructor for EDEPHit.
Definition: EDEPHit.h:64
const double & GetEnergyDeposit() const
Get the energy deposited by the hit.
Definition: EDEPHit.h:82
const int & GetPrimaryId() const
Get the ID of the primary particle generating the hit.
Definition: EDEPHit.h:106
const int & GetContrib() const
Get the main contributor to the hit.
Definition: EDEPHit.h:100