ATLAS Offline Software
Loading...
Searching...
No Matches
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(),
15{
16}
17/*******************************************************************************/
18//default destructor required by Pool
19sTGCSimHit::~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)
30 , m_globalDirection(direction)
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)
46 , m_globalDirection(direction)
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)
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/*******************************************************************************/
74std::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/*******************************************************************************/
int HitID
static Double_t ss
std::string print() const
Amg::Vector3D m_globalPosition
Definition sTGCSimHit.h:80
HepMcParticleLink m_partLink
Definition sTGCSimHit.h:87
float m_depositEnergy
Definition sTGCSimHit.h:85
double kineticEnergy() const
Definition sTGCSimHit.h:48
Amg::Vector3D m_globalPrePosition
Definition sTGCSimHit.h:91
float m_kineticEnergy
Definition sTGCSimHit.h:90
float m_globalTime
Definition sTGCSimHit.h:78
int truthBarcode() const
int particleEncoding() const
Definition sTGCSimHit.h:45
int truthID() const
HitID m_sTGCId
Definition sTGCSimHit.h:77
double depositEnergy() const
Definition sTGCSimHit.h:47
int m_particleEncoding
Definition sTGCSimHit.h:82
Amg::Vector3D m_globalDirection
Definition sTGCSimHit.h:84
Eigen::Matrix< double, 3, 1 > Vector3D