ATLAS Offline Software
MMSimHit.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_MMId(0xffff),
10  m_globalTime(0.),
11  m_particleEncoding(0),// PDG_ID
12  m_kineticEnergy(-9999.),// energy of the particle
13  m_depositEnergy(-9999.),//Geant4 deposited energy
14  m_partLink()
15 {
16 }
17 /*******************************************************************************/
19  const Amg::Vector3D& position,
20  const int particleEncoding,
21  const double kineticEnergy,
22  const Amg::Vector3D& direction,
23  const double depositEnergy,
24  const int truthBarcode)
25  : m_MMId(id), m_globalTime(time)
26  , m_globalPosition(position)
27  , m_particleEncoding(particleEncoding)
28  , m_kineticEnergy(kineticEnergy)
29  , m_globalDirection(direction)
30  , m_depositEnergy(depositEnergy)
31  , m_partLink(truthBarcode, 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based
32 {
33 }
34 
36  const Amg::Vector3D& position,
37  const int particleEncoding,
38  const double kineticEnergy,
39  const Amg::Vector3D& direction,
40  const double depositEnergy,
41  const HepMcParticleLink& hmpl)
42  : m_MMId(id), m_globalTime(time)
43  , m_globalPosition(position)
44  , m_particleEncoding(particleEncoding)
45  , m_kineticEnergy(kineticEnergy)
46  , m_globalDirection(direction)
47  , m_depositEnergy(depositEnergy)
48  , m_partLink(hmpl)
49 {
50 }
51 /*******************************************************************************/
52 std::string MMSimHit::print() const {
53 
54  std::stringstream ss;
55 
56  ss << "-------------------------------------------------------------" << std::endl;
57  ss << "MMSimHit:"<<std::endl;
58  ss << " identifier: " << m_MMId;
59  ss << " t: " << m_globalTime;
60  ss << " x : (" << m_globalPosition.x()
61  << "," << m_globalPosition.y()
62  << "," << m_globalPosition.z()
63  << ")"<<std::endl;
64  ss << " pdgId: "<<m_particleEncoding<<" kineticEnergy: "<<m_kineticEnergy<<std::endl;
65 
66  return ss.str();
67 }
68 /*******************************************************************************/
70 { return m_partLink.barcode(); }
71 /*******************************************************************************/
72 int MMSimHit::truthID() const
73 { return m_partLink.id(); }
74 /*******************************************************************************/
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
MMSimHit::m_particleEncoding
int m_particleEncoding
Definition: MMSimHit.h:76
MMSimHit::m_kineticEnergy
double m_kineticEnergy
Definition: MMSimHit.h:77
MMSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: MMSimHit.h:82
MMSimHit::print
std::string print() const
Definition: MMSimHit.cxx:52
MMSimHit.h
MMSimHit::m_globalPosition
Amg::Vector3D m_globalPosition
Definition: MMSimHit.h:74
MMSimHit::truthBarcode
int truthBarcode() const
Definition: MMSimHit.cxx:69
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MMSimHit::MMSimHit
MMSimHit()
Definition: MMSimHit.cxx:8
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
MMSimHit::truthID
int truthID() const
Definition: MMSimHit.cxx:72
HitID
int HitID
Definition: GenericMuonSimHit.h:13
MMSimHit::m_globalTime
double m_globalTime
Definition: MMSimHit.h:72
MMSimHit::m_MMId
HitID m_MMId
Definition: MMSimHit.h:71