ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCalibrationHit Class Reference

Class to store calorimeter calibration hit. More...

#include <CaloCalibrationHit.h>

Collaboration diagram for CaloCalibrationHit:

Public Member Functions

 CaloCalibrationHit (Identifier id, double energyEM, double energyNonEM, double energyInvisible, double energyEscaped)
 Standard constructor using identifer and energy by type.
 CaloCalibrationHit (Identifier id, double energyEM, double energyNonEM, double energyInvisible, double energyEscaped, int barcode, int uniqueID=HepMC::INVALID_PARTICLE_ID)
 Standard constructor using identifer, energy by type and primary particle ID.
 CaloCalibrationHit ()
 Default constructor; should never be used, but provided for some persistency services.
 CaloCalibrationHit (const CaloCalibrationHit &cchSource)
 Copy constructor.
CaloCalibrationHitoperator= (const CaloCalibrationHit &cchSource)
 Assignment operator.
virtual ~CaloCalibrationHit ()
 Destructor.
Identifier cellID () const
double energyEM () const
double energyNonEM () const
double energyInvisible () const
double energyEscaped () const
double energyTotal () const
double energy (unsigned int i) const
int particleID () const
int barcode () const
int particleUID () const
double operator() (unsigned int i) const
bool Less (const CaloCalibrationHit *h) const
 Calibration hits are ordered by values of their identifiers.
bool Equals (const CaloCalibrationHit &h) const
 Calibration hits are ordered by values of their identifiers.
bool Equals (const CaloCalibrationHit *h) const
 Calibration hits are ordered by values of their identifiers.
void Add (const CaloCalibrationHit *h)
 Method used for energy accumulation.

Private Attributes

Identifier m_ID
 identifier of the cell in which this hit occured.
double m_energy0 {0.}
 energies (in MeV) deposited in this hit.
double m_energy1 {0.}
double m_energy2 {0.}
double m_energy3 {0.}
int m_barcode {HepMC::UNDEFINED_ID}
 legacy barcode of Primary Particle which caused this hit
int m_uniqueID {HepMC::UNDEFINED_ID}
 identifier of Primary Particle which caused this hit
std::unique_ptr< HepMcParticleLinkm_partLink {}

Detailed Description

Class to store calorimeter calibration hit.


A calibration hit stores for active, inactive and dead material elements the energy loss according to the process (EM energy loss, non EM energy loss, Invisible energy and Escaped energy)

Definition at line 18 of file CaloCalibrationHit.h.

Constructor & Destructor Documentation

◆ CaloCalibrationHit() [1/4]

CaloCalibrationHit::CaloCalibrationHit ( Identifier id,
double energyEM,
double energyNonEM,
double energyInvisible,
double energyEscaped )
inline

Standard constructor using identifer and energy by type.

Parameters
[in]idCell identifier (calorimeter cell or dead material identifier)
[in]energyEMenergy loss by EM processes
[in]energyNonEMvisible energy loss by non EM processes (pion dEdx for instance)
[in]energyInvisibleinvisible energy loss (usually nuclear binding energy)
[in]energyEscapedenergy which escaped from this cell because of production of neutrino (or escaping muon energy)

Definition at line 37 of file CaloCalibrationHit.h.

39 : m_ID(id),
double m_energy0
energies (in MeV) deposited in this hit.
double energyNonEM() const
double energyEscaped() const
double energyInvisible() const
Identifier m_ID
identifier of the cell in which this hit occured.

◆ CaloCalibrationHit() [2/4]

CaloCalibrationHit::CaloCalibrationHit ( Identifier id,
double energyEM,
double energyNonEM,
double energyInvisible,
double energyEscaped,
int barcode,
int uniqueID = HepMC::INVALID_PARTICLE_ID )
inline

Standard constructor using identifer, energy by type and primary particle ID.

Parameters
[in]idCell identifier (calorimeter cell or dead material identifier)
[in]energyEMenergy loss by EM processes
[in]energyNonEMvisible energy loss by non EM processes (pion dEdx for instance)
[in]energyInvisibleinvisible energy loss (usually nuclear binding energy)
[in]energyEscapedenergy which escaped from this cell because of production of neutrino (or escaping muon energy)
[in]particleIDbarcode of primary particle which caused given hit

Definition at line 58 of file CaloCalibrationHit.h.

61 : m_ID(id),
67 m_uniqueID(uniqueID) {
70 } // No link to a truth particle
73 m_partLink = std::make_unique<HepMcParticleLink>(
75 HepMcParticleLink::IS_BARCODE); // FIXME is barcode-based
76 }
77 }
int m_uniqueID
identifier of Primary Particle which caused this hit
std::unique_ptr< HepMcParticleLink > m_partLink
int m_barcode
legacy barcode of Primary Particle which caused this hit
constexpr int INVALID_PARTICLE_ID
constexpr int UNDEFINED_ID

