ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSpectrometer
MuonSimEvent
src
MDTSimHit.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 "
MuonSimEvent/MDTSimHit.h
"
6
7
8
#include <sstream>
9
// construction/destruction
10
11
MDTSimHit::MDTSimHit
() :
12
m_MDTid
(0xffff),
13
m_globalTime
(0.),
14
m_driftRadius
(0.),
15
m_partLink
(),
16
m_stepLength
(0.),
17
m_energyDeposit
(0.),
18
m_particleEncoding
(0),
19
m_kineticEnergy
(0.)
20
21
{
22
}
23
24
//default destructor required by Pool
25
MDTSimHit::~MDTSimHit
() =
default
;
26
27
28
MDTSimHit::MDTSimHit
(
HitID
id
,
29
double
time,
30
double
radius,
31
const
Amg::Vector3D
& position)
32
:
m_MDTid
(id),
m_globalTime
(time)
33
,
m_driftRadius
(radius)
34
,
m_localPosition
(position)
35
{
36
m_stepLength
= -9999999.;
//total lenght of particle
37
m_energyDeposit
= -1.;
//Geant4 deposited energy
38
m_particleEncoding
= 0;
// PDG_ID
39
m_kineticEnergy
= -1.;
// energy of the particle
40
}
41
42
MDTSimHit::MDTSimHit
(
HitID
id
,
43
double
time,
44
double
radius,
45
const
Amg::Vector3D
& position,
46
const
int
truthBarcode
)
47
:
m_MDTid
(id),
m_globalTime
(time)
48
,
m_driftRadius
(radius)
49
,
m_localPosition
(position)
50
,
m_partLink
(
truthBarcode
, 0,
HepMcParticleLink
::IS_POSITION,
HepMcParticleLink
::IS_BARCODE)
// FIXME barcode-based
51
{
52
m_stepLength
= -9999999.;
//total lenght of particle
53
m_energyDeposit
= -1.;
//Geant4 deposited energy
54
m_particleEncoding
= 0;
// PDG_ID
55
m_kineticEnergy
= -1.;
// energy of the particle
56
}
57
58
MDTSimHit::MDTSimHit
(
HitID
id
,
59
double
time,
60
double
radius,
61
const
Amg::Vector3D
& position,
62
const
int
truthBarcode
,
63
const
double
stepLength
,
64
const
double
energyDeposit
,
65
const
int
particleEncoding
,
66
const
double
kineticEnergy
)
67
:
m_MDTid
(id),
m_globalTime
(time)
68
,
m_driftRadius
(radius)
69
,
m_localPosition
(position)
70
,
m_partLink
(
truthBarcode
, 0,
HepMcParticleLink
::IS_POSITION,
HepMcParticleLink
::IS_BARCODE)
// FIXME barcode-based
71
,
m_stepLength
(static_cast<float>(
stepLength
))
72
,
m_energyDeposit
(static_cast<float>(
energyDeposit
))
73
,
m_particleEncoding
(
particleEncoding
)
74
,
m_kineticEnergy
(static_cast<float>(
kineticEnergy
))
75
{
76
}
77
78
MDTSimHit::MDTSimHit
(
HitID
id
,
79
double
time,
80
double
radius,
81
const
Amg::Vector3D
& position,
82
const
HepMcParticleLink
& hmpl,
83
const
double
stepLength
,
84
const
double
energyDeposit
,
85
const
int
particleEncoding
,
86
const
double
kineticEnergy
)
87
:
m_MDTid
(id),
m_globalTime
(time)
88
,
m_driftRadius
(radius)
89
,
m_localPosition
(position)
90
,
m_partLink
(hmpl)
91
,
m_stepLength
(static_cast<float>(
stepLength
))
92
,
m_energyDeposit
(static_cast<float>(
energyDeposit
))
93
,
m_particleEncoding
(
particleEncoding
)
94
,
m_kineticEnergy
(static_cast<float>(
kineticEnergy
))
95
{
96
}
97
98
99
// Implementation of member functions
100
std::string
MDTSimHit::print
()
const
{
101
102
std::stringstream
ss
;
103
104
ss
<<
"MDTSimHit:"
;
105
ss
<<
" identifier: "
<<
m_MDTid
;
106
ss
<<
" t: "
<<
m_globalTime
;
107
ss
<<
" r: "
<<
m_driftRadius
;
108
ss
<<
" x: ("
<<
m_localPosition
.x()
109
<<
","
<<
m_localPosition
.y()
110
<<
","
<<
m_localPosition
.z()
111
<<
")"
;
112
ss
<<
" EnergyDeposit: "
<<
m_energyDeposit
<<
" pdgId: "
<<
m_particleEncoding
<<
" kineticEnergy: "
<<
m_kineticEnergy
;
113
ss
<<
" StepLength: "
<<
m_stepLength
;
114
115
return
ss
.str();
116
}
117
118
int
MDTSimHit::truthBarcode
()
const
119
{
return
m_partLink
.barcode(); }
120
121
int
MDTSimHit::truthID
()
const
122
{
return
m_partLink
.id(); }
HitID
int HitID
Definition
GenericMuonSimHit.h:13
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
MDTSimHit.h
HepMcParticleLink
a link optimized in size for a GenParticle in a McEventCollection
Definition
HepMcParticleLink.h:72
MDTSimHit::m_particleEncoding
int m_particleEncoding
Definition
MDTSimHit.h:90
MDTSimHit::truthID
int truthID() const
Definition
MDTSimHit.cxx:121
MDTSimHit::stepLength
double stepLength() const
Definition
MDTSimHit.h:57
MDTSimHit::m_MDTid
HitID m_MDTid
Definition
MDTSimHit.h:82
MDTSimHit::kineticEnergy
double kineticEnergy() const
Definition
MDTSimHit.h:60
MDTSimHit::m_stepLength
float m_stepLength
Definition
MDTSimHit.h:88
MDTSimHit::truthBarcode
int truthBarcode() const
Definition
MDTSimHit.cxx:118
MDTSimHit::MDTSimHit
MDTSimHit()
Definition
MDTSimHit.cxx:11
MDTSimHit::m_driftRadius
float m_driftRadius
Definition
MDTSimHit.h:84
MDTSimHit::particleEncoding
int particleEncoding() const
Definition
MDTSimHit.h:59
MDTSimHit::m_energyDeposit
float m_energyDeposit
Definition
MDTSimHit.h:89
MDTSimHit::m_partLink
HepMcParticleLink m_partLink
Definition
MDTSimHit.h:86
MDTSimHit::m_kineticEnergy
float m_kineticEnergy
Definition
MDTSimHit.h:91
MDTSimHit::energyDeposit
double energyDeposit() const
Definition
MDTSimHit.h:58
MDTSimHit::~MDTSimHit
~MDTSimHit()
MDTSimHit::print
std::string print() const
Definition
MDTSimHit.cxx:100
MDTSimHit::m_globalTime
float m_globalTime
Definition
MDTSimHit.h:83
MDTSimHit::m_localPosition
Amg::Vector3D m_localPosition
Definition
MDTSimHit.h:85
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Generated on
for ATLAS Offline Software by
1.14.0