ATLAS Offline Software
CaloClusterROIPhiRZContainerMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDET_CALOCLUSTERROIPHIRZCOLLECTIONMAKER_H
6 #define INDET_CALOCLUSTERROIPHIRZCOLLECTIONMAKER_H
7 
9 
12 
15 
18 
20 
22 
23 
24 #include <atomic>
25 
26 namespace InDet {
27 
33 {
34  public:
35 
36  CaloClusterROIPhiRZContainerMaker(const std::string& name, ISvcLocator* pSvcLocator);
37 
39 
40  StatusCode initialize() override;
41  StatusCode finalize() override;
42  StatusCode execute(const EventContext& ctx) const override;
43 
44  private:
45 
47  const CaloDetDescrManager &caloDDMgr) const
48  {
49  // Determine if we want to extrapolate to the barrel or endcap. If in the
50  // crack choose the detector with largest amount of energy in the second
51  // sampling layer
52  if (xAOD::EgammaHelpers::isBarrel(&cluster)) {
53  return m_calosurf->CreateUserSurface(CaloCell_ID::EMB2, 0., cluster.eta(), &caloDDMgr);
54  } else {
55  return m_calosurf->CreateUserSurface(CaloCell_ID::EME2, 0., cluster.eta(), &caloDDMgr);
56  }
57  }
58 
60  const Trk::Surface &surf) ;
61 
62  void addROI( const xAOD::CaloCluster &cluster,
63  const CaloDetDescrManager &caloDDMgr,
64  ROIPhiRZContainer &output_rois,
65  std::vector<uint_fast8_t> &max_output,
66  std::vector<unsigned int> &n_rois) const;
67 
70  {this, "InputClusterContainerName", "egammaTopoCluster", "Input cluster for egamma objects"};
71 
74  {this, "OutputROIContainerName", {}, "Output collection of eta ordered ROIs"};
75 
80  { this,"CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" };
81 
83  ToolHandle<ICaloSurfaceBuilder> m_calosurf
84  { this, "CaloSurfaceBuilder", "CaloSurfaceBuilder", "Tool to build calorimeter layer surfaces"};
85 
87  ToolHandle<IegammaCaloClusterSelector> m_egammaCaloClusterSelector
88  {this, "egammaCaloClusterSelector", "egammaCaloClusterSelector","Tool that makes the cluster selection"};
89 
90  Gaudi::Property< bool > m_EMEnergyOnly
91  {this, "EMEnergyOnly", false, "Only use EM energy as the ROI energy" };
92 
93  Gaudi::Property< std::vector<float> > m_phiWidth
94  {this, "phiWidth", {} };
95 
96  Gaudi::Property< std::vector<float> > m_minPtEm
97  {this, "minPt", {}, "Minimum pt of cluster ROIs (EMFraction corrected if EMEnerygOnly is set)."};
98 
99  std::vector<unsigned int> m_outputIndex;
100  std::vector<unsigned int> m_outputSorted;
101  std::vector<unsigned int> m_outputUnsorted;
102  std::vector<float> m_sortedMinPtEm;
103  float m_maxPhiWidth = 0.0F;
104 
105  mutable std::atomic_uint m_allClusters{0};
106  mutable std::atomic_uint m_selectedClusters{0};
107  mutable std::atomic_uint m_duplicateROI{0};
108  mutable std::atomic_uint m_maxNROIs{0};
109 };
110 
111 } //End namespace
112 #endif
Trk::LocalParameters
Definition: LocalParameters.h:98
InDet::CaloClusterROIPhiRZContainerMaker::m_minPtEm
Gaudi::Property< std::vector< float > > m_minPtEm
Definition: CaloClusterROIPhiRZContainerMaker.h:97
InDet::CaloClusterROIPhiRZContainerMaker::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Name of the CaloDetDescrManager condition object.
Definition: CaloClusterROIPhiRZContainerMaker.h:80
InDet::CaloClusterROIPhiRZContainerMaker::m_outputClusterContainerName
SG::WriteHandleKeyArray< ROIPhiRZContainer > m_outputClusterContainerName
Name of the ROI output collection.
Definition: CaloClusterROIPhiRZContainerMaker.h:74
InDet::CaloClusterROIPhiRZContainerMaker::m_maxNROIs
std::atomic_uint m_maxNROIs
Definition: CaloClusterROIPhiRZContainerMaker.h:108
InDet::CaloClusterROIPhiRZContainerMaker::m_selectedClusters
std::atomic_uint m_selectedClusters
Definition: CaloClusterROIPhiRZContainerMaker.h:106
IegammaCaloClusterSelector.h
ROIPhiRZContainer
container for phi sorted ROIs defined by phi, r and z.
Definition: ROIPhiRZContainer.h:50
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
InDet::CaloClusterROIPhiRZContainerMaker::m_egammaCaloClusterSelector
ToolHandle< IegammaCaloClusterSelector > m_egammaCaloClusterSelector
Tool to filter the calo clusters.
Definition: CaloClusterROIPhiRZContainerMaker.h:88
InDet::CaloClusterROIPhiRZContainerMaker::m_maxPhiWidth
float m_maxPhiWidth
Definition: CaloClusterROIPhiRZContainerMaker.h:103
SG::ReadHandleKey< xAOD::CaloClusterContainer >
InDet::CaloClusterROIPhiRZContainerMaker::getClusterLocalParameters
static Trk::LocalParameters getClusterLocalParameters(const xAOD::CaloCluster &cluster, const Trk::Surface &surf)
Definition: CaloClusterROIPhiRZContainerMaker.cxx:192
InDet::CaloClusterROIPhiRZContainerMaker::execute
StatusCode execute(const EventContext &ctx) const override
Definition: CaloClusterROIPhiRZContainerMaker.cxx:99
InDet::CaloClusterROIPhiRZContainerMaker::finalize
StatusCode finalize() override
Definition: CaloClusterROIPhiRZContainerMaker.cxx:88
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
InDet::CaloClusterROIPhiRZContainerMaker::m_sortedMinPtEm
std::vector< float > m_sortedMinPtEm
Definition: CaloClusterROIPhiRZContainerMaker.h:102
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
xAOD::EgammaHelpers::isBarrel
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
Definition: EgammaxAODHelpers.cxx:33
InDet::CaloClusterROIPhiRZContainerMaker::m_outputUnsorted
std::vector< unsigned int > m_outputUnsorted
Definition: CaloClusterROIPhiRZContainerMaker.h:101
InDet::CaloClusterROIPhiRZContainerMaker::addROI
void addROI(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDDMgr, ROIPhiRZContainer &output_rois, std::vector< uint_fast8_t > &max_output, std::vector< unsigned int > &n_rois) const
Definition: CaloClusterROIPhiRZContainerMaker.cxx:225
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
EgammaxAODHelpers.h
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
InDet::CaloClusterROIPhiRZContainerMaker::m_outputIndex
std::vector< unsigned int > m_outputIndex
Definition: CaloClusterROIPhiRZContainerMaker.h:99
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::CaloClusterROIPhiRZContainerMaker::m_duplicateROI
std::atomic_uint m_duplicateROI
Definition: CaloClusterROIPhiRZContainerMaker.h:107
InDet::CaloClusterROIPhiRZContainerMaker::initialize
StatusCode initialize() override
Definition: CaloClusterROIPhiRZContainerMaker.cxx:35
InDet::CaloClusterROIPhiRZContainerMaker::CaloClusterROIPhiRZContainerMaker
CaloClusterROIPhiRZContainerMaker(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CaloClusterROIPhiRZContainerMaker.cxx:24
ROIPhiRZContainer.h
InDet::CaloClusterROIPhiRZContainerMaker::m_calosurf
ToolHandle< ICaloSurfaceBuilder > m_calosurf
Tool to build calorimeter layer surfaces.
Definition: CaloClusterROIPhiRZContainerMaker.h:84
ReadCondHandleKey.h
AthReentrantAlgorithm.h
InDet::CaloClusterROIPhiRZContainerMaker::m_inputClusterContainerName
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inputClusterContainerName
Name of the cluster intput collection.
Definition: CaloClusterROIPhiRZContainerMaker.h:70
ICaloSurfaceBuilder.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LocalParameters.h
InDet::CaloClusterROIPhiRZContainerMaker::m_outputSorted
std::vector< unsigned int > m_outputSorted
Definition: CaloClusterROIPhiRZContainerMaker.h:100
SG::ReadCondHandleKey< CaloDetDescrManager >
InDet::CaloClusterROIPhiRZContainerMaker::getCaloSurface
const Trk::Surface * getCaloSurface(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDDMgr) const
Definition: CaloClusterROIPhiRZContainerMaker.h:46
InDet::CaloClusterROIPhiRZContainerMaker::m_EMEnergyOnly
Gaudi::Property< bool > m_EMEnergyOnly
Definition: CaloClusterROIPhiRZContainerMaker.h:91
InDet::CaloClusterROIPhiRZContainerMaker::~CaloClusterROIPhiRZContainerMaker
~CaloClusterROIPhiRZContainerMaker()
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloClusterContainer.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
InDet::CaloClusterROIPhiRZContainerMaker::m_phiWidth
Gaudi::Property< std::vector< float > > m_phiWidth
Definition: CaloClusterROIPhiRZContainerMaker.h:94
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
InDet::CaloClusterROIPhiRZContainerMaker::m_allClusters
std::atomic_uint m_allClusters
Definition: CaloClusterROIPhiRZContainerMaker.h:105
InDet::CaloClusterROIPhiRZContainerMaker
Algorithm to create a eta ordered ROIs in the eta phi plane.
Definition: CaloClusterROIPhiRZContainerMaker.h:33