◆ CaloCalibrationHit() [3/4]

CaloCalibrationHit::CaloCalibrationHit ( )
inline

Default constructor; should never be used, but provided for some persistency services.

Definition at line 81 of file CaloCalibrationHit.h.

81: m_ID(Identifier()) {}

◆ CaloCalibrationHit() [4/4]

CaloCalibrationHit::CaloCalibrationHit ( const CaloCalibrationHit & cchSource)
inline

Copy constructor.

Definition at line 84 of file CaloCalibrationHit.h.

85 : m_ID(cchSource.m_ID),
86 m_energy0(cchSource.m_energy0),
87 m_energy1(cchSource.m_energy1),
88 m_energy2(cchSource.m_energy2),
89 m_energy3(cchSource.m_energy3),
90 m_barcode(cchSource.m_barcode),
91 m_uniqueID(cchSource.m_uniqueID) {
94 } // No link to a truth particle
98 cchSource.particleUID(); // Try a look-up via HepMcParticleLink
99 }
100 }

◆ ~CaloCalibrationHit()

virtual CaloCalibrationHit::~CaloCalibrationHit ( )
inlinevirtual

Destructor.

Definition at line 125 of file CaloCalibrationHit.h.

125{}

Member Function Documentation

◆ Add()

void CaloCalibrationHit::Add ( const CaloCalibrationHit * h)
inline

Method used for energy accumulation.

Definition at line 218 of file CaloCalibrationHit.h.

218 {
219 m_energy0 += h->m_energy0;
220 m_energy1 += h->m_energy1;
221 m_energy2 += h->m_energy2;
222 m_energy3 += h->m_energy3;
223 }

◆ barcode()

int CaloCalibrationHit::barcode ( ) const
inline
Returns
primary particle identifier (barcode) which caused this hit (alias for helper functions)

Definition at line 168 of file CaloCalibrationHit.h.

168{ return particleID(); }

◆ cellID()

Identifier CaloCalibrationHit::cellID ( ) const
inline
Returns
cell identifier of this hit

Definition at line 128 of file CaloCalibrationHit.h.

128{ return m_ID; }

◆ energy()

double CaloCalibrationHit::energy ( unsigned int i) const
inline
Returns
energy deposits by specifying input type. Units are MeV.

Definition at line 148 of file CaloCalibrationHit.h.

148 {
149 switch (i) {
150 case 0:
151 return m_energy0;
152 case 1:
153 return m_energy1;
154 case 2:
155 return m_energy2;
156 case 3:
157 return m_energy3;
158 default:
159 return 0.;
160 }
161 }

◆ energyEM()

double CaloCalibrationHit::energyEM ( ) const
inline
Returns
EM energy deposits. Units are MeV.

Definition at line 131 of file CaloCalibrationHit.h.

131{ return m_energy0; }

◆ energyEscaped()

double CaloCalibrationHit::energyEscaped ( ) const
inline
Returns
escaped energy. Units are MeV.

Definition at line 140 of file CaloCalibrationHit.h.

140{ return m_energy3; }

◆ energyInvisible()

double CaloCalibrationHit::energyInvisible ( ) const
inline
Returns
invisible energy. Units are MeV.

Definition at line 137 of file CaloCalibrationHit.h.

137{ return m_energy2; }

◆ energyNonEM()

double CaloCalibrationHit::energyNonEM ( ) const
inline
Returns
NonEM energy deposits. Units are MeV.

Definition at line 134 of file CaloCalibrationHit.h.

134{ return m_energy1; }

◆ energyTotal()

double CaloCalibrationHit::energyTotal ( ) const
inline
Returns
total energy deposits. Units are MeV.

Definition at line 143 of file CaloCalibrationHit.h.

143 {
145 }

◆ Equals() [1/2]

bool CaloCalibrationHit::Equals ( const CaloCalibrationHit & h) const
inline

Calibration hits are ordered by values of their identifiers.

Definition at line 197 of file CaloCalibrationHit.h.

197 {
198 bool equal = (m_ID == h.m_ID);
199 const bool validBarcode(particleID() != HepMC::INVALID_PARTICLE_ID &&
200 h.particleID() != HepMC::INVALID_PARTICLE_ID);
201 const bool validUID(particleUID() != HepMC::INVALID_PARTICLE_ID &&
202 h.particleUID() != HepMC::INVALID_PARTICLE_ID);
203 equal &= (validBarcode || validUID);
204 if (validBarcode) {
205 equal &= (m_barcode == h.m_barcode);
206 }
207 // Corrected bug: was comparing m_barcode instead of m_uniqueID
208 if (validUID) {
209 equal &= (particleUID() == h.particleUID());
210 }
211 return equal;
212 };
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition fpcompare.h:114

