|
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 118 of file CaloTopoClusterFromTowerHelpers.cxx.
121 if ( pClus ==
nullptr ) {
return false; }
125 if ( clk ==
nullptr || clk->
size() == 0 ) {
return false; }
128 CaloClusterSignalAccumulator accum;
131 auto citer(clk->
begin());
132 while ( citer != clk->
end() && retflg ) {
133 if ( *citer !=
nullptr ) { retflg =
cellAccumulator(**citer,accum,citer.weight(),onlyKine); } ++citer; }
134 if ( !retflg ) {
return false; }
137 pClus->
setE(accum.cluster.accumE);
141 if ( accum.cluster.accumAbsE != 0. ) {
142 double invPosNorm(1./accum.cluster.accumAbsE);
143 pClus->
setEta(accum.cluster.accumEta*invPosNorm);
151 if ( onlyKine ) {
return true; }
154 if ( accum.cluster.accumTimeNorm != 0. ) {
155 pClus->
setTime(accum.cluster.accumTime/accum.cluster.accumTimeNorm);
163 if ( accum.sampling.presenceInSample[
i] ) { samplingPattern |= (0x1U<<
i); }
172 if ( accum.sampling.presenceInSample[
i] ) {
174 pClus->
setEnergy(sam,accum.sampling.energyInSample[
i]);
175 double enorm(accum.sampling.posNormInSample[
i]);
176 double eta(accum.sampling.etaInSample[
i]);
177 double phi(accum.sampling.phiInSample[
i]);
185 pClus->
setEmax(sam,accum.sampling.maxEnergyInSample[
i]);
186 pClus->
setEtamax(sam,accum.sampling.etaMaxEnergyInSample[
i]);
187 pClus->
setPhimax(sam,accum.sampling.phiMaxEnergyInSample[
i]);
◆ cellAccumulator()
Definition at line 23 of file CaloTopoClusterFromTowerHelpers.cxx.
33 accum.cluster.cellWeight =
weight;
34 accum.cluster.cellAbsWeight = std::fabs(accum.cluster.cellWeight);
35 accum.cluster.cellE = accum.cluster.cellWeight*rcell.
e();
36 accum.cluster.cellAbsE = accum.cluster.cellAbsWeight*std::fabs(rcell.
e());
38 double celleta(dde->
eta());
39 double cellphi(dde->
phi());
41 accum.cluster.accumE += accum.cluster.cellE;
42 accum.cluster.accumAbsE += accum.cluster.cellAbsE;
43 if ( accum.cluster.firstCell ) {
44 accum.cluster.phiSeed = cellphi; accum.cluster.firstCell =
false;
46 cellphi =
proxim(cellphi,accum.cluster.phiSeed);
48 accum.cluster.accumPhi += accum.cluster.cellAbsE*cellphi;
49 accum.cluster.accumEta += accum.cluster.cellAbsE*celleta;
51 if ( onlyKine )
return true;
61 if ( isam < 0 || isam >= fsam ) {
return false; }
64 accum.sampling.presenceInSample[isam] =
true;
67 accum.sampling.energyInSample[isam] += accum.cluster.cellE;
68 accum.sampling.posNormInSample[isam] += accum.cluster.cellAbsE;
69 accum.sampling.etaInSample[isam] += accum.cluster.cellAbsE*celleta;
70 accum.sampling.phiInSample[isam] += accum.cluster.cellAbsE*cellphi;
73 if ( accum.cluster.cellE > accum.sampling.maxEnergyInSample[isam] ) {
74 accum.sampling.maxEnergyInSample[isam] = accum.cluster.cellE;
75 accum.sampling.etaMaxEnergyInSample[isam] = celleta;
76 accum.sampling.phiMaxEnergyInSample[isam] = cellphi;
80 if ( accum.cluster.cellE != 0. && accum.cluster.cellWeight != 0. ) {
93 case CaloSampling::MINIFCAL0:
94 case CaloSampling::MINIFCAL1:
95 case CaloSampling::MINIFCAL2:
96 case CaloSampling::MINIFCAL3:
97 accum.cluster.nEndcap++;
100 accum.cluster.nBarrel++;
106 unsigned int pmask = dde->
is_tile() ? 0x8080 : 0x2000;
109 double tnorm(accum.cluster.cellAbsE*accum.cluster.cellWeight*rcell.
e());
110 accum.cluster.accumTime += tnorm*rcell.
time();
111 accum.cluster.accumTimeNorm += tnorm;
◆ fmtMsg()
std::string CaloRec::Helpers::fmtMsg |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
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.