ATLAS Offline Software
MuonSpectrometer
MuonSimEvent
src
CSCSimHit.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/CSCSimHit.h
"
6
7
8
#include <cmath>
9
#include <sstream>
10
11
// construction/destruction
12
//
13
CSCSimHit::CSCSimHit
( ) :
14
m_CSCid(0xffff),
15
m_globalTime(0.),
16
m_energyDeposit(0),
17
m_particleID(0),
18
m_partLink(),
19
m_kineticEnergy(-1.)
20
{
21
}
22
//defualt destructor required by Pool
23
CSCSimHit::~CSCSimHit
( )=
default
;
24
25
26
CSCSimHit::CSCSimHit
(
int
id
,
27
double
time
,
28
double
energy
,
29
const
Amg::Vector3D
& HitStart,
30
const
Amg::Vector3D
& HitEnd,
31
int
particleID)
32
: m_CSCid(
id
), m_globalTime(
time
)
33
, m_energyDeposit(
energy
)
34
, m_hitStart(HitStart)
35
, m_hitEnd(HitEnd)
36
, m_particleID(particleID)
37
, m_kineticEnergy(-1.)
38
{
39
40
}
41
42
CSCSimHit::CSCSimHit
(
int
id
,
43
double
time
,
44
double
energy
,
45
const
Amg::Vector3D
& HitStart,
46
const
Amg::Vector3D
& HitEnd,
47
int
particleID,
48
const
int
truthBarcode)
49
: m_CSCid(
id
), m_globalTime(
time
)
50
, m_energyDeposit(
energy
)
51
, m_hitStart(HitStart)
52
, m_hitEnd(HitEnd)
53
, m_particleID(particleID)
54
, m_partLink(truthBarcode, 0,
HepMcParticleLink
::IS_POSITION,
HepMcParticleLink
::IS_BARCODE)
// FIXME barcode-based
55
, m_kineticEnergy(-1.)
56
{
57
58
}
59
60
CSCSimHit::CSCSimHit
(
int
id
,
61
double
time
,
62
double
energy
,
63
const
Amg::Vector3D
& HitStart,
64
const
Amg::Vector3D
& HitEnd,
65
int
particleID,
66
const
int
truthBarcode,
67
const
double
kineticEnergy)
68
: m_CSCid(
id
), m_globalTime(
time
)
69
, m_energyDeposit(
energy
)
70
, m_hitStart(HitStart)
71
, m_hitEnd(HitEnd)
72
, m_particleID(particleID)
73
, m_partLink(truthBarcode, 0,
HepMcParticleLink
::IS_POSITION,
HepMcParticleLink
::IS_BARCODE)
// FIXME barcode-based
74
, m_kineticEnergy(static_cast<
float
>(kineticEnergy))
75
{
76
77
}
78
79
CSCSimHit::CSCSimHit
(
int
id
,
80
double
time
,
81
double
energy
,
82
const
Amg::Vector3D
& HitStart,
83
const
Amg::Vector3D
& HitEnd,
84
int
particleID,
85
const
HepMcParticleLink
& hmpl,
86
const
double
kineticEnergy)
87
: m_CSCid(
id
), m_globalTime(
time
)
88
, m_energyDeposit(
energy
)
89
, m_hitStart(HitStart)
90
, m_hitEnd(HitEnd)
91
, m_particleID(particleID)
92
, m_partLink(hmpl)
93
, m_kineticEnergy(static_cast<
float
>(kineticEnergy))
94
{
95
96
}
97
98
99
// Implementation of member functions
100
101
std::string
CSCSimHit::print
()
const
{
102
103
std::string
str
;
104
std::stringstream
ss
;
105
106
ss
<<
"CSCSimHit:"
;
107
ss
<<
" identifier: "
<<
m_CSCid
;
108
ss
<<
" t: "
<<
m_globalTime
;
109
ss
<<
" E: "
<<
m_energyDeposit
;
110
ss
<<
" kinE: "
<<
m_kineticEnergy
;
111
ss
<<
" Hit start position: ("
<<
m_hitStart
.x()
112
<<
","
<<
m_hitStart
.y()
113
<<
","
<<
m_hitStart
.z()
114
<<
")"
;
115
ss
<<
" Hit end position: ("
<<
m_hitEnd
.x()
116
<<
","
<<
m_hitEnd
.y()
117
<<
","
<<
m_hitEnd
.z()
118
<<
")"
;
119
120
float
distance
=
pow
(
m_hitEnd
.x()-
m_hitStart
.x() , 2);
121
distance
+=
pow
(
m_hitEnd
.y()-
m_hitStart
.y() , 2);
122
distance
+=
pow
(
m_hitEnd
.z()-
m_hitStart
.z() , 2);
123
distance
= std::sqrt(
distance
);
124
125
ss
<<
" Distance: "
<<
distance
;
126
ss
<<
" Particle ID: "
<<
m_particleID
;
127
ss
<<
" genTrackNumber: "
<<
m_partLink
.
barcode
();
128
129
str
=
ss
.str();
130
131
return
str
;
132
133
}
134
135
int
CSCSimHit::truthBarcode
()
const
136
{
return
m_partLink
.
barcode
(); }
137
138
int
CSCSimHit::truthID
()
const
139
{
return
m_partLink
.
id
(); }
PowhegControl_ttHplus_NLO.ss
ss
Definition:
PowhegControl_ttHplus_NLO.py:83
CSCSimHit::~CSCSimHit
~CSCSimHit()
CSCSimHit::m_energyDeposit
float m_energyDeposit
Definition:
CSCSimHit.h:78
CSCSimHit::m_hitEnd
Amg::Vector3D m_hitEnd
Definition:
CSCSimHit.h:80
CSCSimHit::m_partLink
HepMcParticleLink m_partLink
Definition:
CSCSimHit.h:82
HepMcParticleLink::barcode
int barcode() const
Return the barcode of the target particle.
Definition:
HepMcParticleLink.cxx:318
HepMcParticleLink::id
int id() const
Return the id of the target particle.
Definition:
HepMcParticleLink.cxx:291
CSCSimHit::truthBarcode
int truthBarcode() const
Definition:
CSCSimHit.cxx:135
HepMcParticleLink
a link optimized in size for a GenParticle in a McEventCollection
Definition:
HepMcParticleLink.h:72
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition:
ParticleGun_FastCalo_ChargeFlip_Config.py:78
CSCSimHit::m_particleID
int m_particleID
Definition:
CSCSimHit.h:81
CSCSimHit::m_globalTime
float m_globalTime
Definition:
CSCSimHit.h:77
CSCSimHit::m_kineticEnergy
float m_kineticEnergy
Definition:
CSCSimHit.h:83
CSCSimHit::CSCSimHit
CSCSimHit()
Definition:
CSCSimHit.cxx:13
CSCSimHit.h
CSCSimHit::m_CSCid
int m_CSCid
Definition:
CSCSimHit.h:76
id
SG::auxid_t id
Definition:
Control/AthContainers/Root/debug.cxx:227
CSCSimHit::m_hitStart
Amg::Vector3D m_hitStart
Definition:
CSCSimHit.h:79
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition:
GeoPrimitives.h:47
CSCSimHit::truthID
int truthID() const
Definition:
CSCSimHit.cxx:138
python.CaloScaleNoiseConfig.str
str
Definition:
CaloScaleNoiseConfig.py:78
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition:
CaloSwCorrections.py:242
CSCSimHit::print
std::string print() const
Definition:
CSCSimHit.cxx:101
str
Definition:
BTagTrackIpAccessor.cxx:11
pow
constexpr int pow(int base, int exp) noexcept
Definition:
ap_fixedTest.cxx:15
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition:
GeoPrimitivesHelpers.h:54
readCCLHist.float
float
Definition:
readCCLHist.py:83
Generated on Mon Dec 23 2024 21:08:57 for ATLAS Offline Software by
1.8.18