 |
ATLAS Offline Software
|
◆ boolarray_t
◆ valarray_t
◆ calculateKine()
bool CaloRec::Helpers::calculateKine |
( |
xAOD::CaloCluster * |
pClus, |
|
|
bool |
onlyKine = false |
|
) |
| |
Kinematic updates.
This function updates the kinematics of a cluster e.g. after calibration
- Parameters
-
pClus | pointer to modifiable cluster object |
onlyKine | update only global cluster kinematics when true , else update all cluster variables |
Definition at line 119 of file CaloTopoClusterFromTowerHelpers.cxx.
125 if ( pClus ==
nullptr ) {
return false; }
129 if ( clk ==
nullptr || clk->
size() == 0 ) {
return false; }
132 CaloClusterSignalAccumulator accum;
135 auto citer(clk->
begin());
136 while ( citer != clk->
end() && retflg ) {
137 if ( *citer !=
nullptr ) { retflg =
cellAccumulator(**citer,accum,citer.weight(),onlyKine); } ++citer; }
138 if ( !retflg ) {
return false; }
141 pClus->
setE(accum.cluster.accumE);
145 if ( accum.cluster.accumAbsE != 0. ) {
146 double invPosNorm(1./accum.cluster.accumAbsE);
147 pClus->
setEta(accum.cluster.accumEta*invPosNorm);
155 if ( onlyKine ) {
return true; }
158 if ( accum.cluster.accumTimeNorm != 0. ) {
159 pClus->
setTime(accum.cluster.accumTime/accum.cluster.accumTimeNorm);
167 if ( accum.sampling.presenceInSample[
i] ) { samplingPattern |= (0x1U<<
i); }
176 if ( accum.sampling.presenceInSample[
i] ) {
178 pClus->
setEnergy(sam,accum.sampling.energyInSample[
i]);
179 double enorm(accum.sampling.posNormInSample[
i]);
180 double eta(accum.sampling.etaInSample[
i]);
181 double phi(accum.sampling.phiInSample[
i]);
189 pClus->
setEmax(sam,accum.sampling.maxEnergyInSample[
i]);
190 pClus->
setEtamax(sam,accum.sampling.etaMaxEnergyInSample[
i]);
191 pClus->
setPhimax(sam,accum.sampling.phiMaxEnergyInSample[
i]);
◆ cellAccumulator()
Definition at line 24 of file CaloTopoClusterFromTowerHelpers.cxx.
34 accum.cluster.cellWeight =
weight;
35 accum.cluster.cellAbsWeight = std::fabs(accum.cluster.cellWeight);
36 accum.cluster.cellE = accum.cluster.cellWeight*rcell.
e();
37 accum.cluster.cellAbsE = accum.cluster.cellAbsWeight*std::fabs(rcell.
e());
39 double celleta(dde->
eta());
40 double cellphi(dde->
phi());
42 accum.cluster.accumE += accum.cluster.cellE;
43 accum.cluster.accumAbsE += accum.cluster.cellAbsE;
44 if ( accum.cluster.firstCell ) {
45 accum.cluster.phiSeed = cellphi; accum.cluster.firstCell =
false;
47 cellphi =
proxim(cellphi,accum.cluster.phiSeed);
49 accum.cluster.accumPhi += accum.cluster.cellAbsE*cellphi;
50 accum.cluster.accumEta += accum.cluster.cellAbsE*celleta;
52 if ( onlyKine )
return true;
62 if ( isam < 0 || isam >= fsam ) {
return false; }
65 accum.sampling.presenceInSample[isam] =
true;
68 accum.sampling.energyInSample[isam] += accum.cluster.cellE;
69 accum.sampling.posNormInSample[isam] += accum.cluster.cellAbsE;
70 accum.sampling.etaInSample[isam] += accum.cluster.cellAbsE*celleta;
71 accum.sampling.phiInSample[isam] += accum.cluster.cellAbsE*cellphi;
74 if ( accum.cluster.cellE > accum.sampling.maxEnergyInSample[isam] ) {
75 accum.sampling.maxEnergyInSample[isam] = accum.cluster.cellE;
76 accum.sampling.etaMaxEnergyInSample[isam] = celleta;
77 accum.sampling.phiMaxEnergyInSample[isam] = cellphi;
81 if ( accum.cluster.cellE != 0. && accum.cluster.cellWeight != 0. ) {
94 case CaloSampling::MINIFCAL0:
95 case CaloSampling::MINIFCAL1:
96 case CaloSampling::MINIFCAL2:
97 case CaloSampling::MINIFCAL3:
98 accum.cluster.nEndcap++;
101 accum.cluster.nBarrel++;
107 unsigned int pmask = dde->
is_tile() ? 0x8080 : 0x2000;
110 double tnorm(accum.cluster.cellAbsE*accum.cluster.cellWeight*rcell.
e());
111 accum.cluster.accumTime += tnorm*rcell.
time();
112 accum.cluster.accumTimeNorm += tnorm;
◆ fmtMsg()
std::string CaloRec::Helpers::fmtMsg |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
#define CXXUTILS_TRAPPING_FP
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
void clearSamplingData()
Clear the sampling data.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
double proxim(double b, double a)
const_iterator begin() const
const begin method
virtual double e() const override final
get energy (data member) (synonym to method energy()
void setSamplingPattern(const unsigned sp, const bool clearSamplingVars=false)
Set sampling pattern (one bit per sampling.
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
uint16_t provenance() const
get provenance (data member)
float time() const
get time (data member)
void setTime(flt_t)
Set cluster time.
bool setEmax(const CaloSample sampling, const float eMax)
Set the Energy of the cell with the highest energy in a particular sampling.
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
bool setPhimax(const CaloSample sampling, const float phiMax)
Set the phi of the cell with the highest energy in a particular sampling.
bool cellAccumulator(const CaloCell &rcell, CaloClusterSignalAccumulator &accum, double weight, bool onlyKine=false)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
static double fix(double phi)
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
bool is_tile() const
cell belongs to Tile
size_t size() const
size method
const_iterator end() const
const end method
CaloCell_ID::CaloSample getSampling() const
cell sampling
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool setEtamax(const CaloSample sampling, const float etaMax)
Set the eta of the cell with the highest energy in a particular sampling.
float eta() const
cell eta
float phi() const
cell phi
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
unsigned samplingPattern() const
Access to sampling pattern (one bit per sampling) (Method may be removed later)
void setM(flt_t)
Set Mass for the current signal state.