ATLAS Offline Software
GenericMuonSimHit.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_GenericId(0xffff),
10  m_globalTime(0.),
11  m_globalpreTime(0.),
12  m_particleEncoding(0),// PDG_ID
13  m_kineticEnergy(-9999.),// energy of the particle
14  m_depositEnergy(-9999.),//Geant4 deposited energy
15  m_StepLength(-9999.),//total lenght of particle
16  m_partLink()
17 {
18 }
19 /*******************************************************************************/
20 //default destructor required by Pool
22 /*******************************************************************************/
23 GenericMuonSimHit::GenericMuonSimHit(HitID id, double time, double pretime,
24  const Amg::Vector3D& position,
25  const Amg::Vector3D& lposition,
26  const Amg::Vector3D& preposition,
27  const Amg::Vector3D& lpreposition,
28  const int particleEncoding,
29  const double kineticEnergy,
30  const Amg::Vector3D& direction,
31  const double depositEnergy,
32  const double StepLength,
33  const int truthBarcode)
34  : m_GenericId(id), m_globalTime(time), m_globalpreTime(pretime)
35  , m_globalPosition(position)
36  , m_localPosition(lposition)
37  , m_globalPrePosition(preposition)
38  , m_localPrePosition(lpreposition)
39  , m_particleEncoding(particleEncoding)
40  , m_kineticEnergy(kineticEnergy)
41  , m_globalDirection(direction)
42  , m_depositEnergy(depositEnergy)
43  , m_StepLength(StepLength)
44  , m_partLink(truthBarcode, 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based
45 {
46 }
47 
48 GenericMuonSimHit::GenericMuonSimHit(HitID id, double time, double pretime,
49  const Amg::Vector3D& position,
50  const Amg::Vector3D& lposition,
51  const Amg::Vector3D& preposition,
52  const Amg::Vector3D& lpreposition,
53  const int particleEncoding,
54  const double kineticEnergy,
55  const Amg::Vector3D& direction,
56  const double depositEnergy,
57  const double StepLength,
58  const HepMcParticleLink& hmpl)
59  : m_GenericId(id), m_globalTime(time), m_globalpreTime(pretime)
60  , m_globalPosition(position)
61  , m_localPosition(lposition)
62  , m_globalPrePosition(preposition)
63  , m_localPrePosition(lpreposition)
64  , m_particleEncoding(particleEncoding)
65  , m_kineticEnergy(kineticEnergy)
66  , m_globalDirection(direction)
67  , m_depositEnergy(depositEnergy)
68  , m_StepLength(StepLength)
69  , m_partLink(hmpl)
70 {
71 }
72 /*******************************************************************************/
73 std::string GenericMuonSimHit::print() const {
74 
75  std::stringstream ss;
76 
77  ss << "-------------------------------------------------------------" << std::endl;
78  ss << "GenericMuonSimHit:"<<std::endl;
79  ss << " identifier: " << m_GenericId;
80  ss << " t (pre) : " << m_globalpreTime;
81  ss << " t: " << m_globalTime;
82  ss << " x (pre) : (" << m_globalPrePosition.x()
83  << "," << m_globalPrePosition.y()
84  << "," << m_globalPrePosition.z()
85  << ")";
86  ss << " x : (" << m_globalPosition.x()
87  << "," << m_globalPosition.y()
88  << "," << m_globalPosition.z()
89  << ")"<<std::endl;
90  ss << " pdgId: "<<m_particleEncoding<<" kineticEnergy: "<<m_kineticEnergy<<std::endl;
91 
92  return ss.str();
93 }
94 /*******************************************************************************/
96 { return m_partLink.barcode(); }
97 /*******************************************************************************/
99 { return m_partLink.id(); }
100 /*******************************************************************************/
GenericMuonSimHit::m_GenericId
HitID m_GenericId
Definition: GenericMuonSimHit.h:90
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
GenericMuonSimHit::m_globalTime
float m_globalTime
Definition: GenericMuonSimHit.h:91
GenericMuonSimHit::~GenericMuonSimHit
~GenericMuonSimHit()
GenericMuonSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: GenericMuonSimHit.h:107
GenericMuonSimHit::print
std::string print() const
Definition: GenericMuonSimHit.cxx:73
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
GenericMuonSimHit.h
GenericMuonSimHit::m_globalpreTime
float m_globalpreTime
Definition: GenericMuonSimHit.h:92
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
GenericMuonSimHit::m_globalPrePosition
Amg::Vector3D m_globalPrePosition
Definition: GenericMuonSimHit.h:97
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
GenericMuonSimHit::m_kineticEnergy
float m_kineticEnergy
Definition: GenericMuonSimHit.h:101
GenericMuonSimHit::truthBarcode
int truthBarcode() const
Definition: GenericMuonSimHit.cxx:95
HitID
int HitID
Definition: GenericMuonSimHit.h:13
GenericMuonSimHit::m_particleEncoding
int m_particleEncoding
Definition: GenericMuonSimHit.h:100
Trk::StepLength
@ StepLength
Definition: MaterialAssociationType.h:17
GenericMuonSimHit::GenericMuonSimHit
GenericMuonSimHit()
Definition: GenericMuonSimHit.cxx:8
GenericMuonSimHit::m_globalPosition
Amg::Vector3D m_globalPosition
Definition: GenericMuonSimHit.h:94
GenericMuonSimHit::truthID
int truthID() const
Definition: GenericMuonSimHit.cxx:98