3#ifndef CALOREC_CALOTOPOTOWERFROMCLUSTERMAKER_H
4#define CALOREC_CALOTOPOTOWERFROMCLUSTERMAKER_H
10#include "GaudiKernel/ServiceHandle.h"
22#include "CaloGeoHelpers/CaloSampling.h"
33#ifndef _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE
34#define _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE 28
46 virtual StatusCode
execute(
const EventContext& ctx,
49 virtual StatusCode
finalize()
override;
70 Gaudi::Property<bool>
m_orderByPt{
this,
"OrderClusterByPt",
false,
"Turn on/off pT-ordering of CaloClusterContainer (output)"};
71 Gaudi::Property<bool>
m_prepareLCW{
this,
"PrepareLCW",
false,
"Prepare data structure to apply LCW"};
74 Gaudi::Property<bool>
m_doCellIndexCheck{
this,
"DoCellIndexCheck",
false,
"Check cell hash indices for consistency"};
75 Gaudi::Property<bool>
m_buildCombinedSignal{
this,
"BuildCombinedTopoSignal",
false,
"Build topo-clusters and topo-towers"};
78 Gaudi::Property<bool>
m_removeSamplingData{
this,
"RemoveSamplingData",
true,
"Remove the associated sampling data"};
136 Gaudi::Property<std::vector<std::string>>
m_excludedSamplingsName{
this,
"ExcludedSamplings", {},
"Excluded samplings by name"};
ElementConstPointer cptr() const
Return a pointer to the referenced element.
Base class for cluster processing tools called from CaloClusterMaker.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Hash lookup of calibration weights for calorimeter cells.
Container class for CaloCell.
Data object for each calorimeter readout cell.
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
This class provides the client interface for accessing the detector description information common to...
static const double m_energyThresholdDef
Default energy threshold.
Gaudi::Property< double > m_energyThreshold
Cell energy threshold, default is set in m_energyThresholdDef.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
static const double m_clusterRangeDef
Default cluster range.
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *pClusCont, CaloCellClusterWeights *cellWeights) const override
Execute the tool and fill the xAOD::CaloClusterContainer pointed to by pClusCont.
uint_t m_numberOfSamplings
Number of samplings.
Gaudi::Property< double > m_clusterRange
Range where topo-clusters are used when m_buildCombinedSignal = true.
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
Calorimeter cell container.
bool checkCellIndices(const CaloTowerGeometry *towerGeo, const CaloDetDescrManager *caloDDM, const CaloCellContainer *pCellCont) const
Checks consistency between cell indices and hash identifiers.
uint_t badIndexValue() const
Returns value indicating a bad index.
static const uint_t m_errorValueUINT
Error value for uint_t type values.
std::bitset< _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE > m_excludedSamplingsPattern
Bit pattern indicates if sampling is excluded.
Gaudi::Property< bool > m_useCellsFromClusters
Use cells from topo-clusters if true, else use all cells, default is true.
bool addCellToProtoCluster(const CaloTowerGeometry *towerGeo, const CaloCell *cptr, protocont_t &pProtoCont, double weight=1.) const
Adding cells to proto-clusters.
Gaudi::Property< bool > m_buildCombinedSignal
Build topo-clusters within given range, else topo-towers.
std::vector< CaloProtoCluster > protocont_t
Container for CaloProtoCluster objects.
static xAOD::CaloCluster::ClusterSize getClusterSize(uint_t etaBins, uint_t phiBins)
Returns a cluster size tag from number of eta and phi bins in tower grid.
uint_t buildInclTowers(const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
Inclusive towers.
std::vector< CaloSampling::CaloSample > m_excludedSamplings
List of excluded samplings (CaloSampling::CaloSample enumerators).
bool isValidIndex(uint_t idx) const
Checks if argument is a valid index value.
CaloTopoTowerFromClusterMaker(const std::string &type, const std::string &name, const IInterface *pParent)
Tool constructor.
uint_t buildExclTowers(const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
Exclusive towers.
uint_t buildLCWTopoTowers(const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont, CaloCellClusterWeights *cellWeights) const
LCW topo-towers.
Gaudi::Property< bool > m_applyCellEnergyThreshold
Apply cell energy threshold, default is false.
std::size_t uint_t
Unsigned integral type.
Gaudi::Property< bool > m_removeSamplingData
Remove sampling data for towers.
SG::ReadCondHandleKey< CaloTowerGeometry > m_towerGeoKey
the name of the key of the CaloTowerGeometry object in the ConditonsStore
virtual StatusCode initialize() override
Setting up the operational mode and corresponding parameters.
Gaudi::Property< bool > m_doCellIndexCheck
Check cell hash index consistency if true (default false).
virtual StatusCode finalize() override
Finalize the tool (no action).
static bool filterProtoCluster(const CaloClusterCellLink &clnk)
Checks for and removes invalid cell links.
uint_t buildEMTopoTowers(const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont) const
EM topo-towers.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerKey
Topo-cluster container key.
Gaudi::Property< bool > m_orderByPt
Orders cluster container by , default true.
Gaudi::Property< bool > m_prepareLCW
Prepare LCW calibration, default is false.
Gaudi::Property< std::vector< std::string > > m_excludedSamplingsName
List of excluded samplings (human-readable names).
int cleanupCells(const CaloTowerGeometry *towerGeo, CaloClusterCellLink *clk, uint_t nclus) const
Checks CaloClusterCellLink for consistency.
Retrieve the list of towers associated with a calorimeter cell referenced by its hash identifier.
Property holding a SG store/key/clid from which a ReadHandle is made.
ClusterSize
Enumeration to identify different cluster sizes.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.