EDEpReader
Loading...
Searching...
No Matches
EDEPHit.h
1#ifndef EDEPHIT_H
2#define EDEPHIT_H
3
4#include <iostream>
5
6#include "EDEPUtils.h"
7
8#include "TG4Event.h"
9
17class EDEPHit {
18
19 public:
23 EDEPHit() = default;
28 EDEPHit(TG4HitSegment hit) : start_(hit.GetStart()), stop_(hit.GetStop()),
29 start_momentum_(0,0,0), stop_momentum_(0,0,0),
30 energy_deposit_(hit.GetEnergyDeposit()), secondary_deposit_(hit.GetSecondaryDeposit()),
31 track_length_(hit.GetTrackLength()), contrib_(hit.Contrib[0]), primary_id_(hit.GetPrimaryId()), h_index(-1) {};
32
37 EDEPHit(TG4HitSegment hit, int i) : start_(hit.GetStart()), stop_(hit.GetStop()),
38 start_momentum_(0,0,0), stop_momentum_(0,0,0),
39 energy_deposit_(hit.GetEnergyDeposit()), secondary_deposit_(hit.GetSecondaryDeposit()),
40 track_length_(hit.GetTrackLength()), contrib_(hit.Contrib[0]), primary_id_(hit.GetPrimaryId()), h_index(i) {};
41
45
50 const TLorentzVector& GetStart() const {return start_;};
51
56 const TLorentzVector& GetStop() const {return stop_;};
57
62 const TVector3& GetStartMomentum() const {return start_momentum_;};
63
68 const TVector3& GetStopMomentum() const {return stop_momentum_;};
69
74 const double& GetEnergyDeposit() const {return energy_deposit_;};
75
80 const double& GetSecondaryDeposit() const {return secondary_deposit_;};
81
86 const double& GetTrackLength() const {return track_length_;};
87
92 const int& GetGetContrib() const {return contrib_;};
93
98 const int& GetPrimaryId() const {return primary_id_;};
99
104 const int& GetId() const {return h_index;};
105
106 private:
107 TLorentzVector start_;
108 TLorentzVector stop_;
109 TVector3 start_momentum_;
110 TVector3 stop_momentum_;
111 double energy_deposit_;
112 double secondary_deposit_;
113 double track_length_;
114 int contrib_;
115 int primary_id_;
116 int h_index;
117};
118
122using EDEPHitsMap = std::map<component, std::vector<EDEPHit>>;
123
124#endif
EDEPHit(TG4HitSegment hit)
Constructor for EDEPHit.
Definition EDEPHit.h:28
const double & GetSecondaryDeposit() const
Get the secondary deposition of the hit.
Definition EDEPHit.h:80
EDEPHit()=default
Default constructor for EDEPHit in dictionaries.
const TVector3 & GetStartMomentum() const
Get the true momentum at the start position of the hit.
Definition EDEPHit.h:62
const double & GetTrackLength() const
Get the track length of the hit.
Definition EDEPHit.h:86
EDEPHit(TG4HitSegment hit, int i)
Constructor for EDEPHit.
Definition EDEPHit.h:37
const TVector3 & GetStopMomentum() const
Get the true momentum at the stop position of the hit.
Definition EDEPHit.h:68
const int & GetGetContrib() const
Get the main contributor to the hit.
Definition EDEPHit.h:92
const int & GetPrimaryId() const
Get the ID of the primary particle generating the hit.
Definition EDEPHit.h:98
const TLorentzVector & GetStop() const
Get the stop position of the hit.
Definition EDEPHit.h:56
const int & GetId() const
Get the ID of the hit.
Definition EDEPHit.h:104
~EDEPHit()
Destructor for EDEPHit.
Definition EDEPHit.h:44
const TLorentzVector & GetStart() const
Get the start position of the hit.
Definition EDEPHit.h:50
const double & GetEnergyDeposit() const
Get the energy deposited by the hit.
Definition EDEPHit.h:74