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