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