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 33 of file CaloCalibrationHit.h.

37 :
38 m_ID(id),
43 {}
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 53 of file CaloCalibrationHit.h.

59 :
60 m_ID(id),
66 m_uniqueID(uniqueID)
67 {
68 if (m_barcode == HepMC::UNDEFINED_ID) { m_uniqueID = HepMC::UNDEFINED_ID; } // No link to a truth particle
70 m_partLink = std::make_unique<HepMcParticleLink>(m_barcode, 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); // FIXME is barcode-based
71 }
72 }
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 76 of file CaloCalibrationHit.h.

76 :
77 m_ID(Identifier())
78 {}

◆ CaloCalibrationHit() [4/4]

CaloCalibrationHit::CaloCalibrationHit ( const CaloCalibrationHit & cchSource)
inline

Copy constructor.

Definition at line 81 of file CaloCalibrationHit.h.

82 : m_ID (cchSource.m_ID),
83 m_energy0 (cchSource.m_energy0),
84 m_energy1 (cchSource.m_energy1),
85 m_energy2 (cchSource.m_energy2),
86 m_energy3 (cchSource.m_energy3),
87 m_barcode (cchSource.m_barcode),
88 m_uniqueID(cchSource.m_uniqueID)
89 {
90 if (m_barcode == HepMC::UNDEFINED_ID) { m_uniqueID = HepMC::UNDEFINED_ID; } // No link to a truth particle
92 m_uniqueID = cchSource.particleUID(); // Try a look-up via HepMcParticleLink
93 }
94 }

◆ ~CaloCalibrationHit()

virtual CaloCalibrationHit::~CaloCalibrationHit ( )
inlinevirtual

Destructor.

Definition at line 115 of file CaloCalibrationHit.h.

115{}

Member Function Documentation

◆ Add()

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

Method used for energy accumulation.

Definition at line 203 of file CaloCalibrationHit.h.

204 {
205 m_energy0 += h->m_energy0;
206 m_energy1 += h->m_energy1;
207 m_energy2 += h->m_energy2;
208 m_energy3 += h->m_energy3;
209 }

◆ barcode()

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

Definition at line 159 of file CaloCalibrationHit.h.

159{ return particleID(); }

◆ cellID()

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

Definition at line 118 of file CaloCalibrationHit.h.

118{ 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 143 of file CaloCalibrationHit.h.

144 {
145 switch (i)
146 {
147 case 0: return m_energy0;
148 case 1: return m_energy1;
149 case 2: return m_energy2;
150 case 3: return m_energy3;
151 default: return 0.;
152 }
153 }

◆ energyEM()

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

Definition at line 121 of file CaloCalibrationHit.h.

121{ return m_energy0; }

◆ energyEscaped()

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

Definition at line 130 of file CaloCalibrationHit.h.

130{ return m_energy3; }

◆ energyInvisible()

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

Definition at line 127 of file CaloCalibrationHit.h.

127{ return m_energy2; }

◆ energyNonEM()

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

Definition at line 124 of file CaloCalibrationHit.h.

124{ return m_energy1; }

◆ energyTotal()

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

Definition at line 133 of file CaloCalibrationHit.h.

134 {
135 return
136 m_energy0 +
137 m_energy1 +
138 m_energy2 +
139 m_energy3;
140 }

◆ Equals() [1/2]

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

Calibration hits are ordered by values of their identifiers.

Definition at line 183 of file CaloCalibrationHit.h.

183 {
184 bool equal = (m_ID == h.m_ID);
185 const bool validBarcode(particleID() != HepMC::INVALID_PARTICLE_ID && h.particleID() != HepMC::INVALID_PARTICLE_ID);
186 const bool validUID(particleUID() != HepMC::INVALID_PARTICLE_ID && h.particleUID() != HepMC::INVALID_PARTICLE_ID);
187 equal &= (validBarcode || validUID);
188 if ( validBarcode ) {
189 equal &= (m_barcode == h.m_barcode);
190 }
191 if ( validBarcode ) {
192 equal &= (particleUID() == h.particleUID());
193 }
194 return equal;
195 };
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 198 of file CaloCalibrationHit.h.

198 {
199 return Equals (*h);
200 }
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 168 of file CaloCalibrationHit.h.

169 {
170 if(m_ID != h->m_ID){
171 return m_ID < h->m_ID;
172 }else{
174 return m_barcode < h->m_barcode;
175 }
176 else {
177 return particleUID() < h->particleUID();
178 }
179 }
180 }

◆ operator()()

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

Definition at line 165 of file CaloCalibrationHit.h.

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

◆ operator=()

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

Assignment operator.

Definition at line 97 of file CaloCalibrationHit.h.

98 {
99 if (this == &cchSource) return *this;
100 m_ID = cchSource.m_ID;
101 m_energy0 = cchSource.m_energy0;
102 m_energy1 = cchSource.m_energy1;
103 m_energy2 = cchSource.m_energy2;
104 m_energy3 = cchSource.m_energy3;
105 m_barcode = cchSource.m_barcode;
106 m_uniqueID = cchSource.m_uniqueID;
107 if (m_barcode == HepMC::UNDEFINED_ID) { m_uniqueID = HepMC::UNDEFINED_ID; } // No link to a truth particle
109 m_uniqueID = cchSource.particleUID(); // Try a look-up via HepMcParticleLink
110 }
111 return *this;
112 }

◆ particleID()

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

Definition at line 156 of file CaloCalibrationHit.h.

156{ return m_barcode; }

◆ particleUID()

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

Definition at line 162 of file CaloCalibrationHit.h.

162{ if (m_uniqueID == HepMC::INVALID_PARTICLE_ID && m_partLink) { return m_partLink->id(); } else { return m_uniqueID;} }

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 228 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 222 of file CaloCalibrationHit.h.

222{0.};

◆ m_energy1

double CaloCalibrationHit::m_energy1 {0.}
private

Definition at line 223 of file CaloCalibrationHit.h.

223{0.};

◆ m_energy2

double CaloCalibrationHit::m_energy2 {0.}
private

Definition at line 224 of file CaloCalibrationHit.h.

224{0.};

◆ m_energy3

double CaloCalibrationHit::m_energy3 {0.}
private

Definition at line 225 of file CaloCalibrationHit.h.

225{0.};

◆ m_ID

Identifier CaloCalibrationHit::m_ID
private

identifier of the cell in which this hit occured.

Definition at line 214 of file CaloCalibrationHit.h.

◆ m_partLink

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

Definition at line 231 of file CaloCalibrationHit.h.

231{}; // nullptr unless object was produced by reading TrackRecord_p1.

◆ m_uniqueID

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

identifier of Primary Particle which caused this hit

Definition at line 230 of file CaloCalibrationHit.h.


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