ATLAS Offline Software
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 
6 #include <sstream>
7 /*******************************************************************************/
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 /*******************************************************************************/
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 
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 
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 /*******************************************************************************/
103 { return m_partLink.barcode(); }
104 
105 /*******************************************************************************/
107 { return m_partLink.id(); }
108 
109 /*******************************************************************************/
sTGCSimHit::truthBarcode
int truthBarcode() const
Definition: sTGCSimHit.cxx:102
sTGCSimHit::m_globalTime
float m_globalTime
Definition: sTGCSimHit.h:78
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
sTGCSimHit.h
sTGCSimHit::truthID
int truthID() const
Definition: sTGCSimHit.cxx:106
sTGCSimHit::m_globalDirection
Amg::Vector3D m_globalDirection
Definition: sTGCSimHit.h:84
sTGCSimHit::sTGCSimHit
sTGCSimHit()
Definition: sTGCSimHit.cxx:8
sTGCSimHit::m_particleEncoding
int m_particleEncoding
Definition: sTGCSimHit.h:82
sTGCSimHit::m_kineticEnergy
float m_kineticEnergy
Definition: sTGCSimHit.h:90
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
sTGCSimHit::~sTGCSimHit
~sTGCSimHit()
sTGCSimHit::m_sTGCId
HitID m_sTGCId
Definition: sTGCSimHit.h:77
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
sTGCSimHit::m_globalPrePosition
Amg::Vector3D m_globalPrePosition
Definition: sTGCSimHit.h:91
sTGCSimHit::m_globalPosition
Amg::Vector3D m_globalPosition
Definition: sTGCSimHit.h:80
sTGCSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: sTGCSimHit.h:87
HitID
int HitID
Definition: GenericMuonSimHit.h:13
readCCLHist.float
float
Definition: readCCLHist.py:83
sTGCSimHit::print
std::string print() const
Definition: sTGCSimHit.cxx:74