◆ Equals() [2/2]

bool CaloCalibrationHit::Equals ( const CaloCalibrationHit * h) const
inline

Calibration hits are ordered by values of their identifiers.

Definition at line 215 of file CaloCalibrationHit.h.

215{ return Equals(*h); }
bool Equals(const CaloCalibrationHit &h) const
Calibration hits are ordered by values of their identifiers.

◆ Less()

bool CaloCalibrationHit::Less ( const CaloCalibrationHit * h) const
inline

Calibration hits are ordered by values of their identifiers.

Definition at line 183 of file CaloCalibrationHit.h.

183 {
184 if (m_ID != h->m_ID) {
185 return m_ID < h->m_ID;
186 } else {
188 h->particleUID() == HepMC::INVALID_PARTICLE_ID) {
189 return m_barcode < h->m_barcode;
190 } else {
191 return particleUID() < h->particleUID();
192 }
193 }
194 }

◆ operator()()

double CaloCalibrationHit::operator() ( unsigned int i) const
inline
Returns
energy deposits by specifying input type, same as above method

Definition at line 180 of file CaloCalibrationHit.h.

180{ return energy(i); }
double energy(unsigned int i) const

◆ operator=()

CaloCalibrationHit & CaloCalibrationHit::operator= ( const CaloCalibrationHit & cchSource)
inline

Assignment operator.

Definition at line 103 of file CaloCalibrationHit.h.

103 {
104 if (this == &cchSource)
105 return *this;
106 m_ID = cchSource.m_ID;
107 m_energy0 = cchSource.m_energy0;
108 m_energy1 = cchSource.m_energy1;
109 m_energy2 = cchSource.m_energy2;
110 m_energy3 = cchSource.m_energy3;
111 m_barcode = cchSource.m_barcode;
112 m_uniqueID = cchSource.m_uniqueID;
115 } // No link to a truth particle
118 m_uniqueID =
119 cchSource.particleUID(); // Try a look-up via HepMcParticleLink
120 }
121 return *this;
122 }

◆ particleID()

int CaloCalibrationHit::particleID ( ) const
inline
Returns
primary particle identifier (barcode) which caused this hit

Definition at line 164 of file CaloCalibrationHit.h.

164{ return m_barcode; }

◆ particleUID()

int CaloCalibrationHit::particleUID ( ) const
inline
Returns
primary particle identifier (id) which caused this hit

Definition at line 171 of file CaloCalibrationHit.h.

171 {
173 return m_partLink->id();
174 } else {
175 return m_uniqueID;
176 }
177 }

Member Data Documentation

◆ m_barcode

int CaloCalibrationHit::m_barcode {HepMC::UNDEFINED_ID}
private

legacy barcode of Primary Particle which caused this hit

Definition at line 241 of file CaloCalibrationHit.h.

◆ m_energy0

double CaloCalibrationHit::m_energy0 {0.}
private

energies (in MeV) deposited in this hit.

In order, they represent: EM energy deposited non-EM energy deposited "invisible" energy deposited escaped energy Energies are accumulated in double precision and stored as floats

Definition at line 235 of file CaloCalibrationHit.h.

235{0.};

◆ m_energy1

double CaloCalibrationHit::m_energy1 {0.}
private

Definition at line 236 of file CaloCalibrationHit.h.

236{0.};

◆ m_energy2

double CaloCalibrationHit::m_energy2 {0.}
private

Definition at line 237 of file CaloCalibrationHit.h.

237{0.};

◆ m_energy3

double CaloCalibrationHit::m_energy3 {0.}
private

Definition at line 238 of file CaloCalibrationHit.h.

238{0.};

◆ m_ID

Identifier CaloCalibrationHit::m_ID
private

identifier of the cell in which this hit occured.

Definition at line 227 of file CaloCalibrationHit.h.

◆ m_partLink

std::unique_ptr<HepMcParticleLink> CaloCalibrationHit::m_partLink {}
private

Definition at line 245 of file CaloCalibrationHit.h.

245{}; // nullptr unless object was produced by reading

◆ m_uniqueID

int CaloCalibrationHit::m_uniqueID {HepMC::UNDEFINED_ID}
private

identifier of Primary Particle which caused this hit

Definition at line 243 of file CaloCalibrationHit.h.


The documentation for this class was generated from the following file: