ATLAS Offline Software
CaloTopoTowerFromClusterMaker.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /* Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */
3 #ifndef CALOREC_CALOTOPOTOWERFROMCLUSTERMAKER_H
4 #define CALOREC_CALOTOPOTOWERFROMCLUSTERMAKER_H
5 
9 
10 #include "GaudiKernel/ServiceHandle.h"
11 
13 
15 #include "CaloProtoCluster.h"
16 
17 #include "CaloEvent/CaloCell.h"
21 
22 #include "CaloGeoHelpers/CaloSampling.h"
23 
25 
27 
28 #include <string>
29 #include <vector>
30 #include <bitset>
31 #include <map>
32 
33 #ifndef _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE
34 #define _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE 28
35 #endif
36 
38 {
39 public:
40 
42  CaloTopoTowerFromClusterMaker(const std::string& type,const std::string& name,const IInterface* pParent);
45  virtual StatusCode initialize() override;
46  virtual StatusCode execute(const EventContext& ctx,
47  xAOD::CaloClusterContainer* pClusCont,
48  CaloCellClusterWeights* cellWeights) const override;
49  virtual StatusCode finalize() override;
50 
52 
53 private:
54 
57  typedef std::vector<CaloProtoCluster> protocont_t;
58  typedef std::size_t uint_t;
59 
63 
65  SG::ReadCondHandleKey<CaloTowerGeometry> m_towerGeoKey{this,"TowerGeometry","CaloTowerGeometry"};
66  SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
67 
70  bool m_orderByPt = { false };
71  bool m_prepareLCW = { false };
72  bool m_useCellsFromClusters = { true };
73  bool m_applyCellEnergyThreshold = { false };
74  bool m_doCellIndexCheck = { false };
75  bool m_buildCombinedSignal = { false };
77  double m_clusterRange;
78  bool m_removeSamplingData = { true };
79 
83  //uint_t m_numberOfCells; ///< Number of cells (highest cell index + 1)
84  //uint_t m_maxCellHash; ///< Maximum hash index of cell ( number of cells - 1)
86  //uint_t m_numberOfTowers; ///< Number of towers
87  static const double m_energyThresholdDef;
88  static const double m_clusterRangeDef;
89  static const uint_t m_errorValueUINT;
90 
96  int cleanupCells(const CaloTowerGeometry* towerGeo, CaloClusterCellLink* clk,uint_t nclus) const;
97 
110  uint_t buildInclTowers(const CaloTowerGeometry* towerGeo, const CaloCellContainer& pCellCont,protocont_t& pProtoCont)const;
111  uint_t buildExclTowers(const CaloTowerGeometry* towerGeo, const CaloCellContainer& pCellCont,protocont_t& pProtoCont)const;
112  uint_t buildEMTopoTowers(const CaloTowerGeometry* towerGeo, const xAOD::CaloClusterContainer& clusCont,protocont_t& protoCont)const;
113  uint_t buildLCWTopoTowers(const CaloTowerGeometry* towerGeo, const xAOD::CaloClusterContainer& clusCont,protocont_t& protoCont,CaloCellClusterWeights* cellWeights) const;
114  bool addCellToProtoCluster(const CaloTowerGeometry* towerGeo, const CaloCell* cptr,protocont_t& pProtoCont,double weight=1.) const;
123 
126  static bool filterProtoCluster(const CaloClusterCellLink& clnk) ;
127  bool checkCellIndices(const CaloTowerGeometry* towerGeo, const CaloDetDescrManager* caloDDM,
128  const CaloCellContainer* pCellCont) const;
129  bool isValidIndex(uint_t idx) const;
130  uint_t badIndexValue() const;
131 
135  std::vector<CaloSampling::CaloSample> m_excludedSamplings;
136  std::vector<std::string> m_excludedSamplingsName;
137  std::bitset< _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE > m_excludedSamplingsPattern;
138 
143 };
144 
147 
262 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CaloTopoTowerFromClusterMaker::buildLCWTopoTowers
uint_t buildLCWTopoTowers(const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont, CaloCellClusterWeights *cellWeights) const
LCW topo-towers.
Definition: CaloTopoTowerFromClusterMaker.cxx:352
CaloTopoTowerFromClusterMaker::m_orderByPt
bool m_orderByPt
Orders cluster container by , default true.
Definition: CaloTopoTowerFromClusterMaker.h:70
CaloTopoTowerFromClusterMaker::filterProtoCluster
static bool filterProtoCluster(const CaloClusterCellLink &clnk)
Checks for and removes invalid cell links
Definition: CaloTopoTowerFromClusterMaker.cxx:518
xAOD::CaloCluster_v1::ClusterSize
ClusterSize
Enumeration to identify different cluster sizes.
Definition: CaloCluster_v1.h:86
ConvertOldUJHistosToNewHistos.etaBins
list etaBins
Definition: ConvertOldUJHistosToNewHistos.py:145
CaloTopoTowerFromClusterMaker::m_clusterContainerKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerKey
Topo-cluster container key.
Definition: CaloTopoTowerFromClusterMaker.h:68
CaloCell.h
CaloTopoTowerFromClusterMaker::m_applyCellEnergyThreshold
bool m_applyCellEnergyThreshold
Apply cell energy threshold, default is false.
Definition: CaloTopoTowerFromClusterMaker.h:73
SG::ReadHandleKey< xAOD::CaloClusterContainer >
CaloTopoTowerFromClusterMaker::buildExclTowers
uint_t buildExclTowers(const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
Exclusive towers.
Definition: CaloTopoTowerFromClusterMaker.cxx:419
CaloTopoTowerFromClusterMaker::m_cellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
Calorimeter cell container.
Definition: CaloTopoTowerFromClusterMaker.h:69
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
CaloTopoTowerFromClusterMaker::checkCellIndices
bool checkCellIndices(const CaloTowerGeometry *towerGeo, const CaloDetDescrManager *caloDDM, const CaloCellContainer *pCellCont) const
Checks consistency between cell indices and hash identifiers.
Definition: CaloTopoTowerFromClusterMaker.cxx:521
CaloTopoTowerFromClusterMaker::m_energyThresholdDef
static const double m_energyThresholdDef
Default energy threshold.
Definition: CaloTopoTowerFromClusterMaker.h:87
CaloTopoTowerFromClusterMaker::protocont_t
std::vector< CaloProtoCluster > protocont_t
Container for CaloProtoCluster objects.
Definition: CaloTopoTowerFromClusterMaker.h:57
CaloTopoTowerFromClusterMaker::m_clusterRange
double m_clusterRange
Range where topo-clusters are used when m_buildCombinedSignal = true
Definition: CaloTopoTowerFromClusterMaker.h:77
CaloTopoTowerFromClusterMaker::m_doCellIndexCheck
bool m_doCellIndexCheck
Check cell hash index consistency if true (default false)
Definition: CaloTopoTowerFromClusterMaker.h:74
CaloTopoTowerFromClusterMaker::m_buildCombinedSignal
bool m_buildCombinedSignal
Build topo-clusters within given range, else topo-towers.
Definition: CaloTopoTowerFromClusterMaker.h:75
CaloTowerCollectionProcessor.h
Base class for cluster processing tools called from CaloClusterMaker.
CaloTopoTowerFromClusterMaker::isValidIndex
bool isValidIndex(uint_t idx) const
Checks if argument is a valid index value.
Definition: CaloTopoTowerFromClusterMaker.h:146
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloProtoCluster.h
CaloTopoTowerFromClusterMaker::m_towerGeoKey
SG::ReadCondHandleKey< CaloTowerGeometry > m_towerGeoKey
the name of the key of the CaloTowerGeometry object in the ConditonsStore
Definition: CaloTopoTowerFromClusterMaker.h:65
CaloTopoTowerFromClusterMaker::m_excludedSamplings
std::vector< CaloSampling::CaloSample > m_excludedSamplings
List of excluded samplings (CaloSampling::CaloSample enumerators)
Definition: CaloTopoTowerFromClusterMaker.h:135
AthAlgTool.h
CaloTopoTowerFromClusterMaker::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: CaloTopoTowerFromClusterMaker.h:66
CaloTopoTowerFromClusterMaker::getClusterSize
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.
Definition: CaloTopoTowerFromClusterMaker.cxx:462
CaloTopoTowerFromClusterMaker::CaloTopoTowerFromClusterMaker
CaloTopoTowerFromClusterMaker(const std::string &type, const std::string &name, const IInterface *pParent)
Tool constructor.
Definition: CaloTopoTowerFromClusterMaker.cxx:50
CaloTopoTowerFromClusterMaker::buildInclTowers
uint_t buildInclTowers(const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
Inclusive towers.
Definition: CaloTopoTowerFromClusterMaker.cxx:401
CaloTopoTowerFromClusterMaker::addCellToProtoCluster
bool addCellToProtoCluster(const CaloTowerGeometry *towerGeo, const CaloCell *cptr, protocont_t &pProtoCont, double weight=1.) const
Adding cells to proto-clusters.
Definition: CaloTopoTowerFromClusterMaker.cxx:437
CaloTowerCollectionProcessor
Definition: CaloTowerCollectionProcessor.h:31
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CaloTopoTowerFromClusterMaker::m_prepareLCW
bool m_prepareLCW
Prepare LCW calibration, default is false.
Definition: CaloTopoTowerFromClusterMaker.h:71
ReadCondHandleKey.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
CaloTopoTowerFromClusterMaker::initialize
virtual StatusCode initialize() override
Setting up the operational mode and corresponding parameters.
Definition: CaloTopoTowerFromClusterMaker.cxx:78
CaloTopoTowerFromClusterMaker
A cluster builder tool forming topo-clusters representing calorimeter tower signals on a regular grid...
Definition: CaloTopoTowerFromClusterMaker.h:38
CaloTopoTowerFromClusterMaker::m_errorValueUINT
static const uint_t m_errorValueUINT
Error value for uint_t type values.
Definition: CaloTopoTowerFromClusterMaker.h:89
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloTopoTowerFromClusterMaker::uint_t
std::size_t uint_t
Unsigned integral type.
Definition: CaloTopoTowerFromClusterMaker.h:58
CaloTowerGeometry
Tower geometry store and description provider.
Definition: CaloTowerGeometry.h:23
CaloTopoTowerFromClusterMaker::m_excludedSamplingsName
std::vector< std::string > m_excludedSamplingsName
List of excluded samplings (human-readable names)
Definition: CaloTopoTowerFromClusterMaker.h:136
CaloTopoTowerFromClusterMaker::m_numberOfSamplings
uint_t m_numberOfSamplings
Number of samplings.
Definition: CaloTopoTowerFromClusterMaker.h:85
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloTopoTowerFromClusterMaker::m_removeSamplingData
bool m_removeSamplingData
Remove sampling data for towers.
Definition: CaloTopoTowerFromClusterMaker.h:78
CaloCellClusterWeights
Hash lookup of calibration weights for calorimeter cells.
Definition: CaloCellClusterWeights.h:23
SG::ReadCondHandleKey< CaloTowerGeometry >
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloTopoTowerFromClusterMaker::m_clusterRangeDef
static const double m_clusterRangeDef
Default cluster range.
Definition: CaloTopoTowerFromClusterMaker.h:88
CaloTopoTowerFromClusterMaker::badIndexValue
uint_t badIndexValue() const
Returns value indicating a bad index.
Definition: CaloTopoTowerFromClusterMaker.h:145
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
CaloClusterContainer.h
CaloTopoTowerFromClusterMaker::buildEMTopoTowers
uint_t buildEMTopoTowers(const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont) const
EM topo-towers.
Definition: CaloTopoTowerFromClusterMaker.cxx:304
CaloTopoTowerFromClusterMaker::execute
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.
Definition: CaloTopoTowerFromClusterMaker.cxx:183
CaloTopoTowerFromClusterMaker::m_excludedSamplingsPattern
std::bitset< _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE > m_excludedSamplingsPattern
Bit pattern indicates if sampling is excluded.
Definition: CaloTopoTowerFromClusterMaker.h:137
CaloTowerGeometry.h
CaloTopoTowerFromClusterMaker::finalize
virtual StatusCode finalize() override
Finalize the tool (no action)
Definition: CaloTopoTowerFromClusterMaker.cxx:180
AthAlgTool
Definition: AthAlgTool.h:26
CaloTopoTowerFromClusterMaker::m_useCellsFromClusters
bool m_useCellsFromClusters
Use cells from topo-clusters if true, else use all cells, default is true.
Definition: CaloTopoTowerFromClusterMaker.h:72
CaloTopoTowerFromClusterMaker::cleanupCells
int cleanupCells(const CaloTowerGeometry *towerGeo, CaloClusterCellLink *clk, uint_t nclus) const
Checks CaloClusterCellLink for consistency.
Definition: CaloTopoTowerFromClusterMaker.cxx:475
CaloTopoTowerFromClusterMaker::m_energyThreshold
double m_energyThreshold
Cell energy threshold, default is set in m_energyThresholdDef.
Definition: CaloTopoTowerFromClusterMaker.h:76
CaloCellClusterWeights.h