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