|
ATLAS Offline Software
|
Go to the documentation of this file.
32 #include "CaloEvent/CaloCluster.h"
74 unsigned int varTypePattern,
75 unsigned int clusterSize)
78 m_dataStore(varTypePattern),
79 m_ownDataStore(false),
86 m_clusterSize(clusterSize),
94 m_lockPattern(0x00000000),
123 m_dataStore(pCluster->m_dataStore),
124 m_momentStore(pCluster->m_momentStore),
125 m_ownDataStore(true),
126 m_basicSignal(pCluster->m_basicSignal),
127 m_time(pCluster->m_time),
128 m_samplingPattern(pCluster->m_samplingPattern),
129 m_barrel(pCluster->m_barrel),
130 m_endcap(pCluster->m_endcap),
131 m_clusterSize(pCluster->m_clusterSize),
132 m_eta0(pCluster->m_eta0),
133 m_phi0(pCluster->m_phi0),
134 m_timeNorm(pCluster->m_timeNorm),
135 m_posNorm(pCluster->m_posNorm),
136 m_posSamNorm(pCluster->m_posSamNorm),
137 m_nBarrel(pCluster->m_nBarrel),
138 m_nEndcap(pCluster->m_nEndcap),
139 m_lockPattern(pCluster->m_lockPattern),
140 m_rawE(pCluster->m_rawE),
141 m_rawEta(pCluster->m_rawEta),
142 m_rawPhi(pCluster->m_rawPhi),
143 m_rawM(pCluster->m_rawM),
144 m_altE(pCluster->m_altE),
145 m_altEta(pCluster->m_altEta),
146 m_altPhi(pCluster->m_altPhi),
147 m_altM(pCluster->m_altM)
154 bool isExternalShowerThere =
false;
156 if (*(pCluster->
m_dataLink) !=
nullptr) isExternalShowerThere =
true;
184 m_dataStore(rCluster.m_dataStore),
185 m_momentStore(rCluster.m_momentStore),
186 m_ownDataStore(true),
187 m_basicSignal(rCluster.m_basicSignal),
188 m_time(rCluster.m_time),
189 m_samplingPattern(rCluster.m_samplingPattern),
190 m_barrel(rCluster.m_barrel),
191 m_endcap(rCluster.m_endcap),
192 m_clusterSize(rCluster.m_clusterSize),
193 m_eta0(rCluster.m_eta0),
194 m_phi0(rCluster.m_phi0),
195 m_timeNorm(rCluster.m_posNorm),
196 m_posNorm(rCluster.m_posNorm),
197 m_posSamNorm(rCluster.m_posSamNorm),
198 m_nBarrel(rCluster.m_nBarrel),
199 m_nEndcap(rCluster.m_nEndcap),
200 m_lockPattern(rCluster.m_lockPattern),
201 m_rawE(rCluster.m_rawE),
202 m_rawEta(rCluster.m_rawEta),
203 m_rawPhi(rCluster.m_rawPhi),
204 m_rawM(rCluster.m_rawM),
205 m_altE(rCluster.m_altE),
206 m_altEta(rCluster.m_altEta),
207 m_altPhi(rCluster.m_altPhi),
208 m_altM(rCluster.m_altM)
215 bool isExternalShowerThere =
false;
217 if (*(rCluster.
m_dataLink) !=
nullptr) isExternalShowerThere =
true;
277 if (!theCell->
caloDDE())
return;
279 double theEnergyNoWeight = theCell->
e();
281 double cellEta = theCell->
eta();
282 double cellPhi = theCell->
phi();
285 double theAbsEnergy =
weight * fabs(theEnergyNoWeight);
286 double thePhi =
proxim(cellPhi,this->
phi());
289 double theNewPhi =
m_posNorm * this->
phi() + theAbsEnergy * thePhi;
304 this->
setE(theNewEnergy);
332 + theTimeNorm * theCell->
time();
370 if ( pEStore !=
nullptr )
391 if ( pPhiStore !=
nullptr )
393 double& refPhiSamp = pPhiStore->
retrieveData(typePhi,sam);
394 thePhi =
proxim(cellPhi,refPhiSamp);
395 theNewPhi = theNewNorm != 0.
405 if ( pDPhiStore !=
nullptr )
408 double& refDPhiSamp = pDPhiStore->
retrieveData(typeDPhi,sam);
411 ( refDPhiSamp*refDPhiSamp + refPhiSamp*refPhiSamp)
412 + theAbsEnergy * thePhi * thePhi;
413 refDPhiSamp = theNewNorm != 0.
414 ? wP2 / theNewNorm - theNewPhi*theNewPhi
416 if ( refDPhiSamp > 0. )
418 refDPhiSamp = sqrt(refDPhiSamp);
427 refPhiSamp = theNewPhi;
441 if ( pEtaStore !=
nullptr )
443 double& refEtaSamp = pEtaStore->
retrieveData(typeEta,sam);
444 double theNewEta = theNewNorm != 0.
445 ? (theOldNorm*refEtaSamp+theAbsEnergy* cellEta)/theNewNorm
454 if ( pDEtaStore !=
nullptr )
456 double& refDEtaSamp = pDEtaStore->
retrieveData(typeDEta,sam);
457 double wE2 = theOldNorm * (refDEtaSamp * refDEtaSamp +
458 refEtaSamp * refEtaSamp )
459 + theAbsEnergy * cellEta * cellEta;
460 refDEtaSamp = theNewNorm != 0
461 ? wE2 / theNewNorm - theNewEta * theNewEta
463 if ( refDEtaSamp > 0. )
465 refDEtaSamp = sqrt(refDEtaSamp);
469 refDEtaSamp =
double(0.0);
474 refEtaSamp = theNewEta;
486 if ( pEMaxStore !=
nullptr )
488 double& refEMaxSamp = pEMaxStore->
retrieveData(typeEMax,sam);
500 if ( pEtaMaxStore !=
nullptr )
513 if ( pPhiMaxStore !=
nullptr )
569 CellAccum (
double& the_posNorm,
570 std::vector<double>& the_posSamNorm,
573 double& the_timeNorm)
578 EtaMaxEnergyInSample(),
579 PhiMaxEnergyInSample(),
586 posNorm (the_posNorm),
587 posSamNorm (the_posSamNorm),
588 nBarrel (the_nBarrel),
589 nEndcap (the_nEndcap),
590 timeNorm (the_timeNorm)
606 std::vector<double>& posSamNorm;
619 return m_cl.getCellWeight (&
cell);
628 double operator() (
const CaloCell&)
const {
return 1; }
632 template <
class WEIGHT>
634 void accumCell (
const CaloCell&
cell, CellAccum& accum,
const WEIGHT&
w)
639 double fabsweight = fabs (
weight);
641 double theEnergyNoWeight =
cell.e();
645 double theAbsEnergy =
weight * fabs(theEnergyNoWeight);
648 accum.PresenceInSample[sam] =
true;
649 double cellEta = dde->
eta();
650 double cellPhi = dde->
phi();
655 if (accum.phi0 < -900) {
656 thePhi = accum.phi0 = cellPhi;
659 thePhi =
proxim (cellPhi, accum.phi0);
661 accum.theNewEta += theAbsEnergy * cellEta;
662 accum.theNewPhi += theAbsEnergy * thePhi;
663 if ( accum.MaxEnergyInSample[sam] <
theEnergy ) {
664 accum.MaxEnergyInSample[sam] =
theEnergy;
665 accum.EtaMaxEnergyInSample[sam] = cellEta;
666 accum.PhiMaxEnergyInSample[sam] = cellPhi;
669 accum.posSamNorm[sam] += theAbsEnergy;
670 accum.posNorm += theAbsEnergy;
672 accum.EtaInSample[sam] += theAbsEnergy * cellEta;
673 accum.PhiInSample[sam] += theAbsEnergy * thePhi;
691 accum.nEndcap += (
weight<0?-1:1);
696 accum.nBarrel += (
weight<0?-1:1);
703 unsigned int pmask = dde->
is_tile() ? 0x8080 : 0x2000;
706 if (
cell.provenance() & pmask ) {
708 double theTimeNorm = fabsweight *
theEnergy * theEnergyNoWeight;
709 accum.theNewTime += theTimeNorm *
cell.time();
710 accum.timeNorm += theTimeNorm;
717 template <
class WEIGHT>
719 void accumCells (
CaloCluster&
cl, CellAccum& accum,
const WEIGHT&
w)
728 accumCell (**
it, accum,
w);
759 accum.theNewPhi = this->
phi();
761 accumCells (*
this, accum, AccumWeight(
this));
763 accumCells (*
this, accum, AccumNoWeight());
768 this->
setEta(accum.theNewEta * inorm);
777 this->
setE(accum.theNewEnergy);
789 if ( !updateLayers )
return;
794 if ( !accum.PresenceInSample[
i] )
continue;
800 accum.EtaInSample[
i] *= inorm;
805 #define SETVAR(v, a) maybeSetVariable(v, a, (a)+sizeof(a)/sizeof((a)[0]))
842 return pDataStore !=
nullptr
874 const double& varData,
886 return pDataStore !=
nullptr
887 ? pDataStore->
storeData(varType,samType,varData)
893 const std::vector<double>&
varList,
897 return pDataStore !=
nullptr
954 const int& sam)
const
957 unsigned int iSamp((
unsigned int)sam);
975 double vBarrel = this->
getVariable(varType,bSample,
true);
993 double eSum = eBarrel + eEndCap;
1008 vAverage = ( eBarrel * vBarrel + eEndCap * vEndCap ) / eSum;
1075 return &((*m_dataLink)->getSamplingStore());
1149 pSecndMomStore !=
nullptr && pSecndMomStore->
size() > 0
1150 ? pSecndMomStore->
end()
1151 : pFirstMomStore->
end();
1167 return &((*m_dataLink)->getMomentStore());
1211 return pMomStore !=
nullptr && pMomStore->
contains(momType)
1224 pFirstMomStore = this->getMomentStore();
1226 pSecndMomStore =
nullptr;
1228 if ( pFirstMomStore ==
nullptr || pFirstMomStore->size() == 0 )
1231 pFirstMomStore = this->getMomentStore(useLink);
1237 pSecndMomStore = useLink ? this->getMomentStore(useLink) :
nullptr;
1239 return pFirstMomStore !=
nullptr;
1254 if ( pMomStore !=
nullptr ) pMomStore->
insert(momType,momData);
1272 return pMomStore !=
nullptr
1273 ? pMomStore->
retrieve(momType,momData)
1307 return ! this->
isLocked(bitPattern);
1441 unsigned int size = 0;
1463 unsigned int size = 0;
1484 CLHEP::HepLorentzVector
1523 : m_iter(iter), m_firstStore(firstStore), m_secndStore(secndStore)
1532 if ( m_iter == m_firstStore->end() &&
1533 ( m_secndStore !=
nullptr && m_secndStore->size() > 0 ) )
1535 m_iter = m_secndStore->begin();
1543 if ( m_secndStore !=
nullptr && m_iter == m_secndStore->begin() )
1545 m_iter = m_firstStore->end();
1562 {
return m_iter == anOther.
m_iter; }
1565 {
return m_iter != anOther.
m_iter; }
bool isLocked(const variable_type &varType) const
Check lock status of variable.
SET_VALUE m_setPhi
Pointer to setter functions.
MomentType
enums to identify different moments
void setRecoStatus(const CaloRecoStatus &recStatus)
Set the reconstruction status.
CaloClusterMomentStore m_momentStore
cluster moments
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
void setTime(double theTime)
Set cluster time.
double m_altPhi
Stores calibrated (cell weight) signal.
virtual double phi() const override final
get phi (through CaloDetDescrElement)
virtual void resetSignalState()
reset the signal state
GET_VALUE m_getM
Pointer to getter functions.
bool hasSampling(const sampling_type &theSampling) const
Checks if certain sampling contributes to cluster.
value_type retrieveData(variable_key_type theVariable, sampling_key_type theSampling) const
Retrieve const reference to individual variable.
Scalar phi() const
phi method
void setCalEta(double eta)
Set calibrated (LC) eta.
virtual void setEta(double theEta)
set eta data member
void setetamax(sampling_type sampling, double m)
Set the of cell with maximum energy in a given sampling.
GET_VALUE m_getPhi
Pointer to getter functions.
void setRawEta(double eta)
Set raw eta.
int m_nEndcap
Counter for number of endcap cells with non-zero weight and energy.
CaloCluster(double eta0=0, double phi0=0, unsigned int varTypePattern=0x00000000, unsigned int clusterSize=CaloCluster::SW_55ele)
Constructor.
Scalar eta() const
pseudorapidity method
const CaloRecoStatus & getRecoStatus() const
Retrieve the reconstruction status.
double getRawPhi() const
Access to raw phi.
void setCalE(double e)
Set calibrated (LC) energy.
bool inBarrel() const
Returns true if at least one clustered cell in EMB.
bool storeData(variable_key_type theVariable, sampling_key_type theSampling, value_type theData)
}
bool setStateCal()
Helper to switch to calibrated (LC) state.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
void setetasize(sampling_type sampling, double size)
Set the cluster size in for a given sampling.
double proxim(double b, double a)
CaloSamplingData * getDataStore(const variable_type &theVariable, bool useLink=true)
provides Calorimeter Sampling enum
GET_VALUE m_getEta
Pointer to getter functions.
bool setVariable(const variable_type &varType, const sampling_type &samType, const double &varData, bool useLink=false)
General sampling variable setter.
unsigned int getClusterPhiSize() const
virtual double e() const override final
get energy (data member) (synonym to method energy()
double m_altE
Stores calibrated (cell weight) signal.
double m_timeNorm
Stores the normalization for time calculation e.g.
virtual bool setSignalState(signalstate_t s)
Sets signal state.
Internally used iterator.
SET_VALUE m_setEta
Pointer to setter functions.
uint16_t provenance() const
get provenance (data member)
unsigned int samplingPattern() const
Get sampling bitmask.
bool setDefaultSignalState(signalstate_t s)
Sets default signal state.
std::vector< double > m_posSamNorm
Stores the normalization e.g.
float time() const
get time (data member)
Data class for cluster variables associated with a CaloCluster.
virtual double e() const
get energy data member
virtual bool contains(const moment_type &rMomType) const
Containment check.
double getCalE() const
Access to calibrated (LC) energy.
Definition of CaloDetDescrManager.
void setenergymax(sampling_type sampling, double m)
Set the maximum energy in a given sampling.
Stores CaloClusterMoment in a keyed map.
bool getMomentStorePtrs(const CaloClusterMomentStore *&pFirstStore, const CaloClusterMomentStore *&pSecndStore, bool useLink) const
SET_VALUE m_setM
Pointer to setter functions.
bool inEndcap() const
Returns true if at least one clustered cell in EMEC.
virtual double eta() const
get eta data member
bool unlockVariable(const variable_type &varType)
Unlock variable (remove lock)
data_link_type m_dataLink
{
static unsigned int getSamplingBit(const CaloSample &rSample)
Return a unique bit set for a given sampling.
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
const sampling_store & getSamplingStore() const
Retrieves the non-modifiable sampling data store.
virtual moment_iterator begin() const
{
unsigned int m_clusterSize
Cluster size (e.g.
bool operator!=(const MomentStoreIter &anOther) const
Inequality comparator.
virtual bool isAtSignalState(signalstate_t s) const
check if we are at the passed state
const badChannelList * getBadChannel() const
Simple store for CaloCell links. This object is fully navigable.
GET_VALUE m_getE
Pointer to getter functions.
bool operator==(const MomentStoreIter &anOther) const
Equality comparator.
const CaloClusterMoment & operator*() const
Operator access to CaloClusterMoment.
virtual double m() const
get mass data member
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
double getRawE() const
Access to raw energy.
bool m_endcap
Flag is true if at least one cell in EMB.
void setAltM(double m)
Set calibrated (cell weight) m.
CaloSamplingData m_dataStore
{\ brief Cached Stores
double getAltPhi() const
Access to calibrated (cell weight) phi.
void insertMoment(const moment_type &momType, const moment_value &momValue, bool useLink=true)
Set individual moment.
double m_altM
Stores calibrated (cell weight) signal.
moment_iterator beginMoment(bool useLink=true) const
First iterator on moment store.
MomentStoreIter operator++()
Post-advance operator.
Principal data class for CaloCell clusters.
CaloPhiRange class declaration.
double m_rawM
Stores raw signal.
virtual void setEta(double eta)
Set eta.
void setRawM(double m)
Set raw m.
unsigned int m_samplingPattern
Sampling pattern.
MomentStoreIter operator--()
Post-step back operator.
const double & getValue() const
returns the value of this moment
std::vector< CaloClusterBadChannelData > badChannelList
Get Bad Channel information.
void setRawE(double e)
Set raw energy.
double getCalEta() const
Access to calibrated (LC) eta.
CaloClusterBadChannelData_v1 CaloClusterBadChannelData
void setphimax(sampling_type sampling, double m)
Set the of cell with maximum energy in a given sampling.
void setCalPhi(double phi)
Set calibrated (LC) phi.
static double fix(double phi)
static const double m_errorValue
Internal error return for real numbers.
void fill(H5::Group &out_file, size_t iterations)
bool is_tile() const
cell belongs to Tile
virtual void setPhi(double thePhi)
set phi data member
moment_type getMomentType() const
Function access to moment type.
void calculateKine(const bool useweight=true, const bool updateLayers=true)
Calculate cluster kinematics from contained cells.
MomentStoreIter moment_iterator
Moment iterator type for CaloCluster clients.
void setCalM(double m)
Set calibrated (LC) m.
double m_rawPhi
Stores raw signal.
const moment_store & getMomentStore() const
Access cluster moment store.
MomentStoreIter next()
Advance iterator.
double getTime() const
Access cluster time.
virtual double phi() const
get phi data member
bool setStateAlt()
Helper to switch to calibrated (cell weight) state.
static unsigned int getVariableBit(const VariableType &varType)
~MomentStoreIter()
Destructor.
virtual ~CaloCluster()
Destructor.
void setRawPhi(double phi)
Set raw phi.
moment_iterator endMoment(bool useLink=true) const
Last iterator on moment store.
virtual CLHEP::HepLorentzVector hlv() const
redefine hlv() here to avoid ambiguities
double m_altEta
Stores calibrated (cell weight) signal.
void setAltE(double e)
Set calibrated (cell weight) energy.
virtual void insert(const moment_type &rMomType, const moment_value &rMomData)
Insert key/data pair.
virtual bool retrieve(const moment_type &rMomType, moment_value &rMomData) const
Retrieve cluster moment for a given key.
void setAltPhi(double phi)
Set calibrated (cell weight) phi.
const CaloClusterMoment & getMoment() const
Function access to CaloClusterMoment.
Navigable part of CaloCluster, use CaloCellLink.
moment_iterator_i m_iter
Actual iterator on CaloClusterMomentStore.
SET_VALUE m_setE
Pointer to setter functions.
void prefetchObj(const T *ptr)
Generic prefetch of the object of specific types (sizes).
virtual void setE(double e)
Set energy.
bool allLocked() const
Check if all variables are locked.
double getAltEta() const
Access to calibrated (cell weight) eta.
Data object for each calorimeter readout cell.
signalstate_t m_defSigState
Stores default signal state.
bool contains(variable_key_type theVariable) const
Check on available variable types.
bool lockVariable(const variable_type &varType)
Lock variable (protect against future updates)
virtual void setM(double theM)
set mass data member
CaloCell_ID::CaloSample getSampling() const
cell sampling
virtual moment_iterator end() const
iterator loop terminator
virtual double eta() const
Retrieve eta independent of signal state.
defines enums and data types for different moments of CaloCluster
CaloCellLink * getCellLink()
int m_nBarrel
Counter for number of barrel cells with non-zero weight and energy.
MomentStoreIter prev()
Step back iterator.
bool setStores(CaloShower *pData, CaloCellLink *pLink, bool ownStores=true)
Setup internal store.
virtual void updateKine(const CaloCell *theCell, double weight)
Updates cluster kinematics when cell is added.
virtual double e() const
Retrieve energy independent of signal state.
virtual void setE(double theE)
set energy data member
double m_rawE
Stores raw signal.
double m_posNorm
Stores the normalization e.g.
double getAltE() const
Access to calibrated (cell weight) energy.
float eta() const
cell eta
double variableBE(const variable_type &theVariable, const int &samplingIndex) const
Rewrite as for calculation.
float phi() const
cell phi
CaloClusterMomentStore * getMomentStore(bool useLink=true)
double getCalPhi() const
Access to calibrated (LC) phi.
double getAltM() const
Access to calibrated (cell weight) m.
void setphisize(sampling_type sampling, double size)
Set the cluster size in for a given sampling.
bool retrieveMoment(const moment_type &momType, moment_value &momValue, bool useLink=true) const
Retrieve individual moment.
virtual double m() const
Retrieve mass independent of signal state.
signalstate_t m_signalState
Stores actual signal state.
virtual void setPhi(double phi)
Set phi.
Simple data object to store all variables in calorimeter samplings.
badChannelList m_badChannelData
size_t size() const
Number of stored moments.
virtual bool hasSignalState(signalstate_t s) const
check if signal state exists for current implementation
base class for methods and store of cell links
void addBadChannel(const CaloClusterBadChannelData &badChannel)
Add Bad channel information.
void setAltEta(double eta)
Set calibrated (cell weight) eta.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
unsigned int getClusterEtaSize() const
bool m_barrel
Flag is true if at least one cell in EMB.
double getRawM() const
Access to raw mass.
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
void resetBadChannel()
Reset Bad channel list.
double m_rawEta
Stores raw signal.
double getCalM() const
Access to calibrated (LC) m.
bool setStateRaw()
Helper to switch to raw state.
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Functions to prefetch blocks of memory.
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
MomentStoreIter()
Default constructor builds unusable iterator.
base class for kinematics of composite calo object
double getVariable(const variable_type &varType, const sampling_type &samType, bool useLink=true) const
General sampling variable access.
unsigned int m_lockPattern
Variable lock pattern.
double getRawEta() const
Access to raw eta.
virtual double phi() const
Retrieve phi independent of signal state.
bool isEMSampling(const sampling_type &theSampling) const
Checks if cells from a given sampling in EMB and EMEC are in the cluster.