ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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. More...
 
 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. More...
 
 CaloCalibrationHit ()
 Default constructor; should never be used, but provided for some persistency services. More...
 
 CaloCalibrationHit (const CaloCalibrationHit &cchSource)
 Copy constructor. More...
 
CaloCalibrationHitoperator= (const CaloCalibrationHit &cchSource)
 Assignment operator. More...
 
virtual ~CaloCalibrationHit ()
 Destructor. More...
 
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. More...
 
bool Equals (const CaloCalibrationHit &h) const
 Calibration hits are ordered by values of their identifiers. More...
 
bool Equals (const CaloCalibrationHit *h) const
 Calibration hits are ordered by values of their identifiers. More...
 
void Add (const CaloCalibrationHit *h)
 Method used for energy accumulation. More...
 

Private Attributes

Identifier m_ID
 identifier of the cell in which this hit occured. More...
 
double m_energy0 {0.}
 energies (in MeV) deposited in this hit. More...
 
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 More...
 
int m_uniqueID {HepMC::UNDEFINED_ID}
 identifier of Primary Particle which caused this hit More...
 
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  {}

◆ 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),
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  }

◆ 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  };

◆ 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  }

◆ 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{
173  if (particleID() == HepMC::INVALID_PARTICLE_ID || h->particleUID() == HepMC::INVALID_PARTICLE_ID) {
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); }

◆ 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.

◆ m_energy1

double CaloCalibrationHit::m_energy1 {0.}
private

Definition at line 223 of file CaloCalibrationHit.h.

◆ m_energy2

double CaloCalibrationHit::m_energy2 {0.}
private

Definition at line 224 of file CaloCalibrationHit.h.

◆ m_energy3

double CaloCalibrationHit::m_energy3 {0.}
private

Definition at line 225 of file CaloCalibrationHit.h.

◆ 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.

◆ 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:
CaloCalibrationHit::m_ID
Identifier m_ID
identifier of the cell in which this hit occured.
Definition: CaloCalibrationHit.h:214
CaloCalibrationHit::Equals
bool Equals(const CaloCalibrationHit &h) const
Calibration hits are ordered by values of their identifiers.
Definition: CaloCalibrationHit.h:183
CaloCalibrationHit::m_energy2
double m_energy2
Definition: CaloCalibrationHit.h:224
CaloCalibrationHit::energyNonEM
double energyNonEM() const
Definition: CaloCalibrationHit.h:124
HepMC::INVALID_PARTICLE_ID
constexpr int INVALID_PARTICLE_ID
Definition: MagicNumbers.h:57
CaloCalibrationHit::m_partLink
std::unique_ptr< HepMcParticleLink > m_partLink
Definition: CaloCalibrationHit.h:231
CaloCalibrationHit::energyEM
double energyEM() const
Definition: CaloCalibrationHit.h:121
CxxUtils::fpcompare::equal
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:114
CaloCalibrationHit::m_energy3
double m_energy3
Definition: CaloCalibrationHit.h:225
CaloCalibrationHit::m_barcode
int m_barcode
legacy barcode of Primary Particle which caused this hit
Definition: CaloCalibrationHit.h:228
lumiFormat.i
int i
Definition: lumiFormat.py:85
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
CaloCalibrationHit::energyInvisible
double energyInvisible() const
Definition: CaloCalibrationHit.h:127
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:56
CaloCalibrationHit::m_energy1
double m_energy1
Definition: CaloCalibrationHit.h:223
CaloCalibrationHit::particleUID
int particleUID() const
Definition: CaloCalibrationHit.h:162
h
CaloCalibrationHit::energy
double energy(unsigned int i) const
Definition: CaloCalibrationHit.h:143
CaloCalibrationHit::m_uniqueID
int m_uniqueID
identifier of Primary Particle which caused this hit
Definition: CaloCalibrationHit.h:230
CaloCalibrationHit::m_energy0
double m_energy0
energies (in MeV) deposited in this hit.
Definition: CaloCalibrationHit.h:222
CaloCalibrationHit::barcode
int barcode() const
Definition: CaloCalibrationHit.h:159
CaloCalibrationHit::energyEscaped
double energyEscaped() const
Definition: CaloCalibrationHit.h:130
CaloCalibrationHit::particleID
int particleID() const
Definition: CaloCalibrationHit.h:156
Identifier
Definition: IdentifierFieldParser.cxx:14