ATLAS Offline Software
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 
6 
7 
8 #include <sstream>
9 // construction/destruction
10 
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 
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 
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 
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 
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 
119  { return m_partLink.barcode(); }
120 
122 { return m_partLink.id(); }
MDTSimHit::m_energyDeposit
float m_energyDeposit
Definition: MDTSimHit.h:89
MDTSimHit::m_localPosition
Amg::Vector3D m_localPosition
Definition: MDTSimHit.h:85
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
MDTSimHit::m_kineticEnergy
float m_kineticEnergy
Definition: MDTSimHit.h:91
MDTSimHit::m_particleEncoding
int m_particleEncoding
Definition: MDTSimHit.h:90
MDTSimHit::truthID
int truthID() const
Definition: MDTSimHit.cxx:121
MDTSimHit::m_driftRadius
float m_driftRadius
Definition: MDTSimHit.h:84
Trk::energyDeposit
@ energyDeposit
Definition: MeasurementType.h:32
MDTSimHit.h
MDTSimHit::~MDTSimHit
~MDTSimHit()
MDTSimHit::m_globalTime
float m_globalTime
Definition: MDTSimHit.h:83
MDTSimHit::MDTSimHit
MDTSimHit()
Definition: MDTSimHit.cxx:11
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
MDTSimHit::m_MDTid
HitID m_MDTid
Definition: MDTSimHit.h:82
MDTSimHit::m_stepLength
float m_stepLength
Definition: MDTSimHit.h:88
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
MDTSimHit::print
std::string print() const
Definition: MDTSimHit.cxx:100
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
MDTSimHit::truthBarcode
int truthBarcode() const
Definition: MDTSimHit.cxx:118
MDTSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: MDTSimHit.h:86
HitID
int HitID
Definition: GenericMuonSimHit.h:13
readCCLHist.float
float
Definition: readCCLHist.py:83