ATLAS Offline Software
CaloCell.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // base class for Calorimeter Cells
6 #include "CaloEvent/CaloCell.h"
7 #include "CLHEP/Geometry/Vector3D.h"
8 #include "CLHEP/Geometry/Point3D.h"
9 #include "CaloDetDescr/CaloDetDescrElement.h"
10 #include "AthenaKernel/BaseInfo.h"
11 #include <cmath>
12 
14 {
15 // destructor
16 }
17 
18 
20  float energy,
21  float time,
22  double quality,
24  :
25  m_energy(energy),
26  m_time(time),
27  m_quality((int)(quality)),
28  m_ID(caloDDE ? caloDDE->identify() : Identifier()),
29  m_gain(gain),
30  m_caloDDE(caloDDE)
31 {}
32 
33 // cppcheck-suppress uninitMemberVar ; m_quality
35  float energy,
36  float time,
38  uint16_t provenance,
40  :
41  m_energy(energy),
42  m_time(time),
43  m_ID(caloDDE ? caloDDE->identify() : Identifier()),
44  m_gain(gain),
45  m_caloDDE(caloDDE)
46 {
48  // cppcheck-suppress objectIndex
50 }
51 
52 
54  const Identifier & ID,
55  float energy,
56  float time,
57  double quality,
59  :
60  m_energy(energy),
61  m_time(time),
62  m_quality((int)(quality)),
63  m_ID(ID),
64  m_gain(gain),
65  m_caloDDE(caloDDE)
66 {}
67 
68 // cppcheck-suppress uninitMemberVar ; m_quality
70  const Identifier & ID,
71  float energy,
72  float time,
74  uint16_t provenance,
76  :
77  m_energy(energy),
78  m_time(time),
79  m_ID(ID),
80  m_gain(gain),
81  m_caloDDE(caloDDE)
82 {
84  // cppcheck-suppress objectIndex
86 }
87 
88 
89 void CaloCell::set (float energy,
90  float time,
92  uint16_t provenance,
94 {
95  m_energy = energy;
96  m_time = time;
97  m_gain = gain;
99  // cppcheck-suppress objectIndex
101 }
102 
103 
104 void CaloCell::set (float energy,
105  float time,
106  double quality,
108 {
109  m_energy = energy;
110  m_time = time;
111  m_quality = (int)(quality);
112  m_gain = gain;
113 }
114 
115 void CaloCell::set4Mom (const I4Momentum * const )
116 {
117  std::cout << " FATAL ERROR : CaloCell::set4Mom called. Cannot change 4mom " << std::endl ;
118  std::abort();
119 }
120 
122 {
123  std::cout << " FATAL ERROR : CaloCell::set4Mom called. Cannot change 4mom " << std::endl ;
124  std::abort();
125 }
126 
127 void CaloCell::set4Mom (const CLHEP::HepLorentzVector & )
128 {
129  std::cout << " FATAL ERROR : CaloCell::set4Mom called. Cannot change 4mom " << std::endl ;
130  std::abort();
131 }
132 
133 
134 std::unique_ptr<CaloCell> CaloCell::clone() const
135 {
136  return std::make_unique<CaloCell>(this->caloDDE(),
137  this->energy(),
138  this->time(),
139  this->quality(),
140  this->provenance(),
141  this->gain() );
142 }
143 
144 bool CaloCell::badcell() const
145 {
146  // actual correct implementation is in LArCell and TileCell
147  return false;
148 }
149 
150 
xAOD::identify
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:95
I4Momentum
Definition: I4Momentum.h:31
CaloCell::set
void set(const CaloDetDescrElement *caloDDE, const Identifier &ID)
Fast method to change the identity of a cell.
Definition: CaloCell.h:511
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
SG_ADD_BASE
SG_ADD_BASE(CaloCell, INavigable4Momentum)
CaloCell::set4Mom
virtual void set4Mom(const I4Momentum *const theI4Mom) override final
set 4Momentum (will throw exception since cannot be implemented)
Definition: CaloCell.cxx:115
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CaloCell.h
CaloCell::provenance
uint16_t provenance() const
get provenance (data member)
Definition: CaloCell.h:354
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:368
CaloCell::clone
virtual std::unique_ptr< CaloCell > clone() const
clone a CaloCell
Definition: CaloCell.cxx:134
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:327
CaloCell::m_quality
int m_quality
Definition: CaloCell.h:245
CaloCell::CaloCell
CaloCell()
default constructor (should not be used, only there for persistency reason)
Definition: CaloCell.h:263
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
BaseInfo.h
Provide an interface for finding inheritance information at run time.
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:321
CaloCell::m_qualProv
uint16_t m_qualProv[2]
Definition: CaloCell.h:246
CaloCell::m_gain
CaloGain::CaloGain m_gain
gain
Definition: CaloCell.h:253
CaloCell::m_energy
float m_energy
energy (in MeV)
Definition: CaloCell.h:230
CaloCell::badcell
virtual bool badcell() const
check is cell is dead
Definition: CaloCell.cxx:144
CaloCell::quality
uint16_t quality() const
get quality (data member)
Definition: CaloCell.h:348
CaloCell::~CaloCell
virtual ~CaloCell()
default destructor
Definition: CaloCell.cxx:13
CaloCell::gain
CaloGain::CaloGain gain() const
get gain (data member )
Definition: CaloCell.h:361
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCell::m_time
float m_time
time
Definition: CaloCell.h:232
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
INavigable4Momentum
Definition: INavigable4Momentum.h:21
python.TrackLeptonConfig.quality
quality
Definition: TrackLeptonConfig.py:16
Identifier
Definition: IdentifierFieldParser.cxx:14