ATLAS Offline Software
RPCSimHit.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 MUONG4SIMEVENT_RPCSimHit_H
6 #define MUONG4SIMEVENT_RPCSimHit_H
7 
10 
11 #include <string>
12 
13 //---------------------
14 // back to the situation of tag MuonSimEvent-00-00-25 to avoid
15 // uncompatibility between 8.0.2 and 8.2.0 ----->
16 // redundant time methods are present (globalTime() and meanTime() return the
17 // same time) --->NOT TO BE FIXED!!<----
18 
19 class RPCSimHit final{
20 
21 public:
22  //
23  // construction/destruction
24  //
25  // needed by athenaRoot
26  RPCSimHit();
27 
28  // Destructor:
30  RPCSimHit(int id, double time, const Amg::Vector3D& position);
31  RPCSimHit(int id, double time, const Amg::Vector3D& position, const int truthBarcode);
32  RPCSimHit(int id, double time,
33  const Amg::Vector3D& prePosition,
34  const int truthBarcode,
35  const Amg::Vector3D& postPosition,
36  const double energyDeposit,
37  const double stepLength,
38  const int particleEncoding,
39  const double kineticEnergy);
40  RPCSimHit(int id, double time,
41  const Amg::Vector3D& prePosition,
42  const HepMcParticleLink& hmpl,
43  const Amg::Vector3D& postPosition,
44  const double energyDeposit,
45  const double stepLength,
46  const int particleEncoding,
47  const double kineticEnergy);
48 
49 
50 
51  //
52  // member functions
53  //
54  double globalTime() const { return (double) m_globalTime; }
55  const Amg::Vector3D& localPosition() const { return m_localPosition; }
56  const Amg::Vector3D& preLocalPosition() const { return m_localPosition; }
58  double energyDeposit() const { return static_cast<double>(m_energyDeposit); }
59  double prePostStepDistance() const { return (m_localPostStepPosition-m_localPosition).mag(); }
60  double stepLength() const { return m_stepLength; }
61  int particleEncoding() const { return m_particleEncoding; }
62  double kineticEnergy() const { return static_cast<double>(m_kineticEnergy); }
63  int RPCid() const { return m_RPCid; }
64  std::string print() const;
65  bool operator< (const RPCSimHit& rhs) const
66  { return m_RPCid < rhs.m_RPCid; }
67  double meanTime() const;
68 
69  // truth barcode of the track which released this energy:
70  int truthBarcode() const;
71 
72  // GenParticle::id of the track which released this energy:
73  int truthID() const;
74 
75 // link to the particle generating the hit
76  const HepMcParticleLink& particleLink() const;
77 
78  void setGlobalTime( const double time ) { m_globalTime = time; }
79 
80 private:
81  //
82  // member data
83  //
84  int m_RPCid;
85  float m_globalTime;
86  Amg::Vector3D m_localPosition; // pre-step position
88  Amg::Vector3D m_localPostStepPosition; // post-step position
89  float m_energyDeposit; //Geant4 de/dx
90  float m_stepLength; //Geant4 stepLength
91  int m_particleEncoding; // PDG id
92  float m_kineticEnergy; // kinetic energy of the particle
93 
94 
95 };
96 //inline methods
97 
98 inline double RPCSimHit::meanTime() const
99  { return (double) m_globalTime; }
100 
102  { return m_partLink; }
103 
104 // open functions
105 
106 inline float hitTime(const RPCSimHit& hit)
107  { return (float) hit.meanTime(); }
108 
109 #endif
110 
RPCSimHit::particleEncoding
int particleEncoding() const
Definition: RPCSimHit.h:61
RPCSimHit::globalTime
double globalTime() const
Definition: RPCSimHit.h:54
RPCSimHit::stepLength
double stepLength() const
Definition: RPCSimHit.h:60
hitTime
float hitTime(const RPCSimHit &hit)
Definition: RPCSimHit.h:106
RPCSimHit::m_globalTime
float m_globalTime
Definition: RPCSimHit.h:85
RPCSimHit::energyDeposit
double energyDeposit() const
Definition: RPCSimHit.h:58
RPCSimHit::localPosition
const Amg::Vector3D & localPosition() const
Definition: RPCSimHit.h:55
RPCSimHit::m_partLink
HepMcParticleLink m_partLink
Definition: RPCSimHit.h:87
RPCSimHit::preLocalPosition
const Amg::Vector3D & preLocalPosition() const
Definition: RPCSimHit.h:56
GeoPrimitives.h
RPCSimHit::m_kineticEnergy
float m_kineticEnergy
Definition: RPCSimHit.h:92
RPCSimHit::~RPCSimHit
~RPCSimHit()
RPCSimHit::truthID
int truthID() const
Definition: RPCSimHit.cxx:120
RPCSimHit::operator<
bool operator<(const RPCSimHit &rhs) const
Definition: RPCSimHit.h:65
RPCSimHit::setGlobalTime
void setGlobalTime(const double time)
Definition: RPCSimHit.h:78
RPCSimHit::m_localPosition
Amg::Vector3D m_localPosition
Definition: RPCSimHit.h:86
RPCSimHit::m_RPCid
int m_RPCid
Definition: RPCSimHit.h:84
RPCSimHit::meanTime
double meanTime() const
Definition: RPCSimHit.h:98
RPCSimHit::m_stepLength
float m_stepLength
Definition: RPCSimHit.h:90
RPCSimHit::m_localPostStepPosition
Amg::Vector3D m_localPostStepPosition
Definition: RPCSimHit.h:88
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
RPCSimHit::particleLink
const HepMcParticleLink & particleLink() const
Definition: RPCSimHit.h:101
RPCSimHit::postLocalPosition
const Amg::Vector3D & postLocalPosition() const
Definition: RPCSimHit.h:57
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
RPCSimHit::print
std::string print() const
Definition: RPCSimHit.cxx:96
RPCSimHit::m_particleEncoding
int m_particleEncoding
Definition: RPCSimHit.h:91
RPCSimHit::RPCid
int RPCid() const
Definition: RPCSimHit.h:63
RPCSimHit::prePostStepDistance
double prePostStepDistance() const
Definition: RPCSimHit.h:59
RPCSimHit
Definition: RPCSimHit.h:19
RPCSimHit::truthBarcode
int truthBarcode() const
Definition: RPCSimHit.cxx:117
RPCSimHit::RPCSimHit
RPCSimHit()
Definition: RPCSimHit.cxx:13
RPCSimHit::m_energyDeposit
float m_energyDeposit
Definition: RPCSimHit.h:89
RPCSimHit::kineticEnergy
double kineticEnergy() const
Definition: RPCSimHit.h:62