7#ifndef CALOEVENT_CALOCLUSTER_H
8#define CALOEVENT_CALOCLUSTER_H
59#include "CaloEvent/CaloClusterBadChannelData.h"
71struct CaloClusterSignalState;
213 unsigned int varTypePattern = 0x00000000,
229 bool useLink =
true)
const;
234 std::vector<double>& varList,
235 bool useLink =
true)
const;
241 const double& varData,
242 bool useLink =
false);
246 const std::vector<double>& varList,
247 bool useLink =
false);
260 bool isLocked(
const unsigned int& bitPattern)
const;
276 virtual double e()
const;
278 virtual double eta()
const;
280 virtual double phi()
const;
282 virtual double m()
const;
294 virtual void setE(
double e);
300 virtual void setM(
double m);
307 virtual void set4Mom(
const CLHEP::HepLorentzVector& rVec);
372 bool useLink=
true)
const;
375 bool useLink=
true)
const;
378 bool useLink=
true)
const;
384 bool useLink=
true)
const;
437 double etaBE(
int sampling)
const;
439 double phiBE(
int sampling)
const;
441 double energyBE(
int sampling)
const;
465 void calculateKine(
const bool useweight=
true,
const bool updateLayers=
true );
507 const int& samplingIndex)
const;
513 bool useLink=
false)
const;
542 template <
class InputIterator>
754{
return (this->*
m_getE)(); }
765{
return (this->*
m_getM)(); }
843 this->
setE(pMom->
e());
846 this->
setM(pMom->
m());
854 this->
setE(rVec.e());
857 this->
setM(rVec.m());
1251{
return (momIter.
getMoment()).getValue(); }
1312 return static_cast<std::size_t
> (
static_cast<long long>(p->energy_nonvirt()));
1316template <
class InputIterator>
1321 if (this->
isLocked (varType))
return;
1324 p->storeData (varType, beg,
end);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
A mixin base class implementing IAthenaBarCode. IAthenaBarCode should be a virtual base of the class ...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
std::size_t navigationHash(const CaloCluster *p)
Define macros for attributes used to control the static checker.
Simple store for CaloCell links.
Data object for each calorimeter readout cell.
Stores CaloClusterMoment in a keyed map.
CaloClusterMomentIterator moment_iterator
External moment iterator type.
CaloClusterMoment::MomentType moment_type
Moment type.
CaloClusterMoment moment_value
Moment data.
defines enums and data types for different moments of CaloCluster
MomentType
enums to identify different moments
virtual object_iter end() const
end iterator for public object access
bool setLinkStore(CaloCellLink *pLink, bool ownStores=true)
const CaloClusterMoment & operator*() const
Operator access to CaloClusterMoment.
const moment_store * m_secndStore
Pointer to second CaloClusterMomentStore.
MomentStoreIter prev()
Step back iterator.
bool operator==(const MomentStoreIter &anOther) const
Equality comparator.
const moment_store * m_firstStore
Pointer to first CaloClusterMomentStore.
MomentStoreIter operator--()
Post-step back operator.
MomentStoreIter next()
Advance iterator.
MomentStoreIter()
Default constructor builds unusable iterator.
~MomentStoreIter()
Destructor.
moment_iterator_i m_iter
Actual iterator on CaloClusterMomentStore.
bool operator!=(const MomentStoreIter &anOther) const
Inequality comparator.
moment_type getMomentType() const
Function access to moment type.
MomentStoreIter operator++()
Post-advance operator.
const CaloClusterMoment & getMoment() const
Function access to CaloClusterMoment.
Principal data class for CaloCell clusters.
void setphimax(sampling_type sampling, double m)
Set the of cell with maximum energy in a given sampling.
double etamax(sampling_type sampling) const
Retrieve of cell with maximum energy in given sampling.
bool getMomentStorePtrs(const CaloClusterMomentStore *&pFirstStore, const CaloClusterMomentStore *&pSecndStore, bool useLink) const
double eta0() const
Returns raw of cluster seed.
void setRawEta(double eta)
Set raw eta.
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
bool retrieveMoment(const moment_type &momType, moment_value &momValue, bool useLink=true) const
Retrieve individual moment.
virtual CLHEP::HepLorentzVector hlv() const
redefine hlv() here to avoid ambiguities
double m_time
Cluster timing.
SET_VALUE m_setM
Pointer to setter functions.
double getAltM() const
Access to calibrated (cell weight) m.
MomentStoreIter moment_iterator
Moment iterator type for CaloCluster clients.
CaloClusterMomentStore m_momentStore
cluster moments
void getEInSamples(std::vector< double > &theEnergies) const
Retrieve energy for all samplings into a vector.
double m_rawEta
Stores raw signal.
void calculateKine(const bool useweight=true, const bool updateLayers=true)
Calculate cluster kinematics from contained cells.
void setRawM(double m)
Set raw m.
virtual double getBasicEnergy() const
Access basic energy scale signal.
moment_value getMoment(const moment_type &momType, bool useLink=true) const
Get individual moment.
void resetBadChannel()
Reset Bad channel list.
unsigned int getClusterEtaSize() const
bool setStateRaw()
Helper to switch to raw state.
unsigned int m_samplingPattern
Sampling pattern.
double m_altE
Stores calibrated (cell weight) signal.
double phiSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
virtual ~CaloCluster()
Destructor.
virtual double m() const
Retrieve mass independent of signal state.
void maybeSetVariable(variable_type varType, InputIterator beg, InputIterator end)
Set variables of a given type in all samplings at once, taking locking into account.
double getRawPhi() const
Access to raw phi.
void addBadChannel(const CaloClusterBadChannelData &badChannel)
Add Bad channel information.
double energyBE(int sampling) const
EMB/EMEC combined signal.
double energy_max(sampling_type sampling) const
Retrieve maximum cell energy in given sampling.
virtual double e() const
Retrieve energy independent of signal state.
bool containsBadCells() const
Check if cluster has any bad channel in it.
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
moment_type getMomentType(const moment_iterator &momIter) const
Get moment type.
virtual bool hasSignalState(signalstate_t s) const
check if signal state exists for current implementation
double m_altPhi
Stores calibrated (cell weight) signal.
void setCalPhi(double phi)
Set calibrated (LC) phi.
double variableBE(const variable_type &theVariable, const int &samplingIndex) const
Rewrite as for calculation.
virtual bool setSignalState(signalstate_t s)
Sets signal state.
double phimax(sampling_type sampling) const
Retrieve of cell with maximum energy in given sampling.
int m_nEndcap
Counter for number of endcap cells with non-zero weight and energy.
SET_VALUE m_setE
Pointer to setter functions.
double getCalEta() const
Access to calibrated (LC) eta.
double getAltE() const
Access to calibrated (cell weight) energy.
std::vector< CaloClusterBadChannelData > badChannelList
Get Bad Channel information.
friend class CaloClusterContainerCnv_p6
bool is_valid_sampling(const sampling_type &sampling) const
Checks if cells from a given sampling in EMB or EMEC (!) are in cluster.
double getRawM() const
Access to raw mass.
void setetamax(sampling_type sampling, double m)
Set the of cell with maximum energy in a given sampling.
double etasize(sampling_type sampling) const
Returns cluster size in for a given sampling.
void insertMoment(const moment_type &momType, const moment_value &momValue, bool useLink=true)
Set individual moment.
void setAltE(double e)
Set calibrated (cell weight) energy.
signalstate_t m_signalState
Stores actual signal state.
double getRawEta() const
Access to raw eta.
void setCalE(double e)
Set calibrated (LC) energy.
double etaBE(int sampling) const
EMB/EMEC combined barycenter .
bool setVariable(const variable_type &varType, const sampling_type &samType, const double &varData, bool useLink=false)
General sampling variable setter.
bool lockVariable(const variable_type &varType)
Lock variable (protect against future updates)
void setEInSamples(const std::vector< double > &theEnergies)
Set energy in all samplings from a vector.
void setRawPhi(double phi)
Set raw phi.
double phiBE(int sampling) const
EMB/EMEC combined barycenter .
void setenergy(sampling_type sampling, double e)
Set energy for a given sampling.
virtual double eta() const
Retrieve eta independent of signal state.
CaloVariableType::VariableType variable_type
Data type indicator.
bool setStateCal()
Helper to switch to calibrated (LC) state.
void seteta(sampling_type sampling, double eta)
Set in a given sampling.
double getTime() const
Access cluster time.
virtual void setEta(double eta)
Set eta.
friend class CaloClusterContainerCnv_p1
double m_phi0
Cluster seed .
signalstate_t m_defSigState
Stores default signal state.
data_link_type getMomentStoreLink() const
virtual bool isAtSignalState(signalstate_t s) const
check if we are at the passed state
moment_iterator beginMoment(bool useLink=true) const
First iterator on moment store.
void setRawE(double e)
Set raw energy.
signalstate_t defaultSignalState() const
Retrieve default signal state.
friend class CaloClusterContainerCnvTest_p7
void setCalM(double m)
Set calibrated (LC) m.
void getEtaInSamples(std::vector< double > &theEtas) const
Retrieve for all samplings into a vector.
double phisize(sampling_type sampling) const
Returns cluster size in for a given sampling.
friend struct CaloClusterSignalState
CaloSamplingData * getDataStore(const variable_type &theVariable, bool useLink=true)
virtual void resetSignalState()
reset the signal state
bool m_endcap
Flag is true if at least one cell in EMB.
double getAltPhi() const
Access to calibrated (cell weight) phi.
std::vector< double > m_posSamNorm
Stores the normalization e.g.
CaloCluster(double eta0=0, double phi0=0, unsigned int varTypePattern=0x00000000, unsigned int clusterSize=CaloCluster::SW_55ele)
Constructor.
moment_store::moment_iterator moment_iterator_i
Cluster moment store iterator type.
double getCalPhi() const
Access to calibrated (LC) phi.
double getCalM() const
Access to calibrated (LC) m.
bool isLocked(const variable_type &varType) const
Check lock status of variable.
CaloClusterLinkTemplate< CaloShowerContainer >::link_type data_link_type
bool unlockVariable(const variable_type &varType)
Unlock variable (remove lock)
double m_altM
Stores calibrated (cell weight) signal.
double etaSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
double getCalE() const
Access to calibrated (LC) energy.
double m_rawM
Stores raw signal.
moment_iterator endMoment(bool useLink=true) const
Last iterator on moment store.
double getMomentValue(const moment_type &momType, bool useLink=true) const
Get moment value.
double getVariable(const variable_type &varType, const sampling_type &samType, bool useLink=true) const
General sampling variable access.
void setEtaInSamples(const std::vector< double > &theEtas)
Set in all samplings from a vector.
bool setStateAlt()
Helper to switch to calibrated (cell weight) state.
void setBarrel(bool barrel)
Sets EMB indicator.
virtual void set4Mom(const I4Momentum *const pMom)
Set kinematics from four-vector.
unsigned int samplingPattern() const
Get sampling bitmask.
bool setDefaultSignalState(signalstate_t s)
Sets default signal state.
const badChannelList * getBadChannel() const
void setClusterSize(unsigned int theClusterSize)
Set cluster size.
bool setDataStore(CaloShower *pData, bool ownStores=true)
Setup data store.
double getAltEta() const
Access to calibrated (cell weight) eta.
ClusterSize
enums to identify different cluster size
double m_timeNorm
Stores the normalization for time calculation e.g.
SET_VALUE m_setPhi
Pointer to setter functions.
void setTime(double theTime)
Set cluster time.
void setEndcap(bool endcap)
Sets EMEC indicator.
bool inEndcap() const
Returns true if at least one clustered cell in EMEC.
CaloCluster & operator=(const CaloCluster &)
Disallow (avoid coverity warning).
unsigned int getClusterSize() const
Get cluster size.
SET_VALUE m_setEta
Pointer to setter functions.
bool isEMSampling(const sampling_type &theSampling) const
Checks if cells from a given sampling in EMB and EMEC are in the cluster.
friend class CaloClusterContainerCnv_p4
bool hasSampling(const sampling_type &theSampling) const
Checks if certain sampling contributes to cluster.
unsigned int getClusterPhiSize() const
badChannelList m_badChannelData
friend class CaloClusterContainerCnv_p7
bool setStores(CaloShower *pData, CaloCellLink *pLink, bool ownStores=true)
Setup internal store.
void setPhiInSamples(const std::vector< double > &thePhis)
Set in all samplings from a vector.
friend class CaloClusterContainerCnv_p2
bool setDataLink(CaloShowerContainer *pDataLink)
Set element link for shower data.
moment_store::moment_value moment_value
Cluster moment value type.
double(CaloCluster::* GET_VALUE)() const
double m_posNorm
Stores the normalization e.g.
CaloClusterMomentStore * getMomentStore(bool useLink=true)
GET_VALUE m_getPhi
Pointer to getter functions.
double value_type
Variable value type.
data_link_type m_dataLink
{
friend class CaloClusterContainerCnv_p5
virtual double phi() const
Retrieve phi independent of signal state.
bool allLocked() const
Check if all variables are locked.
double getRawE() const
Access to raw energy.
P4SignalState::State signalstate_t
CaloClusterMomentStore moment_store
Store type for cluster moments.
static const double m_errorValue
Internal error return for real numbers.
void setenergymax(sampling_type sampling, double m)
Set the maximum energy in a given sampling.
void setphisize(sampling_type sampling, double size)
Set the cluster size in for a given sampling.
CaloSamplingData m_dataStore
{\ brief Cached Stores
double m_eta0
Cluster seed .
friend class CaloClusterContainerCnvTest_p6
virtual void updateKine(const CaloCell *theCell, double weight)
Updates cluster kinematics when cell is added.
virtual void setBasicEnergy(double theEnergy)
Set basic energy scale signal.
moment_store::moment_type moment_type
Cluster moment indicator type.
GET_VALUE m_getEta
Pointer to getter functions.
GET_VALUE m_getM
Pointer to getter functions.
void setAltPhi(double phi)
Set calibrated (cell weight) phi.
unsigned int m_clusterSize
Cluster size (e.g.
void setCalEta(double eta)
Set calibrated (LC) eta.
P4SignalState statename_t
void getPhiInSamples(std::vector< double > &thePhis) const
Retrieve for all samplings into a vector.
CaloSampling::CaloSample sampling_type
Sampling indicator.
void setphi(sampling_type sampling, double phi)
Set in a given sampling.
double phi0() const
Returns raw of cluster seed.
int m_nBarrel
Counter for number of barrel cells with non-zero weight and energy.
void setAltM(double m)
Set calibrated (cell weight) m.
signalstate_t signalState() const
Retrieve signal state.
void setetasize(sampling_type sampling, double size)
Set the cluster size in for a given sampling.
bool m_barrel
Flag is true if at least one cell in EMB.
virtual void setPhi(double phi)
Set phi.
friend class CaloClusterContainerCnv_p3
unsigned int nSamples() const
Retrieve number of samplings in this cluster.
friend class CaloClusterStoreHelper
virtual void setM(double m)
Set mass.
GET_VALUE m_getE
Pointer to getter functions.
double m_altEta
Stores calibrated (cell weight) signal.
double m_rawPhi
Stores raw signal.
double m_basicSignal
Stores basic energy signal.
unsigned int m_lockPattern
Variable lock pattern.
void(CaloCluster::* SET_VALUE)(double v)
void setAltEta(double eta)
Set calibrated (cell weight) eta.
bool inBarrel() const
Returns true if at least one clustered cell in EMB.
double m_rawE
Stores raw signal.
virtual void setE(double e)
Set energy.
NAV::object_iter cell_iterator
Iterator type for cell store.
CaloCompositeKineBase()
Constructor.
Simple data object to store all variables in calorimeter samplings.
static bool isEMSampling(const CaloSample &rSample)
Get sampling characteristics.
static unsigned int getSamplingBit(const CaloSample &rSample)
Return a unique bit set for a given sampling.
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Container class for CaloShower.
Data class for cluster variables associated with a CaloCluster.
I4Momentum is an abstract base class providing 4-momentum behavior.
virtual CLHEP::HepLorentzVector hlv() const =0
CLHEP HepLorentzVector.
virtual double m() const =0
mass
virtual double phi() const =0
phi in [-pi,pi[
virtual double p() const =0
momentum magnitude
virtual double eta() const =0
pseudo rapidity
virtual double e() const =0
energy
ISignalState is an abstract base class providing support for various Signal States to be associated w...
virtual double e() const
get energy data member
virtual double phi() const
get phi data member
virtual double eta() const
get eta data member
virtual double m() const
get mass data member
static bool setLink(CONT *pCont, DOBJ *pDat, ELEM &rElm)
static unsigned int getVariableBit(const VariableType &varType)
static unsigned int getAllVariableBits()