HerdSoftware  0.1.1
ParticleHit.h
Go to the documentation of this file.
1 /*
2  * ParticleHit.h
3  *
4  * Created on: 3 Dec 2018
5  * Author: Nicola Mori
6  */
7 
8 #ifndef HERD_PARTICLEHIT_H_
9 #define HERD_PARTICLEHIT_H_
10 
11 // HerdSoftware headers
12 #include "common/DefaultValues.h"
13 #include "dataobjects/Momentum.h"
14 #include "dataobjects/Point.h"
15 
16 #ifdef HS_USE_ROOT
17 #include "Rtypes.h"
18 #endif
19 
20 // c++ headers
21 #include <array>
22 
23 namespace Herd {
24 
33 class ParticleHit {
34 public:
39 
51  ParticleHit(int particlePDG, float eDep, float entranceEnergy, Point entrancePoint, Point exitPoint,
52  Momentum entranceMomentum, int trackID, int parentTrackID, float time)
53  : _particlePdg(particlePDG), _eDep(eDep), _entranceEnergy(entranceEnergy),
54  _entrancePoint(std::move(entrancePoint)), _exitPoint(std::move(exitPoint)),
55  _entranceMomentum(std::move(entranceMomentum)), _trackID{trackID}, _parentTrackID{parentTrackID}, _time{time} {}
56 
58  virtual ~ParticleHit() = default;
59 
64  float EDep() const { return _eDep; }
69  void SetEDep(float eDep) { _eDep = eDep; }
70 
75  const Point &EntrancePoint() const { return _entrancePoint; }
80  void SetEntrancePoint(Point entrancePoint) { _entrancePoint = std::move(entrancePoint); }
81 
86  const Point &ExitPoint() const { return _exitPoint; }
91  void SetExitPoint(Point exitPoint) { _exitPoint = std::move(exitPoint); }
92 
97  const Momentum &EntranceMomentum() const { return _entranceMomentum; }
102  void SetEntranceMomentum(Momentum entranceMomentum) { _entranceMomentum = std::move(entranceMomentum); }
103 
108  float EntranceEnergy() const { return _entranceEnergy; }
113  void SetEntranceEnergy(float entranceEnergy) { _entranceEnergy = entranceEnergy; }
114 
119  int ParticlePDG() const { return _particlePdg; }
124  void SetParticlePDG(int particlePdg) { _particlePdg = particlePdg; }
125 
130  int TrackID() const { return _trackID; }
131 
136  void SetTrackID(int trackID) { _trackID = trackID; }
137 
144  int ParentTrackID() const { return _parentTrackID; }
145 
152  void SetParentTrackID(int parentTrackID) { _parentTrackID = parentTrackID; }
153 
158  float Time() const { return _time; }
159 
164  void SetTime(float time) { _time = time; }
165 
171  bool operator==(const ParticleHit &rhs) const {
172  return _entrancePoint == rhs._entrancePoint && _exitPoint == rhs._exitPoint &&
174  _particlePdg == rhs._particlePdg && _time == rhs._time;
175  }
176 
177 private:
179  float _eDep;
184  int _trackID;
186  float _time;
187 
188 #ifdef HS_USE_ROOT
189  ClassDef(ParticleHit, 1)
190 #endif
191 };
192 
193 } // namespace Herd
194 
195 #endif /* HERD_PARTICLEHIT_H_ */
bool operator==(const ParticleHit &rhs) const
Comparison operator.
Definition: ParticleHit.h:171
void SetEntrancePoint(Point entrancePoint)
Set the entrance point in the hit volume.
Definition: ParticleHit.h:80
int ParentTrackID() const
Get the ID of the parent particle track.
Definition: ParticleHit.h:144
void SetParentTrackID(int parentTrackID)
Set the track ID of the parent particle.
Definition: ParticleHit.h:152
const Point & ExitPoint() const
Get the exit point from the hit volume.
Definition: ParticleHit.h:86
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
void SetTrackID(int trackID)
Set the track ID of the particle.
Definition: ParticleHit.h:136
int _parentTrackID
The track ID of the particle.
Definition: ParticleHit.h:185
#define DEFAULT_INIT(x)
Definition: DefaultValues.h:23
int _particlePdg
Particle PDG ID.
Definition: ParticleHit.h:178
float _eDep
Deposited energy.
Definition: ParticleHit.h:179
float EntranceEnergy() const
Get the particle energy at the entrance in the hit volume.
Definition: ParticleHit.h:108
Momentum _entranceMomentum
Entrance momentum.
Definition: ParticleHit.h:183
float Time() const
Get the particle track arrival time in ns.
Definition: ParticleHit.h:158
ParticleHit(int particlePDG, float eDep, float entranceEnergy, Point entrancePoint, Point exitPoint, Momentum entranceMomentum, int trackID, int parentTrackID, float time)
Constructor.
Definition: ParticleHit.h:51
virtual ~ParticleHit()=default
Virtual destructor.
A class describing a vector in 3D space.
Definition: Vec3D.h:33
void SetParticlePDG(int particlePdg)
Set the PDG code of the particle.
Definition: ParticleHit.h:124
void SetEntranceMomentum(Momentum entranceMomentum)
Set the momentum at the entrance in the hit volume.
Definition: ParticleHit.h:102
ParticleHit()
Constructor.
Definition: ParticleHit.h:36
void SetEDep(float eDep)
Set the energy deposit of the hit.
Definition: ParticleHit.h:69
Class to describe the energy deposit of a single particle.
Definition: ParticleHit.h:33
int _trackID
The track ID of the particle.
Definition: ParticleHit.h:184
Point _exitPoint
Exit point.
Definition: ParticleHit.h:182
float _entranceEnergy
Entrance kinetic energy.
Definition: ParticleHit.h:180
Point _entrancePoint
Entrance point.
Definition: ParticleHit.h:181
const Momentum & EntranceMomentum() const
Get the momentum at the entrance in the hit volume.
Definition: ParticleHit.h:97
void SetExitPoint(Point exitPoint)
Set the exit point from the hit volume.
Definition: ParticleHit.h:91
float EDep() const
Get the deposited energy.
Definition: ParticleHit.h:64
int ParticlePDG() const
Get the PDG code of the particle.
Definition: ParticleHit.h:119
int TrackID() const
Get the ID of the particle track.
Definition: ParticleHit.h:130
float _time
The particle time of arrival.
Definition: ParticleHit.h:186
const Point & EntrancePoint() const
Get the entrance point in the hit volume.
Definition: ParticleHit.h:75
void SetTime(float time)
Set the particle track arrival time (in ns).
Definition: ParticleHit.h:164
void SetEntranceEnergy(float entranceEnergy)
Set the particle energy at the entrance in the hit volume.
Definition: ParticleHit.h:113