ATLAS Offline Software
SiHit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SiHit.h
7 // Header file for class SiHit
9 // Class for the Pixel and SCT hits
11 
12 #ifndef INDETSIMEVENT_SIHIT_H
13 #define INDETSIMEVENT_SIHIT_H
14 
15 // Data members classes
16 #include "CLHEP/Geometry/Point3D.h"
18 
19 class SiHit final {
20 
22  // Public methods:
24 public:
25 
26  // Constructor with parameters:
27  // local start position of the energy deposit
28  // local end position of the energy deposit
29  // deposited energy
30  // time of energy deposition
31  // number of track which released this energy
32  //
33  SiHit(const HepGeom::Point3D<double> &localStartPosition,
34  const HepGeom::Point3D<double> &localEndPosition,
35  const double energyLoss,
36  const double meanTime,
37  const int truthBarcode,
38  const unsigned int id);
39 
40  SiHit(const HepGeom::Point3D<double> &localStartPosition,
41  const HepGeom::Point3D<double> &localEndPosition,
42  const double energyLoss,
43  const double meanTime,
44  const int truthBarcode,
45  const int, const int, const int, const int, const int, const int);
46  // Constructor with parameters:
47  // local start position of the energy deposit
48  // local end position of the energy deposit
49  // deposited energy
50  // time of energy deposition
51  // link to particle which released this energy
52  //
53  SiHit(const HepGeom::Point3D<double> &localStartPosition,
54  const HepGeom::Point3D<double> &localEndPosition,
55  const double energyLoss,
56  const double meanTime,
57  const HepMcParticleLink &track,
58  const unsigned int id);
59 
60  SiHit(const HepGeom::Point3D<double> &localStartPosition,
61  const HepGeom::Point3D<double> &localEndPosition,
62  const double energyLoss,
63  const double meanTime,
64  const HepMcParticleLink &track,
65  const int, const int, const int, const int, const int, const int);
66  // needed by athenaRoot
67  SiHit();
68 
69  // Destructor:
70  ~SiHit() = default;
71 
72  //move assignment defaulted
73  SiHit & operator = (SiHit &&) noexcept = default;
74  //assignment defaulted
75  SiHit & operator = (const SiHit &) = default;
76  //copy c'tor defaulted
78  //move c'tor defaulted
79  SiHit(SiHit &&) noexcept = default;
80 
81 
83  // Const methods:
85 
86  unsigned int identify() const;
87 
88  // local start position of the energy deposit:
89  HepGeom::Point3D<double> localStartPosition() const;
90 
91  HepGeom::Point3D<double> localEndPosition() const;
92 
93  // deposited energy:
94  double energyLoss() const;
95 
96  // time of energy deposition: FIXME name!
97  double meanTime() const;
98 
99  // Set the time of energy deposition: FIXME name!
100  void setMeanTime(float meanTime);
101 
102  // truth barcode of the track which released this energy:
103  int truthBarcode() const;
104 
105  // GenParticle::id of the track which released this energy:
106  int truthID() const;
107 
108  // link to the particle generating the hit
110 
111  // Pixel, SCT, or HGTD
112  bool isPixel() const;
113  bool isSCT() const;
114  bool isHGTD() const;
115  bool isPLR() const;
116 
117  // Barrel or Endcap
118  int getBarrelEndcap() const;
119 
120  // Layer/Disk
121  int getLayerDisk() const;
122 
123  // eta module
124  int getEtaModule() const;
125 
126  // phi module
127  int getPhiModule() const;
128 
129  // side
130  int getSide() const;
131 
132  // some print-out:
133  void print() const;
134 
135  bool operator < (const SiHit& rhs) const
136  {return m_ID < rhs.m_ID;}
137 
139  // Non-const methods:
141  // Scale the length, used to go from cm to mm, of whatever we like.
142  void ScaleLength(double);
143 
145  // copy c'tor made public on 23-5-2008 to allow copy of athenahitsvector<sihit>
147 
148 
150  // Private data:
152 private:
153 
154  float m_stX, m_stY, m_stZ;
155  float m_enX, m_enY, m_enZ;
156  float m_energyLoss; // deposited energy
157  float m_meanTime; // time of energy deposition
159  unsigned int m_ID;
160 public:
161  enum
162  { xDep = 0, xPhi = 1, xEta = 2};
163 };
164 
165 
167 // Inline methods:
169 
170 inline unsigned int SiHit::identify() const
171 {
172  return m_ID;
173 }
174 
175 inline double SiHit::energyLoss() const
176 {
177  return (double) m_energyLoss;
178 }
179 
180 inline double SiHit::meanTime() const
181 {
182  return (double) m_meanTime;
183 }
184 
185 inline void SiHit::setMeanTime(float meanTime)
186 {
188 }
189 
191 {
192  return m_partLink;
193 }
194 
195 
196 
198 // open functions:
200 
201 inline float hitTime(const SiHit& hit)
202 {
203  return (float) hit.meanTime();
204 }
205 
206 #endif // INDETSIMEVENT_SIHIT_H
SiHit::m_enZ
float m_enZ
Definition: SiHit.h:155
SiHit::localEndPosition
HepGeom::Point3D< double > localEndPosition() const
Definition: SiHit.cxx:153
SiHit::m_ID
unsigned int m_ID
Definition: SiHit.h:159
SiHit::setMeanTime
void setMeanTime(float meanTime)
Definition: SiHit.h:185
SiHit::m_enX
float m_enX
Definition: SiHit.h:155
SiHit::getLayerDisk
int getLayerDisk() const
Definition: SiHit.cxx:164
SiHit::getPhiModule
int getPhiModule() const
Definition: SiHit.cxx:172
SiHit::m_energyLoss
float m_energyLoss
Definition: SiHit.h:156
SiHit::m_meanTime
float m_meanTime
Definition: SiHit.h:157
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SiHit::isPLR
bool isPLR() const
Definition: SiHit.cxx:142
SiHit
Definition: SiHit.h:19
SiHit::meanTime
double meanTime() const
Definition: SiHit.h:180
hitTime
float hitTime(const SiHit &hit)
Definition: SiHit.h:201
SiHit::xDep
@ xDep
Definition: SiHit.h:162
SiHit::getEtaModule
int getEtaModule() const
Definition: SiHit.cxx:168
SiHit::m_stZ
float m_stZ
Definition: SiHit.h:154
SiHit::operator=
SiHit & operator=(SiHit &&) noexcept=default
SiHit::truthBarcode
int truthBarcode() const
Definition: SiHit.cxx:202
SiHit::~SiHit
~SiHit()=default
SiHit::particleLink
const HepMcParticleLink & particleLink() const
Definition: SiHit.h:190
SiHit::getBarrelEndcap
int getBarrelEndcap() const
Definition: SiHit.cxx:160
SiHit::energyLoss
double energyLoss() const
Definition: SiHit.h:175
SiHit::ScaleLength
void ScaleLength(double)
Definition: SiHit.cxx:119
SiHit::m_partLink
HepMcParticleLink m_partLink
Definition: SiHit.h:158
SiHit::getSide
int getSide() const
Definition: SiHit.cxx:176
SiHit::truthID
int truthID() const
Definition: SiHit.cxx:208
SiHit::identify
unsigned int identify() const
Definition: SiHit.h:170
HepGeom
Definition: VP1String.h:30
SiHit::SiHit
SiHit()
Definition: SiHit.cxx:10
SiHit::xEta
@ xEta
Definition: SiHit.h:162
SiHit::m_stY
float m_stY
Definition: SiHit.h:154
SiHit::isHGTD
bool isHGTD() const
Definition: SiHit.cxx:138
SiHit::isPixel
bool isPixel() const
Definition: SiHit.cxx:130
SiHit::xPhi
@ xPhi
Definition: SiHit.h:162
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
SiHit::m_enY
float m_enY
Definition: SiHit.h:155
SiHit::print
void print() const
Definition: SiHit.cxx:180
SiHit::m_stX
float m_stX
Definition: SiHit.h:154
SiHit::localStartPosition
HepGeom::Point3D< double > localStartPosition() const
Definition: SiHit.cxx:146
SiHit::isSCT
bool isSCT() const
Definition: SiHit.cxx:134