ATLAS Offline Software
DataPreparationAlg.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_DATA_PREPARATION_ALG_H
6 #define ACTSTRK_DATA_PREPARATION_ALG_H
7 
10 #include "GaudiKernel/ToolHandle.h"
18 
19 #include <set>
20 
21 // Cache
24 #include "src/Cache.h"
25 
26 namespace ActsTrk {
27 
28  template <typename external_collection_t,
29  typename external_detector_element_collection_t,
30  bool useCache>
32  : public AthReentrantAlgorithm {
33  public:
34  using object_t = typename external_collection_t::base_value_type;
35  using input_collection_t = external_collection_t;
37 
40 
41  DataPreparationAlg(const std::string& name, ISvcLocator* pSvcLocator);
42  virtual ~DataPreparationAlg() override = default;
43 
44  virtual StatusCode initialize() override;
45  virtual StatusCode execute(const EventContext& ctx) const override;
46  virtual StatusCode finalize() override;
47 
48  protected:
50 
51  // Common way of fetching the hash ids from the RoI(s)
52  virtual StatusCode fetchIdHashes(const EventContext& ctx,
53  std::set<IdentifierHash>& hashes) const;
54 
55  private:
56  // Different ways of filling the output collection
57  StatusCode fill(const EventContext& ctx,
59 
60  StatusCode fill(const EventContext& ctx,
62  requires (useCache == true);
63 
64  protected:
65  ToolHandle< GenericMonitoringTool > m_monTool {this, "MonTool", "",
66  "Monitoring tool"};
67 
68  ToolHandle<IRegSelTool> m_regionSelector {this, "RegSelTool", "",
69  "Region selector tool"};
70 
72  "Key of input DetectorElementCollection"};
73 
75  "Input Collection that will go throug selection process"};
76 
78  "RoIs to read in"};
79 
81  "Map of used measurements from previous tracking pass"};
82 
84  "Output Collection - result of the selection process"};
85 
87  "The input IDC container"};
88 
89  private:
90  enum EStat {
93  kNStat
94  };
95 
96  mutable std::array<std::atomic<unsigned int>, kNStat> m_stat ATLAS_THREAD_SAFE {};
97  };
98 
99 } // namespace
100 
101 #include "DataPreparationAlg.icc"
102 
103 #endif
python.root_lsr_rank.hashes
hashes
Definition: root_lsr_rank.py:34
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
IRegSelTool.h
ActsTrk::DataPreparationAlg::m_detEleCollKey
SG::ReadCondHandleKey< external_detector_element_collection_t > m_detEleCollKey
Definition: DataPreparationAlg.h:71
ActsTrk::DataPreparationAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: DataPreparationAlg.h:65
IdentifiableCache.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
ActsTrk::DataPreparationAlg::m_regionSelector
ToolHandle< IRegSelTool > m_regionSelector
Definition: DataPreparationAlg.h:68
ActsTrk::DataPreparationAlg< xAOD::SpacePointContainer, InDetDD::SiDetectorElementCollection, true >::cache_read_handle_key_t
typename ActsTrk::Cache::Handles< object_t >::ReadHandleKey cache_read_handle_key_t
Definition: DataPreparationAlg.h:38
ActsTrk::DataPreparationAlg::m_outputCollectionKey
SG::WriteHandleKey< output_collection_t > m_outputCollectionKey
Definition: DataPreparationAlg.h:83
ActsTrk::DataPreparationAlg::kNStat
@ kNStat
Definition: DataPreparationAlg.h:93
ActsTrk::DataPreparationAlg::kNOutputs
@ kNOutputs
Definition: DataPreparationAlg.h:92
ActsTrk::DataPreparationAlg::kNInputs
@ kNInputs
Definition: DataPreparationAlg.h:91
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
ActsTrk::DataPreparationAlg
Definition: DataPreparationAlg.h:32
ActsTrk::DataPreparationAlg< xAOD::SpacePointContainer, InDetDD::SiDetectorElementCollection, true >::object_t
typename external_collection_t::base_value_type object_t
Definition: DataPreparationAlg.h:34
ActsTrk::DataPreparationAlg::m_inputPrdMap
SG::ReadHandleKey< ActsTrk::PrepRawDataAssociation > m_inputPrdMap
Definition: DataPreparationAlg.h:80
ActsTrk::DataPreparationAlg::fill
StatusCode fill(const EventContext &ctx, output_collection_t &outputCollection) const
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ActsTrk::DataPreparationAlg::finalize
virtual StatusCode finalize() override
GenericMonitoringTool.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
ActsTrk::DataPreparationAlg::DataPreparationAlg
DataPreparationAlg(const std::string &name, ISvcLocator *pSvcLocator)
ActsTrk::DataPreparationAlg::m_roiCollectionKey
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Definition: DataPreparationAlg.h:77
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PrepRawDataAssociation.h
MeasurementDefs.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ReadCondHandleKey.h
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
postInclude.outputCollection
outputCollection
Definition: postInclude.SortInput.py:27
ActsTrk::DataPreparationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::DetectorIDHashType
unsigned int DetectorIDHashType
@ detector ID element hash
Definition: MeasurementDefs.h:42
Cache.h
ActsTrk::DataPreparationAlg< xAOD::SpacePointContainer, InDetDD::SiDetectorElementCollection, true >::cache_read_handle_t
typename ActsTrk::Cache::Handles< object_t >::ReadHandle cache_read_handle_t
Definition: DataPreparationAlg.h:39
ActsTrk::DataPreparationAlg::initialize
virtual StatusCode initialize() override
SG::ReadCondHandleKey< external_detector_element_collection_t >
DataPrepConfig.useCache
useCache
Definition: DataPrepConfig.py:100
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
ActsTrk::DataPreparationAlg::~DataPreparationAlg
virtual ~DataPreparationAlg() override=default
ActsTrk::DataPreparationAlg< xAOD::SpacePointContainer, InDetDD::SiDetectorElementCollection, true >::EStat
EStat
Definition: DataPreparationAlg.h:90
DataPreparationAlg.icc
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
ActsTrk::DataPreparationAlg::retrieveDetectorIDHash
virtual xAOD::DetectorIDHashType retrieveDetectorIDHash(const object_t &obj) const
ActsTrk::DataPreparationAlg::fetchIdHashes
virtual StatusCode fetchIdHashes(const EventContext &ctx, std::set< IdentifierHash > &hashes) const
python.PyAthena.obj
obj
Definition: PyAthena.py:132
ActsTrk::DataPreparationAlg::fill
StatusCode fill(const EventContext &ctx, output_collection_t &outputCollection) const requires(useCache
ActsTrk::DataPreparationAlg::m_inputCollectionKey
SG::ReadHandleKey< input_collection_t > m_inputCollectionKey
Definition: DataPreparationAlg.h:74
ActsTrk::DataPreparationAlg::ATLAS_THREAD_SAFE
std::array< std::atomic< unsigned int >, kNStat > m_stat ATLAS_THREAD_SAFE
Definition: DataPreparationAlg.h:96
TrigRoiDescriptorCollection.h
ActsTrk::DataPreparationAlg::m_inputIdentifiableContainer
cache_read_handle_key_t m_inputIdentifiableContainer
Definition: DataPreparationAlg.h:86
IdentifiableContainer.h
This class is a general container which can hold objects of accessed by an IdentifierHash For more in...