ATLAS Offline Software
Loading...
Searching...
No Matches
InnerDetector
InDetSimEvent
src
SiHit.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
InDetSimEvent/SiHit.h
"
6
#include "
InDetSimEvent/SiHitIdHelper.h
"
7
8
// Default consdtructor needed by athenaroot
9
//
10
SiHit::SiHit
( ) :
11
m_stX
(0.),
12
m_stY
(0.),
13
m_stZ
(0.),
14
m_enX
(0.),
15
m_enY
(0.),
16
m_enZ
(0.),
17
m_energyLoss
(0.),
18
m_meanTime
(0.),
19
m_partLink
(),
20
m_ID
(0xffff)
21
{
22
23
}
24
25
// Constructor
26
SiHit::SiHit
(
const
HepGeom::Point3D<double> &
localStartPosition
,
27
const
HepGeom::Point3D<double> &
localEndPosition
,
28
const
double
energyLoss
,
29
const
double
meanTime
,
30
const
int
truthBarcode
,
31
const
unsigned
int
id
) :
32
// m_localStartPosition(localStartPosition),
33
// m_localEndPosition(localEndPosition),
34
m_stX
( (float)
localStartPosition
.
x
() ),
35
m_stY
( (float)
localStartPosition
.
y
() ),
36
m_stZ
( (float)
localStartPosition
.
z
() ),
37
m_enX
( (float)
localEndPosition
.
x
() ),
38
m_enY
( (float)
localEndPosition
.
y
() ),
39
m_enZ
( (float)
localEndPosition
.
z
() ),
40
m_energyLoss
(
energyLoss
),
41
m_meanTime
(
meanTime
),
42
m_partLink
(
truthBarcode
,0,
HepMcParticleLink
::IS_POSITION,
HepMcParticleLink
::IS_BARCODE),
//FIXME barcode-based
43
m_ID
(id)
44
{
45
}
46
47
// Constructor
48
SiHit::SiHit
(
const
HepGeom::Point3D<double> &
localStartPosition
,
49
const
HepGeom::Point3D<double> &
localEndPosition
,
50
const
double
energyLoss
,
51
const
double
meanTime
,
52
const
int
truthBarcode
,
53
const
int
Part,
const
int
BrlECap,
const
int
LayerDisk
,
54
const
int
etaM,
const
int
phiM,
const
int
side) :
55
// m_localStartPosition(localStartPosition),
56
// m_localEndPosition(localEndPosition),
57
m_stX
( (float)
localStartPosition
.
x
() ),
58
m_stY
( (float)
localStartPosition
.
y
() ),
59
m_stZ
( (float)
localStartPosition
.
z
() ),
60
m_enX
( (float)
localEndPosition
.
x
() ),
61
m_enY
( (float)
localEndPosition
.
y
() ),
62
m_enZ
( (float)
localEndPosition
.
z
() ),
63
m_energyLoss
(
energyLoss
),
64
m_meanTime
(
meanTime
),
65
m_partLink
(
truthBarcode
,0,
HepMcParticleLink
::IS_POSITION,
HepMcParticleLink
::IS_BARCODE),
//FIXME barcode-based
66
m_ID
(0)
67
{
68
// Compress the location info into the integer:
69
m_ID
=
SiHitIdHelper::GetHelper
()->
buildHitId
(Part,BrlECap,
LayerDisk
,etaM,phiM,side);
70
}
71
72
// Constructor
73
SiHit::SiHit
(
const
HepGeom::Point3D<double> &
localStartPosition
,
74
const
HepGeom::Point3D<double> &
localEndPosition
,
75
const
double
energyLoss
,
76
const
double
meanTime
,
77
const
HepMcParticleLink
&track,
78
const
unsigned
int
id
) :
79
// m_localStartPosition(localStartPosition),
80
// m_localEndPosition(localEndPosition),
81
m_stX
( (float)
localStartPosition
.
x
() ),
82
m_stY
( (float)
localStartPosition
.
y
() ),
83
m_stZ
( (float)
localStartPosition
.
z
() ),
84
m_enX
( (float)
localEndPosition
.
x
() ),
85
m_enY
( (float)
localEndPosition
.
y
() ),
86
m_enZ
( (float)
localEndPosition
.
z
() ),
87
m_energyLoss
(
energyLoss
),
88
m_meanTime
(
meanTime
),
89
m_partLink
(track),
90
m_ID
(id)
91
{
92
}
93
94
// Constructor
95
SiHit::SiHit
(
const
HepGeom::Point3D<double> &
localStartPosition
,
96
const
HepGeom::Point3D<double> &
localEndPosition
,
97
const
double
energyLoss
,
98
const
double
meanTime
,
99
const
HepMcParticleLink
&track,
100
const
int
Part,
const
int
BrlECap,
const
int
LayerDisk
,
101
const
int
etaM,
const
int
phiM,
const
int
side) :
102
// m_localStartPosition(localStartPosition),
103
// m_localEndPosition(localEndPosition),
104
m_stX
( (float)
localStartPosition
.
x
() ),
105
m_stY
( (float)
localStartPosition
.
y
() ),
106
m_stZ
( (float)
localStartPosition
.
z
() ),
107
m_enX
( (float)
localEndPosition
.
x
() ),
108
m_enY
( (float)
localEndPosition
.
y
() ),
109
m_enZ
( (float)
localEndPosition
.
z
() ),
110
m_energyLoss
(
energyLoss
),
111
m_meanTime
(
meanTime
),
112
m_partLink
(track),
113
m_ID
(0)
114
{
115
// Compress the location info into the integer:
116
m_ID
=
SiHitIdHelper::GetHelper
()->
buildHitId
(Part,BrlECap,
LayerDisk
,etaM,phiM,side);
117
}
118
119
void
SiHit::ScaleLength
(
double
sfactor) {
120
// m_localStartPosition *= sfactor;
121
// m_localEndPosition *= sfactor;
122
m_stX
*= (float) sfactor;
123
m_stY
*= (float) sfactor;
124
m_stZ
*= (float) sfactor;
125
m_enX
*= (float) sfactor;
126
m_enY
*= (float) sfactor;
127
m_enZ
*= (float) sfactor;
128
}
129
130
bool
SiHit::isPixel
()
const
{
131
return
SiHitIdHelper::GetHelper
()->
isPixel
(
m_ID
);
132
}
133
134
bool
SiHit::isSCT
()
const
{
135
return
SiHitIdHelper::GetHelper
()->
isSCT
(
m_ID
);
136
}
137
138
bool
SiHit::isHGTD
()
const
{
139
return
SiHitIdHelper::GetHelper
()->
isHGTD
(
m_ID
);
140
}
141
142
bool
SiHit::isPLR
()
const
{
143
return
SiHitIdHelper::GetHelper
()->
isPLR
(
m_ID
);
144
}
145
146
HepGeom::Point3D<double>
SiHit::localStartPosition
()
const
147
{
148
return
{
static_cast<
double
>
(
m_stX
),
149
static_cast<
double
>
(
m_stY
),
150
static_cast<
double
>
(
m_stZ
) };
151
}
152
153
HepGeom::Point3D<double>
SiHit::localEndPosition
()
const
154
{
155
return
{
static_cast<
double
>
(
m_enX
),
156
static_cast<
double
>
(
m_enY
),
157
static_cast<
double
>
(
m_enZ
) };
158
}
159
160
int
SiHit::getBarrelEndcap
()
const
{
161
return
SiHitIdHelper::GetHelper
()->
getBarrelEndcap
(
m_ID
);
162
}
163
164
int
SiHit::getLayerDisk
()
const
{
165
return
SiHitIdHelper::GetHelper
()->
getLayerDisk
(
m_ID
);
166
}
167
168
int
SiHit::getEtaModule
()
const
{
169
return
SiHitIdHelper::GetHelper
()->
getEtaModule
(
m_ID
);
170
}
171
172
int
SiHit::getPhiModule
()
const
{
173
return
SiHitIdHelper::GetHelper
()->
getPhiModule
(
m_ID
);
174
}
175
176
int
SiHit::getSide
()
const
{
177
return
SiHitIdHelper::GetHelper
()->
getSide
(
m_ID
);
178
}
179
180
void
SiHit::print
()
const
{
181
if
(
isPixel
()) {
182
if
(
isPLR
()) {
183
std::cout <<
"*** PLR Hit "
<< std::endl;
184
}
else
{
185
std::cout <<
"*** Pixel Hit "
<< std::endl;
186
}
187
}
else
if
(
isSCT
()) {
188
std::cout <<
"*** SCT Hit "
<< std::endl;
189
}
190
else
{
191
std::cout <<
"*** HGTD Hit "
<< std::endl;
192
}
193
std::cout <<
" Barrel/ EndCap Number "
<<
getBarrelEndcap
() << std::endl;
194
std::cout <<
" Layer/Disk Number "
<<
getLayerDisk
() << std::endl;
195
std::cout <<
" Eta Number "
<<
getEtaModule
() << std::endl;
196
std::cout <<
" Phi Number "
<<
getPhiModule
() << std::endl;
197
std::cout <<
" Side Number "
<<
getSide
() << std::endl;
198
}
199
200
201
202
int
SiHit::truthBarcode
()
const
203
{
204
return
m_partLink
.barcode();
205
}
206
207
208
int
SiHit::truthID
()
const
209
{
210
return
m_partLink
.id();
211
}
212
SiHitIdHelper.h
SiHit.h
y
#define y
x
#define x
z
#define z
HepMcParticleLink
a link optimized in size for a GenParticle in a McEventCollection
Definition
HepMcParticleLink.h:72
LayerDisk
Definition
WaferTree.h:57
SiHitIdHelper::getBarrelEndcap
int getBarrelEndcap(const int &hid) const
Definition
SiHitIdHelper.cxx:86
SiHitIdHelper::buildHitId
int buildHitId(const int, const int, const int, const int, const int, const int) const
Definition
SiHitIdHelper.cxx:118
SiHitIdHelper::isPixel
bool isPixel(const int &hid) const
Definition
SiHitIdHelper.cxx:58
SiHitIdHelper::getEtaModule
int getEtaModule(const int &hid) const
Definition
SiHitIdHelper.cxx:98
SiHitIdHelper::isPLR
bool isPLR(const int &hid) const
Definition
SiHitIdHelper.cxx:76
SiHitIdHelper::getLayerDisk
int getLayerDisk(const int &hid) const
Definition
SiHitIdHelper.cxx:92
SiHitIdHelper::getPhiModule
int getPhiModule(const int &hid) const
Definition
SiHitIdHelper.cxx:104
SiHitIdHelper::isHGTD
bool isHGTD(const int &hid) const
Definition
SiHitIdHelper.cxx:70
SiHitIdHelper::isSCT
bool isSCT(const int &hid) const
Definition
SiHitIdHelper.cxx:64
SiHitIdHelper::getSide
int getSide(const int &hid) const
Definition
SiHitIdHelper.cxx:110
SiHitIdHelper::GetHelper
static const SiHitIdHelper * GetHelper()
Definition
SiHitIdHelper.cxx:19
SiHit::m_enZ
float m_enZ
Definition
SiHit.h:155
SiHit::m_meanTime
float m_meanTime
Definition
SiHit.h:157
SiHit::m_enY
float m_enY
Definition
SiHit.h:155
SiHit::print
void print() const
Definition
SiHit.cxx:180
SiHit::energyLoss
double energyLoss() const
Definition
SiHit.h:175
SiHit::SiHit
SiHit()
Definition
SiHit.cxx:10
SiHit::truthID
int truthID() const
Definition
SiHit.cxx:208
SiHit::m_partLink
HepMcParticleLink m_partLink
Definition
SiHit.h:158
SiHit::ScaleLength
void ScaleLength(double)
Definition
SiHit.cxx:119
SiHit::m_energyLoss
float m_energyLoss
Definition
SiHit.h:156
SiHit::m_stY
float m_stY
Definition
SiHit.h:154
SiHit::localStartPosition
HepGeom::Point3D< double > localStartPosition() const
Definition
SiHit.cxx:146
SiHit::isPixel
bool isPixel() const
Definition
SiHit.cxx:130
SiHit::getPhiModule
int getPhiModule() const
Definition
SiHit.cxx:172
SiHit::meanTime
double meanTime() const
Definition
SiHit.h:180
SiHit::truthBarcode
int truthBarcode() const
Definition
SiHit.cxx:202
SiHit::isHGTD
bool isHGTD() const
Definition
SiHit.cxx:138
SiHit::getBarrelEndcap
int getBarrelEndcap() const
Definition
SiHit.cxx:160
SiHit::m_stX
float m_stX
Definition
SiHit.h:154
SiHit::getSide
int getSide() const
Definition
SiHit.cxx:176
SiHit::m_enX
float m_enX
Definition
SiHit.h:155
SiHit::getEtaModule
int getEtaModule() const
Definition
SiHit.cxx:168
SiHit::isSCT
bool isSCT() const
Definition
SiHit.cxx:134
SiHit::m_stZ
float m_stZ
Definition
SiHit.h:154
SiHit::isPLR
bool isPLR() const
Definition
SiHit.cxx:142
SiHit::m_ID
unsigned int m_ID
Definition
SiHit.h:159
SiHit::getLayerDisk
int getLayerDisk() const
Definition
SiHit.cxx:164
SiHit::localEndPosition
HepGeom::Point3D< double > localEndPosition() const
Definition
SiHit.cxx:153
Generated on
for ATLAS Offline Software by
1.14.0