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