ATLAS Offline Software
LArHit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /* author : Johann Collot */
6 /* date of creation : 07/01/2001 */
7 /* date of last modification : 13/09/2002 CLID removed */
8 
9 // 03-Dec-2003 Bill Seligman: Substantially revised. This class no
10 // longer inherits from any base class.
11 
12 // 09-Dec-2006 RD Schaffer: moved energy to double for accumulation
13 // precision - float in persistent version
14 
15 #ifndef LArSimEvent_LArHit_h
16 #define LArSimEvent_LArHit_h
17 
18 #include "Identifier/Identifier.h"
19 #include "AthenaKernel/Units.h"
20 
21 class LArHit
22 
25 {
26 public:
27 
34  LArHit(Identifier l_cell, double l_energy, double l_time);
35 
39  LArHit();
40 
42  ~LArHit();
43 
45  Identifier cellID() const;
46 
48  double energy() const;
49 
53  double time() const;
54 
56  bool Less(LArHit* const& h) const;
57 
59  bool Equals(LArHit* const& h) const;
60 
63  void Add(LArHit* const& h);
64 
67  void finalize();
68 
69 
70 private:
71 
74 
76  double m_energy;
77 
79  double m_time;
80 
81 };
82 
83 
85 inline
86 LArHit::LArHit(Identifier l_cell, double l_energy, double l_time)
87  :
88  m_ID(l_cell),
89  m_energy(l_energy),
90  m_time( (l_time*l_energy) )
91 {}
92 
93 
94 inline
96  :
97  m_ID(Identifier()),
98  m_energy(0.),
99  m_time(0.)
100 {}
101 
102 inline
104 { }
105 
106 inline
109 { return m_ID; }
110 
111 inline
112 double
114 { return (double) m_energy; }
115 
116 inline
117 double
119 { return m_time; }
120 
121 inline
122 bool
123 LArHit::Less(LArHit* const& h) const
124 { return m_ID < h->m_ID; }
125 
126 inline
127 bool
128 LArHit::Equals(LArHit* const& h) const
129 { return m_ID == h->m_ID; }
130 
131 inline
132 void
134 {
135  m_energy += h->m_energy;
136  m_time += h->m_time;
137 }
138 
139 // The method to be called at the end of event by SD
140 // For backwards compatibility
141 inline
142 void
144 {
147 }
148 
149 #endif // LArSimEvent_LArHit_h
150 
LArHit::LArHit
LArHit()
Default constructor for persistency.
Definition: LArHit.h:95
LArHit::finalize
void finalize()
The method to be called at the end of event by SD.
Definition: LArHit.h:143
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
LArHit::energy
double energy() const
Definition: LArHit.h:113
LArHit::m_time
double m_time
time (in ns)
Definition: LArHit.h:79
LArHit::time
double time() const
Definition: LArHit.h:118
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
LArHit::cellID
Identifier cellID() const
Definition: LArHit.h:108
LArHit::Add
void Add(LArHit *const &h)
Add another hit ot this hit.
Definition: LArHit.h:133
LArHit
Class to store hit energy and time in LAr cell from G4 simulation.
Definition: LArHit.h:25
Units.h
Wrapper to avoid constant divisions when using units.
LArHit::Equals
bool Equals(LArHit *const &h) const
Operator Equals this.
Definition: LArHit.h:128
h
LArHit::m_ID
Identifier m_ID
identifier of the cell in which this hit occured.
Definition: LArHit.h:73
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
LArHit::m_energy
double m_energy
energy (in MeV) deposited in this hit
Definition: LArHit.h:76
LArHit::Less
bool Less(LArHit *const &h) const
Operator Less than this for hit ordering.
Definition: LArHit.h:123
LArHit::~LArHit
~LArHit()
Destructor.
Definition: LArHit.h:103
Identifier
Definition: IdentifierFieldParser.cxx:14