ATLAS Offline Software
GenericMuonSimHit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONSIMEVENT_GenericMuonSimHit_H
6 #define MUONSIMEVENT_GenericMuonSimHit_H 1
7 
10 
11 #include <string>
12 
13 typedef int HitID;
14 
15 class GenericMuonSimHit final{
16  public:
17  //
18  // construction/destruction
19  //
20  // needed by athenaRoot
22 
23  // Destructor:
25  GenericMuonSimHit(HitID id, double time, double pretime,
26  const Amg::Vector3D& position,
27  const Amg::Vector3D& local_position,
28  const Amg::Vector3D& preposition,
29  const Amg::Vector3D& local_preposition,
30  const int particleEncoding, const double kineticEnergy,
31  const Amg::Vector3D& direction, const double depositEnergy,
32  const double StepLength, const int truthBarcode);
33  GenericMuonSimHit(HitID id, double time, double pretime,
34  const Amg::Vector3D& position,
35  const Amg::Vector3D& local_position,
36  const Amg::Vector3D& preposition,
37  const Amg::Vector3D& local_preposition,
38  const int particleEncoding, const double kineticEnergy,
39  const Amg::Vector3D& direction, const double depositEnergy,
40  const double StepLength, const HepMcParticleLink& hmpl);
41 
42  //
43  // member functions
44  //
45 
46  //preStep globalTime
47  double globalpreTime() const { return (double) m_globalpreTime; }
48  //postStep globalTime
49  double globalTime() const { return (double) m_globalTime; }
50 
51  //preStep Global and Local position
54  //postStep Global and Local Position
55  const Amg::Vector3D& globalPosition() const { return m_globalPosition; }
56  const Amg::Vector3D& localPosition() const { return m_localPosition; }
57  int particleEncoding() const { return m_particleEncoding; }
58  double kineticEnergy() const { return (double) m_kineticEnergy; }
59  const Amg::Vector3D& globalDirection() const { return m_globalDirection; }
60  double depositEnergy() const { return (double) m_depositEnergy; }
61  double StepLength() const { return (double) m_StepLength; }
62 
63  HitID GenericId() const { return m_GenericId; }
64  std::string print() const;
65 
66  bool operator< (const GenericMuonSimHit& rhs) const
67  { return m_GenericId < rhs.m_GenericId; }
68 
69  double meanTime() const;
70 
71  void setGlobalTime( const double time ) { m_globalTime = time; }
76 
77  // truth barcode of the track which released this energy:
78  int truthBarcode() const;
79 
80  // GenParticle::id of the track which released this energy:
81  int truthID() const;
82 
83  // link to the particle generating the hit
84  const HepMcParticleLink& particleLink() const;
85 
86  private:
87  //
88  // member data
89  //
91  float m_globalTime;
93  // postStep
96  //preStep
99 
100  int m_particleEncoding; // PDG id
101  float m_kineticEnergy; // kinetic energy of the particle
102 
106 
108 };
109 
110 //inline methods
111 
113 { return m_partLink; }
114 inline double GenericMuonSimHit::meanTime() const
115 { return (double) m_globalTime; }
116 inline float hitTime(const GenericMuonSimHit& hit)
117 { return (float) hit.meanTime(); }
118 
119 #endif
GenericMuonSimHit::m_GenericId
HitID m_GenericId
Definition: GenericMuonSimHit.h:90
GenericMuonSimHit::StepLength
double StepLength() const
Definition: GenericMuonSimHit.h:61
GenericMuonSimHit::globalPosition
const Amg::Vector3D & globalPosition() const
Definition: GenericMuonSimHit.h:55
GenericMuonSimHit::localPrePosition
const Amg::Vector3D & localPrePosition() const
Definition: GenericMuonSimHit.h:53
GenericMuonSimHit::setGlobalDirection
void setGlobalDirection(const Amg::Vector3D &globalDirection)
sets the direction expressed in global coordinates
Definition: GenericMuonSimHit.h:74
GenericMuonSimHit::globalTime
double globalTime() const
Definition: GenericMuonSimHit.h:49
GenericMuonSimHit::m_globalTime
float m_globalTime
Definition: GenericMuonSimHit.h:91
GenericMuonSimHit::m_localPrePosition
Amg::Vector3D m_localPrePosition
Definition: GenericMuonSimHit.h:98
GenericMuonSimHit::globalDirection
const Amg::Vector3D & globalDirection() const
Definition: GenericMuonSimHit.h:59
GenericMuonSimHit::~GenericMuonSimHit
~GenericMuonSimHit()
GenericMuonSimHit::localPosition
const Amg::Vector3D & localPosition() const
Definition: GenericMuonSimHit.h:56
GeoPrimitives.h
GenericMuonSimHit::GenericId
HitID GenericId() const
Definition: GenericMuonSimHit.h:63
GenericMuonSimHit::operator<
bool operator<(const GenericMuonSimHit &rhs) const
Definition: GenericMuonSimHit.h:66
GenericMuonSimHit::m_depositEnergy
float m_depositEnergy
Definition: GenericMuonSimHit.h:104
GenericMuonSimHit::meanTime
double meanTime() const
Definition: GenericMuonSimHit.h:114
hitTime
float hitTime(const GenericMuonSimHit &hit)
Definition: GenericMuonSimHit.h:116
GenericMuonSimHit::m_StepLength
float m_StepLength
Definition: GenericMuonSimHit.h:105
GenericMuonSimHit::m_localPosition
Amg::Vector3D m_localPosition
Definition: GenericMuonSimHit.h:95
GenericMuonSimHit::setDepositEnergy
void setDepositEnergy(const double depositEnergy)
Definition: GenericMuonSimHit.h:72
GenericMuonSimHit::setGlobalPosition
void setGlobalPosition(const Amg::Vector3D &globalPosition)
sets the position expressed in global coordinates
Definition: GenericMuonSimHit.h:73
GenericMuonSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: GenericMuonSimHit.h:107
GenericMuonSimHit::particleLink
const HepMcParticleLink & particleLink() const
Definition: GenericMuonSimHit.h:112
GenericMuonSimHit::kineticEnergy
double kineticEnergy() const
Definition: GenericMuonSimHit.h:58
GenericMuonSimHit::print
std::string print() const
Definition: GenericMuonSimHit.cxx:73
GenericMuonSimHit::depositEnergy
double depositEnergy() const
Definition: GenericMuonSimHit.h:60
GenericMuonSimHit::globalPrePosition
const Amg::Vector3D & globalPrePosition() const
Definition: GenericMuonSimHit.h:52
GenericMuonSimHit::globalpreTime
double globalpreTime() const
Definition: GenericMuonSimHit.h:47
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_globalDirection
Amg::Vector3D m_globalDirection
Definition: GenericMuonSimHit.h:103
GenericMuonSimHit::setGlobalTime
void setGlobalTime(const double time)
Definition: GenericMuonSimHit.h:71
GenericMuonSimHit::m_kineticEnergy
float m_kineticEnergy
Definition: GenericMuonSimHit.h:101
GenericMuonSimHit::truthBarcode
int truthBarcode() const
Definition: GenericMuonSimHit.cxx:95
GenericMuonSimHit::particleEncoding
int particleEncoding() const
Definition: GenericMuonSimHit.h:57
HitID
int HitID
Definition: GenericMuonSimHit.h:13
GenericMuonSimHit::m_particleEncoding
int m_particleEncoding
Definition: GenericMuonSimHit.h:100
GenericMuonSimHit::GenericMuonSimHit
GenericMuonSimHit()
Definition: GenericMuonSimHit.cxx:8
GenericMuonSimHit
Definition: GenericMuonSimHit.h:15
GenericMuonSimHit::m_globalPosition
Amg::Vector3D m_globalPosition
Definition: GenericMuonSimHit.h:94
GenericMuonSimHit::setKineticEnergy
void setKineticEnergy(const double kineticEnergy)
Definition: GenericMuonSimHit.h:75
GenericMuonSimHit::truthID
int truthID() const
Definition: GenericMuonSimHit.cxx:98