ATLAS Offline Software
sTGCSimHit.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_sTGCSimHit_H
6 #define MUONSIMEVENT_sTGCSimHit_H 1
7 
10 
11 #include <string>
12 
13 typedef int HitID;
14 
15 class sTGCSimHit final{
16  public:
17  //
18  // construction/destruction
19  //
20  // needed by athenaRoot
21  sTGCSimHit();
22 
23  // Destructor:
25  sTGCSimHit(HitID id, double time, const Amg::Vector3D& position,
26  const int particleEncoding, const Amg::Vector3D& direction,
27  const double depositEnergy, const int truthBarcode);
28  sTGCSimHit(HitID id, double time, const Amg::Vector3D& position,
29  const int particleEncoding, const Amg::Vector3D& direction,
30  const double depositEnergy, const HepMcParticleLink& hmpl);
31  sTGCSimHit(HitID id, double time, const Amg::Vector3D& position,
32  const int particleEncoding, const Amg::Vector3D& direction,
33  const double depositEnergy, const HepMcParticleLink& hmpl,
34  const double kineticEnergy, const Amg::Vector3D& preposition);
35 
36  //
37  // member functions
38  //
39 
40  //postStep globalTime
41  double globalTime() const { return (double) m_globalTime; }
42 
43  //postStep Global and Local Position
44  const Amg::Vector3D& globalPosition() const { return m_globalPosition; }
45  int particleEncoding() const { return m_particleEncoding; }
46  const Amg::Vector3D& globalDirection() const { return m_globalDirection; }
47  double depositEnergy() const { return (double) m_depositEnergy; }
48  double kineticEnergy() const { return static_cast<double>(m_kineticEnergy); }
50 
51  HitID sTGCId() const { return m_sTGCId; }
52  std::string print() const;
53 
54  bool operator< (const sTGCSimHit& rhs) const
55  { return m_sTGCId < rhs.m_sTGCId; }
56 
57  double meanTime() const;
58 
59  void setGlobalTime( const double time ) { m_globalTime = time; }
63 
64  // truth barcode of the track which released this energy:
65  int truthBarcode() const;
66 
67  // GenParticle::id of the track which released this energy:
68  int truthID() const;
69 
70  // link to the particle generating the hit
71  const HepMcParticleLink& particleLink() const;
72 
73  private:
74  //
75  // member data
76  //
78  float m_globalTime;
79  // postStep
81 
82  int m_particleEncoding; // PDG id
83 
86 
88 
89  //float m_stepLength;
92 };
93 
94 //inline methods
95 
97 { return m_partLink; }
98 inline double sTGCSimHit::meanTime() const
99 { return (double) m_globalTime; }
100 inline float hitTime(const sTGCSimHit& hit)
101 { return (float) hit.meanTime(); }
102 
103 #endif
sTGCSimHit::setGlobalDirection
void setGlobalDirection(const Amg::Vector3D &globalDirection)
sets the direction expressed in global coordinates
Definition: sTGCSimHit.h:62
sTGCSimHit::truthBarcode
int truthBarcode() const
Definition: sTGCSimHit.cxx:102
sTGCSimHit::m_globalTime
float m_globalTime
Definition: sTGCSimHit.h:78
sTGCSimHit::particleLink
const HepMcParticleLink & particleLink() const
Definition: sTGCSimHit.h:96
sTGCSimHit::truthID
int truthID() const
Definition: sTGCSimHit.cxx:106
hitTime
float hitTime(const sTGCSimHit &hit)
Definition: sTGCSimHit.h:100
sTGCSimHit::m_globalDirection
Amg::Vector3D m_globalDirection
Definition: sTGCSimHit.h:84
sTGCSimHit::sTGCSimHit
sTGCSimHit()
Definition: sTGCSimHit.cxx:8
sTGCSimHit::m_particleEncoding
int m_particleEncoding
Definition: sTGCSimHit.h:82
sTGCSimHit::meanTime
double meanTime() const
Definition: sTGCSimHit.h:98
sTGCSimHit::m_kineticEnergy
float m_kineticEnergy
Definition: sTGCSimHit.h:90
GeoPrimitives.h
HitID
int HitID
Definition: sTGCSimHit.h:13
sTGCSimHit::operator<
bool operator<(const sTGCSimHit &rhs) const
Definition: sTGCSimHit.h:54
sTGCSimHit::sTGCId
HitID sTGCId() const
Definition: sTGCSimHit.h:51
sTGCSimHit::setGlobalTime
void setGlobalTime(const double time)
Definition: sTGCSimHit.h:59
sTGCSimHit::globalDirection
const Amg::Vector3D & globalDirection() const
Definition: sTGCSimHit.h:46
sTGCSimHit::kineticEnergy
double kineticEnergy() const
Definition: sTGCSimHit.h:48
sTGCSimHit::globalTime
double globalTime() const
Definition: sTGCSimHit.h:41
sTGCSimHit::~sTGCSimHit
~sTGCSimHit()
sTGCSimHit::m_depositEnergy
float m_depositEnergy
Definition: sTGCSimHit.h:85
sTGCSimHit::setDepositEnergy
void setDepositEnergy(const double depositEnergy)
Definition: sTGCSimHit.h:60
sTGCSimHit::m_sTGCId
HitID m_sTGCId
Definition: sTGCSimHit.h:77
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
sTGCSimHit::particleEncoding
int particleEncoding() const
Definition: sTGCSimHit.h:45
sTGCSimHit
Definition: sTGCSimHit.h:15
sTGCSimHit::setGlobalPosition
void setGlobalPosition(const Amg::Vector3D &globalPosition)
sets the position expressed in global coordinates
Definition: sTGCSimHit.h:61
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
sTGCSimHit::m_globalPrePosition
Amg::Vector3D m_globalPrePosition
Definition: sTGCSimHit.h:91
sTGCSimHit::m_globalPosition
Amg::Vector3D m_globalPosition
Definition: sTGCSimHit.h:80
sTGCSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: sTGCSimHit.h:87
sTGCSimHit::depositEnergy
double depositEnergy() const
Definition: sTGCSimHit.h:47
sTGCSimHit::globalPrePosition
const Amg::Vector3D & globalPrePosition() const
Definition: sTGCSimHit.h:49
HitID
int HitID
Definition: GenericMuonSimHit.h:13
sTGCSimHit::globalPosition
const Amg::Vector3D & globalPosition() const
Definition: sTGCSimHit.h:44
sTGCSimHit::print
std::string print() const
Definition: sTGCSimHit.cxx:74