ATLAS Offline Software
ClusterizationAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSTRK_DATAPREPARATION_CLUSTERIZATIONALG_H
6 #define ACTSTRK_DATAPREPARATION_CLUSTERIZATIONALG_H
7 
10 #include <GaudiKernel/ToolHandle.h>
15 #include "src/Cache.h"
17 
18 namespace ActsTrk {
19 
20 template <typename IClusteringTool, bool useCache>
22 public:
23  using RDOContainer = typename IClusteringTool::RDOContainer;
24  using RawDataCollection = typename RDOContainer::base_value_type;
25  using ClusterContainer = typename IClusteringTool::ClusterContainer;
26  using ClusterAuxContainer = typename IClusteringTool::ClusterAuxContainer;
27  using IDHelper = typename IClusteringTool::IDHelper;
28  using BaseClusterType = typename ClusterContainer::base_value_type;
29 
30  //cache related handles
37 
38  ClusterizationAlg(const std::string& name, ISvcLocator* pSvcLocator);
39  virtual ~ClusterizationAlg() = default;
40  virtual StatusCode initialize() override;
41  virtual StatusCode execute(const EventContext& ctx) const override;
42  virtual StatusCode finalize() override;
43 
44 private:
45  ToolHandle<IClusteringTool> m_clusteringTool {this, "ClusteringTool", "",
46  "Clustering Tool"};
47 
48  ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "",
49  "Monitoring tool"};
50 
51  ToolHandle<IRegSelTool> m_regionSelector {this, "RegSelTool", "",
52  "Region selector tool"};
53 
56 
57  SG::ReadHandleKey<RDOContainer> m_rdoContainerKey {this, "RDOContainerKey", "",
58  "Input RDO container key"};
59 
61  "RoIs to read in"};
62 
64  "Key of output xAOD pixel cluster container"};
65 
66  Cache_WriteHandleKey m_ClusterCache{this,"ClusterCache",""};
67  Cache_BackendUpdateHandleKey m_ClusterCacheBackend{this,"ClusterCacheBackend",""};
68 
69  // expected number of clusters for RDO
70  // This values is used for reserving enough memory of the cluster container
71  // reserve = m_expectedClustersPerRDO * nRDOs
72  // The default values has been computed on a tt-bar PU200 sample
73  // comparing the memory usage and the container capacity
74  Gaudi::Property<int> m_expectedClustersPerRDO {this, "expectedClustersPerRDO", 32,
75  "Expected number of clusters for RDO"};
76 
77  Gaudi::Property<std::string> m_idHelperName {this, "IDHelper", "",
78  "Name of ID helper to fetch from detstore" };
79 
80  const IDHelper* m_idHelper = nullptr;
81 
82 private:
83  enum EStat {
86  kNStat
87  };
88 
89  mutable std::array<std::atomic<unsigned int>, kNStat> m_stat ATLAS_THREAD_SAFE {};
90 };
91 
92 } // namespace ActsTrk
93 
94 #include "ClusterizationAlg.icc"
95 
96 #endif
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::ClusterContainer
typename IClusteringTool::ClusterContainer ClusterContainer
Definition: ClusterizationAlg.h:25
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
IRegSelTool.h
ActsTrk::ClusterizationAlg::m_detEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_detEleCollKey
Definition: ClusterizationAlg.h:54
ActsTrk::ClusterizationAlg::kNClusters
@ kNClusters
Definition: ClusterizationAlg.h:85
ActsTrk::ClusterizationAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: ClusterizationAlg.h:48
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::IDHelper
typename IClusteringTool::IDHelper IDHelper
Definition: ClusterizationAlg.h:27
SG::UpdateHandleKey
Property holding a SG store/key/clid from which an UpdateHandle is made.
Definition: UpdateHandleKey.h:40
ActsTrk::ClusterizationAlg::m_clusteringTool
ToolHandle< IClusteringTool > m_clusteringTool
Definition: ClusterizationAlg.h:45
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::RawDataCollection
typename RDOContainer::base_value_type RawDataCollection
Definition: ClusterizationAlg.h:24
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::Cache_BackendUpdateHandleKey
typename Cache::Handles< BaseClusterType >::BackendUpdateHandleKey Cache_BackendUpdateHandleKey
Definition: ClusterizationAlg.h:31
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::Cache_WriteHandleKey
typename Cache::Handles< BaseClusterType >::WriteHandleKey Cache_WriteHandleKey
Definition: ClusterizationAlg.h:33
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::RDOContainer
typename IClusteringTool::RDOContainer RDOContainer
Definition: ClusterizationAlg.h:23
ActsTrk::ClusterizationAlg::m_clusterContainerKey
SG::WriteHandleKey< ClusterContainer > m_clusterContainerKey
Definition: ClusterizationAlg.h:63
ActsTrk::ClusterizationAlg::m_rdoContainerKey
SG::ReadHandleKey< RDOContainer > m_rdoContainerKey
Definition: ClusterizationAlg.h:57
ActsTrk::ClusterizationAlg::m_expectedClustersPerRDO
Gaudi::Property< int > m_expectedClustersPerRDO
Definition: ClusterizationAlg.h:74
SG::ReadHandleKey< InDet::SiDetectorElementStatus >
ActsTrk::ClusterizationAlg::ClusterizationAlg
ClusterizationAlg(const std::string &name, ISvcLocator *pSvcLocator)
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::BaseClusterType
typename ClusterContainer::base_value_type BaseClusterType
Definition: ClusterizationAlg.h:28
ActsTrk::ClusterizationAlg::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned int >, kNStat > m_stat ATLAS_THREAD_SAFE
Definition: ClusterizationAlg.h:89
ActsTrk::ClusterizationAlg::~ClusterizationAlg
virtual ~ClusterizationAlg()=default
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
ActsTrk::ClusterizationAlg::m_regionSelector
ToolHandle< IRegSelTool > m_regionSelector
Definition: ClusterizationAlg.h:51
ActsTrk::ClusterizationAlg::kNRdo
@ kNRdo
Definition: ClusterizationAlg.h:84
ActsTrk::ClusterizationAlg::m_ClusterCacheBackend
Cache_BackendUpdateHandleKey m_ClusterCacheBackend
Definition: ClusterizationAlg.h:67
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::Cache_IDCLock
typename Cache::Handles< BaseClusterType >::IDC::IDC_WriteHandle Cache_IDCLock
Definition: ClusterizationAlg.h:36
GenericMonitoringTool.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::EStat
EStat
Definition: ClusterizationAlg.h:83
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::ClusterizationAlg::m_idHelper
const IDHelper * m_idHelper
Definition: ClusterizationAlg.h:80
IdentifiableContainerMT::IDC_WriteHandle
Definition: IdentifiableContainerMT.h:34
ActsTrk::ClusterizationAlg::finalize
virtual StatusCode finalize() override
ActsTrk::ClusterizationAlg::initialize
virtual StatusCode initialize() override
ActsTrk::ClusterizationAlg::m_ClusterCache
Cache_WriteHandleKey m_ClusterCache
Definition: ClusterizationAlg.h:66
ActsTrk::ClusterizationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::Cache_WriteHandle
typename Cache::Handles< BaseClusterType >::WriteHandle Cache_WriteHandle
Definition: ClusterizationAlg.h:34
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Cache.h
SG::UpdateHandle
Definition: UpdateHandle.h:91
ActsTrk::ClusterizationAlg
Definition: ClusterizationAlg.h:21
ClusterizationAlg.icc
SiDetectorElementCollection.h
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::ClusterAuxContainer
typename IClusteringTool::ClusterAuxContainer ClusterAuxContainer
Definition: ClusterizationAlg.h:26
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::Cache_IDC
typename Cache::Handles< BaseClusterType >::IDC Cache_IDC
Definition: ClusterizationAlg.h:35
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MSTrackingVolumeBuilder.cxx:24
IdentifiableContainerMT
Definition: IdentifiableContainerMT.h:30
ActsTrk::ClusterizationAlg::kNStat
@ kNStat
Definition: ClusterizationAlg.h:86
ActsTrk::ClusterizationAlg::m_detElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_detElStatus
Definition: ClusterizationAlg.h:55
ActsTrk::ClusterizationAlg::m_idHelperName
Gaudi::Property< std::string > m_idHelperName
Definition: ClusterizationAlg.h:77
TrigRoiDescriptorCollection.h
ActsTrk::ClusterizationAlg< IPixelClusteringTool, false >::Cache_BackendUpdateHandle
typename Cache::Handles< BaseClusterType >::BackendUpdateHandle Cache_BackendUpdateHandle
Definition: ClusterizationAlg.h:32
ActsTrk::ClusterizationAlg::m_roiCollectionKey
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Definition: ClusterizationAlg.h:60