ATLAS Offline Software
RPCSimHit.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 
7 
8 
9 #include <sstream>
10 
11 // construction/destruction
12 
14  m_RPCid(0xffff),
15  m_globalTime(0.),
16  m_localPosition(0.,0.,0.), // pre-step position
17  m_partLink(),
18  m_localPostStepPosition(0.,0.,0.), // post-step position
19  m_energyDeposit(-1.), //Geant4 de/dx
20  m_stepLength(-1.), //Geant4 step Length
21  m_particleEncoding(0), // PDG id
22  m_kineticEnergy(-1.) // kinetic energy of the particle
23 {
24 }
25 //default destructor required by Pool
26 RPCSimHit::~RPCSimHit( ) = default;
27 
29  double time,
30  const Amg::Vector3D& position)
31  : m_RPCid(id),
32  m_globalTime(time),
33  m_localPosition(position),
34  m_partLink(),
35  m_localPostStepPosition(0.,0.,0.), // post-step position
36  m_energyDeposit(-1.), //Geant4 de/dx
37  m_stepLength(-1.), //Geant4 step Length
38  m_particleEncoding(0), // PDG id
39  m_kineticEnergy(-1.) // kinetic energy of the particle
40 {
41 }
42 
44  double time,
45  const Amg::Vector3D& position,
46  const int truthBarcode)
47  : m_RPCid(id),
48  m_globalTime(time),
49  m_localPosition(position),
50  m_partLink(truthBarcode, 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE), // FIXME barcode-based
51  m_localPostStepPosition(0.,0.,0.), // post-step position
52  m_energyDeposit(-1.), //Geant4 de/dx
53  m_stepLength(-1.), //Geant4 step Length
54  m_particleEncoding(0), // PDG id
55  m_kineticEnergy(-1.) // kinetic energy of the particle
56 {
57 }
58 
60  double time,
61  const Amg::Vector3D& prePosition,
62  const int truthBarcode,
63  const Amg::Vector3D& postPosition,
64  const double energyDeposit, const double stepLength,
65  const int particleEncoding, const double kineticEnergy)
66  : m_RPCid(id), m_globalTime(time)
67  , m_localPosition(prePosition)
68  , m_partLink(truthBarcode, 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based
69  , m_localPostStepPosition(postPosition)
70  , m_energyDeposit(static_cast<float>(energyDeposit))
71  , m_stepLength(static_cast<float>(stepLength))
72  , m_particleEncoding(particleEncoding)
73  , m_kineticEnergy(static_cast<float>(kineticEnergy))
74 {
75 }
76 
78  double time,
79  const Amg::Vector3D& prePosition,
80  const HepMcParticleLink& hmpl,
81  const Amg::Vector3D& postPosition,
82  const double energyDeposit, const double stepLength,
83  const int particleEncoding, const double kineticEnergy)
84  : m_RPCid(id), m_globalTime(time)
85  , m_localPosition(prePosition)
86  , m_partLink(hmpl)
87  , m_localPostStepPosition(postPosition)
88  , m_energyDeposit(static_cast<float>(energyDeposit))
89  , m_stepLength(static_cast<float>(stepLength))
90  , m_particleEncoding(particleEncoding)
91  , m_kineticEnergy(static_cast<float>(kineticEnergy))
92 {
93 }
94 
95 // Implemenation of member functions
96 std::string RPCSimHit::print() const {
97 
98  std::stringstream ss;
99 
100  ss << "RPCSimHit:";
101  ss << " identifier: " << m_RPCid;
102  ss << " t: " << m_globalTime;
103  ss << " startPoint: (" << m_localPosition.x()
104  << "," << m_localPosition.y()
105  << "," << m_localPosition.z()
106  << ")";
107  ss << " endPoint: ("<< m_localPostStepPosition.x()
108  << "," << m_localPostStepPosition.y()
109  << "," << m_localPostStepPosition.z()
110  << ")";
111  ss << " EnergyDeposit: "<<m_energyDeposit<<" StepLength: "<<m_stepLength
112  <<" pdgId: "<<m_particleEncoding<<" kineticEnergy: "<<m_kineticEnergy;
113 
114  return ss.str();
115 }
116 
118  { return m_partLink.barcode(); }
119 
121 { return m_partLink.id(); }
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
RPCSimHit::m_globalTime
float m_globalTime
Definition: RPCSimHit.h:85
RPCSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: RPCSimHit.h:87
Trk::energyDeposit
@ energyDeposit
Definition: MeasurementType.h:32
RPCSimHit::m_kineticEnergy
float m_kineticEnergy
Definition: RPCSimHit.h:92
RPCSimHit::~RPCSimHit
~RPCSimHit()
RPCSimHit::truthID
int truthID() const
Definition: RPCSimHit.cxx:120
RPCSimHit::m_localPosition
Amg::Vector3D m_localPosition
Definition: RPCSimHit.h:86
RPCSimHit::m_RPCid
int m_RPCid
Definition: RPCSimHit.h:84
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
RPCSimHit::m_stepLength
float m_stepLength
Definition: RPCSimHit.h:90
RPCSimHit::m_localPostStepPosition
Amg::Vector3D m_localPostStepPosition
Definition: RPCSimHit.h:88
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
RPCSimHit::print
std::string print() const
Definition: RPCSimHit.cxx:96
RPCSimHit.h
RPCSimHit::m_particleEncoding
int m_particleEncoding
Definition: RPCSimHit.h:91
readCCLHist.float
float
Definition: readCCLHist.py:83
RPCSimHit::truthBarcode
int truthBarcode() const
Definition: RPCSimHit.cxx:117
RPCSimHit::RPCSimHit
RPCSimHit()
Definition: RPCSimHit.cxx:13
RPCSimHit::m_energyDeposit
float m_energyDeposit
Definition: RPCSimHit.h:89