ATLAS Offline Software
Loading...
Searching...
No Matches
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.),
17 m_kineticEnergy(-9999.)
18{
19}
20
21//defualt destructor required by Pool
22TGCSimHit::~TGCSimHit() = default;
23
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.)
36 , m_kineticEnergy(-9999.)
37{
38
39}
40
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))
58 , m_kineticEnergy(static_cast<float>(kineticEnergy))
59{
60
61}
62
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))
80 , m_kineticEnergy(static_cast<float>(kineticEnergy))
81{
82
83}
84
86// Implementation of member functions
88
89//______________________________________________________________________________
90std::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(); }
static Double_t ss
double kineticEnergy() const
Definition TGCSimHit.h:49
Amg::Vector3D m_localDireCos
Definition TGCSimHit.h:74
int particleEncoding() const
Definition TGCSimHit.h:48
float m_stepLength
Definition TGCSimHit.h:77
float m_kineticEnergy
Definition TGCSimHit.h:79
double energyDeposit() const
Definition TGCSimHit.h:46
float m_energyDeposit
Definition TGCSimHit.h:76
int truthBarcode() const
Amg::Vector3D m_localPosition
Definition TGCSimHit.h:73
float m_globalTime
Definition TGCSimHit.h:72
HepMcParticleLink m_partLink
Definition TGCSimHit.h:75
int m_particleEncoding
Definition TGCSimHit.h:78
int m_TGCid
Definition TGCSimHit.h:71
double stepLength() const
Definition TGCSimHit.h:47
std::string print() const
Definition TGCSimHit.cxx:90
int truthID() const
Eigen::Matrix< double, 3, 1 > Vector3D