|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H
6 #define XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H
24 #include "CaloGeoHelpers/CaloSampling.h"
28 #include "AthLinks/ElementLink.h"
31 #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS))
37 #endif // not (defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS))
40 #include "Math/Vector4D.h"
60 friend class ::CaloClusterChangeSignalState;
330 virtual double pt()
const;
332 virtual double eta()
const;
334 virtual double phi()
const;
336 virtual double m()
const;
338 virtual double e()
const;
426 template<
class CDATA>
430 cdata.clear(); cdata.reserve(clist.size());
431 for (
auto cn : clist ) { cdata.push_back(extractLowerCount<typename CDATA::value_type>(cn)); }
626 #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS))
628 #endif //not defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS)
693 template<
class UNSIGNED> UNSIGNED
extractLowerCount(ncells_store_t::value_type cdata)
const {
return static_cast<UNSIGNED
>(cdata & 0x00ff); }
694 template<
class UNSIGNED> UNSIGNED
extractUpperCount(ncells_store_t::value_type cdata)
const {
return static_cast<UNSIGNED
>( (cdata & 0xff00)>>8 ); }
695 template<
class UNSIGNED> ncells_store_t::value_type
setLowerCount(ncells_store_t::value_type cdata,UNSIGNED clower)
696 {
return static_cast<ncells_store_t::value_type
>((cdata & 0xff00)|(clower & 0x00ff)); }
697 template<
class UNSIGNED> ncells_store_t::value_type
setUpperCount(ncells_store_t::value_type cdata,UNSIGNED cupper)
698 {
return static_cast<ncells_store_t::value_type
>((cdata & 0x00ff)|((cupper & 0x00ff)<<8)); }
699 template<
class UNSIGNED> UNSIGNED
lowerCellCountBound()
const {
return static_cast<UNSIGNED
>(std::numeric_limits<ncells_t>::lowest()); }
702 {
return static_cast<CCTYPE
>(
std::min(
std::max(
count,lowerCellCountBound< UNSIGNED >()),upperCellCountBound< UNSIGNED >())); }
708 const CaloSample sampling,
const float errorvalue=-999)
const;
714 #if !(defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS))
751 const EventContext& ctx);
801 return links->begin();
848 #endif // not defined(SIMULATIONBASE) || defined(XAOD_ANALYSIS)
857 if (this->
m() == 0) {
861 return this->
p4().Et();
877 return std::popcount(
pattern << (32 -
s));
918 #endif // XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H
@ CENTER_MAG
Cluster Centroid ( )
@ SECOND_R
Second Moment in .
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
flt_t phi0() const
Returns raw of cluster seed.
virtual double phi() const
The azimuthal angle ( ) of the particle.
unsigned nSamples() const
flt_t time() const
Access cluster time.
Helper to temporarily change the signal state of a cluster.
double m_secondTime
Second cell time moment (transient only)
@ FIRST_ETA_DigiHSTruth
First Moment in .
@ ENG_CALIB_DEAD_UNCLASS
Attached Calibration Hit energy in dead material in unclassified areas of the detector.
Container class for CaloCellLink.
@ FIRST_PHI
First Moment in .
@ OOC_WEIGHT
Out-of-cluster weight (E_ooc/E_w)
@ ENG_FRAC_CORE
Energy fraction of the sum of the hottest cells in each sampling.
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
bool setPhisize(const CaloSample sampling, const float phiSize)
Set the cluster size in for a given sampling.
ClusterSize
Enumeration to identify different cluster sizes.
flt_t rawEta() const
Get in signal state UNCALIBRATED.
@ LONGITUDINAL_DigiHSTruth
Normalized longitudinal moment.
void setRawM(flt_t)
Set mass for singal state UNCALIBRATED.
@ SECOND_LAMBDA_DigiHSTruth
Second Moment in .
int numberCells() const
Return total number of cells in cluster.
@ VERTEX_FRACTION
Vertex fraction of this cluster wrt.
double getMomentValue(MomentType type) const
Retrieve individual moment - no check for existance! Returns -999 on error.
CaloSampling::CaloSample CaloSample
@ MASS
cell based mass i.e. the mass of the 4-vector sum of all massless positive energetic cells
@ EM_PROBABILITY
Classification probability to be em-like.
@ CENTER_X
Cluster Centroid ( )
@ ENG_BAD_HV_CELLS
Total em-scale energy of cells with bad HV in this cluster.
@ EM_PROBABILITY_DigiHSTruth
Classification probability to be em-like.
cell_iterator cell_begin()
bool getNumberCellsInSampling(CDATA &cdata) const
Get number of cells for all sampling layer.
State m_signalState
Current signal state.
@ ENG_CALIB_DEAD_LEAKAGE
Attached Calibration Hit energy in dead material behind calorimeters.
@ ENERGY_CALIB_DigiHSTruth
First Moment in .
flt_t calE() const
Geet Energy in signal state CALIBRATED.
@ ETA2CALOFRAME
Eta of sampling 2 in the calo frame (for egamma)
void setAltM(flt_t)
Set mass for singal state ALTCALIBRATED.
flt_t secondTime() const
Access second moment of cell timing distribution.
@ TIME_DigiHSTruth
First Moment in .
void clearSamplingData()
Clear the sampling data.
@ AVG_LAR_Q
Sum(E_cell_LAr^2 Q_cell_LAr)/Sum(E_cell_LAr^2)
@ ETA1CALOFRAME
Eta of sampling 1 in the calo frame (for egamma)
flt_t calEta() const
Get in signal state CALIBRATED.
const CaloRecoStatus & recoStatus() const
Accesssor to CaloRecoStatus (const)
State
enum of possible signal states.
void setAltEta(flt_t)
Set for signal state ALTCALIBRATED.
@ ETA_CALIB_DigiHSTruth
First Moment in .
@ BADLARQ_FRAC_DigiHSTruth
CaloRecoStatus m_recoStatus
Reco status (transient only)
@ PHI_CALIB_DigiHSTruth
First Moment in .
virtual double m() const
The invariant mass of the particle.
@ ENG_CALIB_TILEG3
Calibration Hit energy inside the cluster scintillator.
const_iterator begin() const
const begin method
void addCellLink(std::unique_ptr< CaloClusterCellLink > CCCL)
Set up an ElementLink to a CaloClusterCellLink object.
@ ENG_CALIB_DEAD_T
Attached Calibration Hit energy in dead material with tight matching (Angle < 0.3).
void insertMoment(MomentType type, double value)
@ ENG_CALIB_OUT_M
Attached Calibration Hit energy outside clusters but inside the calorimeter with medium matching (Ang...
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
void setBadChannelList(const CaloClusterBadChannelList &bcl)
float etasize(const CaloSample sampling) const
Returns cluster size in for a given sampling.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
State signalState() const
Get the current signal state.
bool setLink(CaloClusterCellLinkContainer *CCCL, IProxyDict *sg=nullptr)
Set up an ElementLink to a CaloClusterCellLink object.
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
@ ENG_CALIB_EMB0
Calibration Hit energy inside the cluster barrel presampler.
void setCalEta(flt_t)
Set for signal state CALIBRATED.
std::string stime()
return the current data and time
@ CENTER_Y_DigiHSTruth
Cluster Centroid ( )
UNSIGNED upperCellCountBound() const
upper boundary for cell count
ncells_store_t::value_type setLowerCount(ncells_store_t::value_type cdata, UNSIGNED clower)
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.
@ ENG_CALIB_DEAD_TILE0
Attached Calibration Hit energy in dead material between EMB3 and TILE0.
static constexpr unsigned int barrelPattern()
Get the bit-pattern for barrel samplings.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
CCTYPE adjustToRange(UNSIGNED count) const
< reduce value range to min and max counts
Class providing the definition of the 4-vector interface.
@ LATERAL_DigiHSTruth
Normalized lateral moment.
@ CENTER_Z_DigiHSTruth
Cluster Centroid ( )
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for calo.
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
uint8_t ncells_t
Type for number-of-cells-in-sampling counter.
@ PHI1CALOFRAME
Phi of sampling 1 in the calo frame (for egamma)
flt_t calM() const
Get mass in signal state CALIBRATED.
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.
SG::Accessor< T, ALLOC > Accessor
@ SECOND_LAMBDA
Second Moment in .
TLorentzVector FourMom_t
Definition of the 4-momentum type.
MomentType
Enums to identify different moments.
@ PTD
relative spread of pT of constiuent cells = sqrt(n)*RMS/Mean
@ NCELL_SAMPLING
Number of cells in sampling layer.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
void setSecondTime(flt_t stime)
Set second moment of cell timing distribution.
@ CENTER_Z
Cluster Centroid ( )
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
ClusterSize clusterSize() const
Get cluster size.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
@ SECOND_ENG_DENS
Second Moment in E/V.
static const CaloClusterCellLink::const_iterator dummyIt
Dummy iterator to be used as begin/end if no cell-links are present.
DATAVECTOR_BASE_FIN(xAOD::CaloCluster_v1, xAOD::IParticle)
bool setPhimax(const CaloSample sampling, const float phiMax)
Set the phi of the cell with the highest energy in a particular sampling.
CaloCluster_v1()
Default constructor.
Description of a calorimeter cluster.
std::vector< CaloClusterBadChannelData > CaloClusterBadChannelList
void setCalPhi(flt_t)
Set for signal state CALIBRATED.
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
@ DM_WEIGHT
Dead-material weight (E_dm/E_ooc)
@ ENG_POS_DigiHSTruth
Total positive Energy of this cluster.
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
@ HAD_WEIGHT
Hadronic weight (E_w/E_em)
@ SIGNIFICANCE_DigiHSTruth
Cluster significance.
bool removeCell(const CaloCell *ptr)
Method to remove a cell to the cluster (slow!) (Beware: Kinematics not updated!)
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector type.
@ SECOND_ENG_DENS_DigiHSTruth
Second Moment in E/V.
void setCalM(flt_t)
Set mass for singal state CALIBRATED.
unsigned int getClusterEtaSize() const
Get eta size from cluster size.
void setPhi0(flt_t)
Set raw of cluster seed.
virtual double eta() const
The pseudorapidity ( ) of the particle.
@ ETA_DigiHSTruth
Eta moment that I am trying to include.
float energy_max(const CaloSample sampling) const
Retrieve maximum cell energy in given sampling.
@ CENTER_LAMBDA_DigiHSTruth
Shower depth at Cluster Centroid.
const ElementLink< xAOD::CaloClusterContainer_v1 > & getSisterClusterLink() const
Get a link to a 'sister' cluster (eg the non-calibrated counterpart)
std::vector< uint16_t > ncells_store_t
Store type for number-of-cells-in-sampling counter.
@ CELL_SIG_SAMPLING_DigiHSTruth
@ FIRST_ENG_DENS_DigiHSTruth
First Moment in E/V.
@ CELL_SIG_SAMPLING
CaloSample of the cell with the largest |E|/sig.
unsigned m_samplingPattern
bit-pattern describing the calo samplings contributing to this cluster
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
@ TIME_CALIB_DigiHSTruth
First Moment in .
const CaloCluster_v1 * getSisterCluster() const
Get a pointer to a 'sister' cluster (eg the non-calibrated counterpart)
UNSIGNED lowerCellCountBound() const
lower value boundary for cell count
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
bool setSignalState(const State s)
Switch signal state.
const_cell_iterator const_iterator
STL-compatible iterators.
@ ENG_CALIB_FRAC_REST
Calibration Hit energy inside the cluster caused by other particles.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
size_t size() const
size method (forwarded from CaloClusterCellLink obj)
void setAltE(flt_t)
Set Energy for signal state ALTCALIBRATED.
void setRawEta(flt_t)
Set for signal state UNCALIBRATED.
@ DELTA_PHI
Angular shower axis deviation ( ) from IP-to-Center.
@ ENG_CALIB_DEAD_FCAL
Attached Calibration Hit energy in dead material before FCAL, between FCAL and HEC.
flt_t calPhi() const
Get in signal state CALIBRATED.
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
const_iterator cbegin() const
bool setSisterClusterLink(const ElementLink< CaloClusterContainer_v1 > &sister)
Set a link to a 'sister' cluster (eg the non-calibrated counterpart)
@ FIRST_ENG_DENS
First Moment in E/V.
std::unique_ptr< CaloClusterCellLink > m_cellLinks
Unique ptr to cell links.
unsigned int getClusterPhiSize() const
Get phi size from cluster size.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
@ ENG_BAD_CELLS
Total em-scale energy of bad cells in this cluster.
bool setSamplVarFromAcc(const Accessor< std::vector< float > > &acc, const CaloSample sampling, const float value)
static constexpr unsigned int endcapPattern()
Get the bit-pattern for endcap samplings.
@ ENG_BAD_HV_CELLS_DigiHSTruth
virtual FourMom_t p4() const
The full 4-momentum of the particle.
void reweightCell(cell_iterator it, const double weight)
Method to reweight a cell in the cluster (Beware: Kinematics not updated!)
ElementLink implementation for ROOT usage.
@ TILE_CONFIDENCE_LEVEL
Confidence Level of a tile calorimeter cluster to be noise.
flt_t rawM() const
Get mass in signal state UNCALIBRATED.
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
virtual ~CaloCluster_v1()
Destructor.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
DataVector< CaloCluster_v1 > CaloClusterContainer_v1
Define the cluster container as a simple DataVector.
@ ENG_CALIB_EME0
Calibration Hit energy inside the cluster endcap presampler.
@ N_BAD_CELLS_CORR_DigiHSTruth
@ ENG_FRAC_EM
Energy fraction in EM calorimeters.
const_iterator begin() const
@ ENG_CALIB_DEAD_M
Attached Calibration Hit energy in dead material with medium matching (Angle < 0.5).
ncells_store_t::value_type setUpperCount(ncells_store_t::value_type cdata, UNSIGNED cupper)
unsigned sampVarIdx(const CaloSample) const
@ N_BAD_CELLS_DigiHSTruth
number of bad cells
CaloRecoStatus & recoStatus()
Accesssor to CaloRecoStatus (non-const)
const_cell_iterator cell_cend() const
const CaloClusterBadChannelList & badChannelList() const
@ ENG_CALIB_DEAD_HEC0
Attached Calibration Hit energy in dead material between EME3 and HEC0.
flt_t altE() const
Get Energy in signal state ALTCALIBRATED.
@ N_BAD_HV_CELLS_DigiHSTruth
number of cells with bad HV
void setNumberCellsInSampling(CaloSampling::CaloSample samp, int ncells, bool isInnerWheel=false)
Set the number of cells in a sampling layer.
@ FIRST_PHI_DigiHSTruth
First Moment in .
@ PHI_DigiHSTruth
phi moment I would like to have
@ ENERGY_DigiHSTruth
First Moment in .
@ AVG_TILE_Q
Sum(E_cell_Tile^2 Q_cell_Tile)/Sum(E_cell_Tile^2)
@ ENG_BAD_CELLS_DigiHSTruth
void setCalE(flt_t)
Set Energy for signal state CALIBRATED.
const_iterator end() const
const end method
@ PHICALOFRAME
Phi in the calo frame (for egamma)
@ OOC_WEIGHT_DigiHSTruth
Out-of-cluster weight (E_ooc/E_w)
@ ENG_CALIB_DEAD_TILEG3
Attached Calibration Hit energy in dead material before scintillator.
@ SECOND_R_DigiHSTruth
Second Moment in .
flt_t altPhi() const
Get in signal state ALTCALIBRATED.
@ FIRST_ETA
First Moment in .
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)
flt_t eta0() const
Returns raw of cluster seed.
@ ENG_FRAC_EM_DigiHSTruth
Energy fraction in EM calorimeters.
@ DELTA_THETA
Angular shower axis deviation ( ) from IP-to-Center.
float eSample(const CaloSample sampling) const
CaloCluster_v1 & operator=(const xAOD::CaloCluster_v1 &other)
Assignment operator.
void addCellLink(CaloClusterCellLink *CCCL)
@ ENG_CALIB_DEAD_TOT
Attached Calibration Hit energy in dead material.
const_iterator end() const
Data object for each calorimeter readout cell.
void setClusterSize(const ClusterSize)
Get cluster size.
UNSIGNED extractLowerCount(ncells_store_t::value_type cdata) const
extract lower cell count from data
flt_t rawPhi() const
Get in signal state UNCALIBRATED.
@ SIGNIFICANCE
Cluster significance.
@ PHI2CALOFRAME
Phi of sampling 2 in the calo frame (for egamma)
@ HAD_WEIGHT_DigiHSTruth
Hadronic weight (E_w/E_em)
@ N_BAD_HV_CELLS
number of cells with bad HV
CaloClusterCellLink * getOwnCellLinks()
Get a pointer to the owned CaloClusterCellLink object (non-const version)
@ DELTA_ALPHA_DigiHSTruth
UNSIGNED extractUpperCount(ncells_store_t::value_type cdata) const
extract upper cell count from data
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
const_cell_iterator cell_end() const
@ DELTA_THETA_DigiHSTruth
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
@ BAD_CELLS_CORR_E_DigiHSTruth
@ DM_WEIGHT_DigiHSTruth
Dead-material weight (E_dm/E_ooc)
float phisize(const CaloSample sampling) const
Returns cluster size in for a given sampling.
@ ENG_CALIB_DEAD_L
Attached Calibration Hit energy in dead material with loose matching (Angle < 1.0).
void toPersistent()
Function preparing the object to be persistified.
@ LATERAL
Normalized lateral moment.
flt_t altEta() const
Get in signal state ALTCALIBRATED.
bool setEtamax(const CaloSample sampling, const float etaMax)
Set the eta of the cell with the highest energy in a particular sampling.
const_cell_iterator cell_cbegin() const
@ ENG_FRAC_MAX_DigiHSTruth
Energy fraction of hottest cell.
@ SECOND_TIME
Second moment of cell time distribution in cluster.
@ DELTA_ALPHA
Angular shower axis deviation ( ) from IP-to-Center.
@ ENG_CALIB_FRAC_HAD
Calibration Hit energy inside the cluster caused by charged pi+ and pi-.
@ CELL_SIGNIFICANCE
Cell significance = E/sig of the cell with the largest |E|/sig.
bool setEtasize(const CaloSample sampling, const float etaSize)
Set the cluster size in for a given sampling.
@ ENG_CALIB_OUT_L
Attached Calibration Hit energy outside clusters but inside the calorimeter with loose matching (Angl...
@ ENG_CALIB_DEAD_EME0
Attached Calibration Hit energy in dead material before EME0, between EME0 and EME1.
@ ENG_CALIB_OUT_T
Attached Calibration Hit energy outside clusters but inside the calorimeter with tight matching (Angl...
@ BAD_CELLS_CORR_E
Energy of bad cells with energy density average correction applied.
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
ObjectType
Type of objects that have a representation in the xAOD EDM.
@ ETACALOFRAME
Eta in the calo frame (for egamma)
@ N_BAD_CELLS_CORR
Number of bad cells with energy density average correction applied.
@ LONGITUDINAL
Normalized longitudinal moment.
void setAltPhi(flt_t)
Set for signal state ALTCALIBRATED.
CaloClusterCellLink::const_iterator const_cell_iterator
Iterator of the underlying CaloClusterCellLink (explicitly const version)
unsigned samplingPattern() const
Access to sampling pattern (one bit per sampling) (Method may be removed later)
flt_t altM() const
Get mass in signal state ALTCALIBRATED.
const_iterator to loop over cells belonging to a cluster
@ NVERTEX_FRACTION
slightly updated vertex fraction more pile up independent (similar to nJVF)
float getSamplVarFromAcc(const Accessor< std::vector< float > > &acc, const CaloSample sampling, const float errorvalue=-999) const
@ N_BAD_CELLS
number of bad cells
@ ENG_FRAC_CORE_DigiHSTruth
virtual double rapidity() const
The true rapidity (y) of the particle.
reconstruction status indicator
virtual double e() const
The total energy of the particle.
@ CENTER_Y
Cluster Centroid ( )
const_iterator cend() const
@ ENG_CALIB_DEAD_EMB0
Attached Calibration Hit energy in dead material before EMB0, between EMB0 and EMB1.
@ CENTER_X_DigiHSTruth
Cluster Centroid ( )
void setM(flt_t)
Set Mass for the current signal state.
@ ENG_POS
Total positive Energy of this cluster.
void setRawPhi(flt_t)
Set for signal state UNCALIBRATED.
@ CELL_SIGNIFICANCE_DigiHSTruth
int numberCellsInSampling(const CaloSample samp, bool isInnerWheel=false) const
Returns number of cells in given sampling.
@ BADLARQ_FRAC
Energy fraction of LAr cells with quality larger than a given cut.