HerdSoftware  0.4.0
Hit.h
Go to the documentation of this file.
1 /*
2  * Hit.h
3  *
4  * Created on: 8 Nov 2018
5  * Author: Nicola Mori
6  */
7 
10 #ifndef HERD_HIT_H_
11 #define HERD_HIT_H_
12 
14 
15 #ifdef HS_USE_ROOT
16 #include "Rtypes.h"
17 #endif
18 
19 #include <array>
20 #include <limits>
21 
22 namespace Herd {
23 
30 class Hit {
31 
32 public:
35 
36  Hit(float eDep, unsigned int volumeID) : _eDep{eDep}, _volumeId{volumeID} {}
37 
39  virtual ~Hit() = default;
40 
45  [[nodiscard]] float EDep() const { return _eDep; }
46 
51  void SetEDep(float eDep) { _eDep = eDep; }
52 
57  [[nodiscard]] unsigned int VolumeID() const { return _volumeId; }
58 
63  void SetVolumeID(unsigned int volumeID) { _volumeId = volumeID; }
64 
65 private:
66  float _eDep;
67  unsigned int _volumeId;
68 
69 #ifdef HS_USE_ROOT
70  ClassDef(Hit, 1)
71 #endif
72 };
73 
74 inline bool operator==(const Hit &h1, const Hit &h2) {
75  return ((h1.VolumeID() == h2.VolumeID()) && (h1.EDep() == h2.EDep()));
76 }
77 
78 inline std::ostream &operator<<(std::ostream &out, const Hit &hit) {
79  return out << "{eDep=" << hit.EDep() << ",volID=" << hit.VolumeID() << "}";
80 }
81 
82 } // namespace Herd
83 
84 #endif /* HERD_HIT_H_ */
Herd::Hit::Hit
Hit(float eDep, unsigned int volumeID)
Definition: Hit.h:36
Herd::operator==
bool operator==(const HoughTrackStub &lhs, const HoughTrackStub &rhs)
Definition: HoughTrackStub.h:41
DEFAULT_INIT
#define DEFAULT_INIT(x)
Definition: DefaultValues.h:23
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::Hit::_volumeId
unsigned int _volumeId
Id of the hit volume.
Definition: Hit.h:67
Herd::operator<<
std::ostream & operator<<(std::ostream &os, const Vec3D &vec)
Write coordinates to stream.
Definition: Vec3D.h:345
Herd::Hit::_eDep
float _eDep
Deposited energy [GeV].
Definition: Hit.h:66
Herd::Hit
Hit object for transient data model.
Definition: Hit.h:30
Herd::Hit::SetVolumeID
void SetVolumeID(unsigned int volumeID)
Set the ID of the hit volume.
Definition: Hit.h:63
Herd::Hit::~Hit
virtual ~Hit()=default
Virtual destructor
DefaultValues.h
Herd::Hit::SetEDep
void SetEDep(float eDep)
Set the energy deposit of the hit.
Definition: Hit.h:51
Herd::Hit::VolumeID
unsigned int VolumeID() const
Get the unique identifier of the sensitive element.
Definition: Hit.h:57
Herd::Hit::Hit
Hit()
Constructor.
Definition: Hit.h:34
Herd::Hit::EDep
float EDep() const
Get the deposited energy.
Definition: Hit.h:45