ATLAS Offline Software
HgtdClusterizationAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 namespace ActsTrk {
10 
12  ISvcLocator* pSvcLocator)
13  : AthReentrantAlgorithm(name, pSvcLocator)
14  {}
15 
17  {
18  ATH_MSG_DEBUG("Initializing " << name() << " ...");
19  ATH_CHECK(m_clusteringTool.retrieve());
20  ATH_CHECK(m_monTool.retrieve(EnableTool{not m_monTool.empty()}));
21 
23  ATH_CHECK(m_clusterContainerKey.initialize());
24 
25  return StatusCode::SUCCESS;
26 
27  }
28 
29  StatusCode HgtdClusterizationAlg::execute(const EventContext& ctx) const
30  {
31  ATH_MSG_DEBUG("Executing " << name() << " ...");
32 
33  auto timer = Monitored::Timer<std::chrono::milliseconds>( "TIME_execute" );
35 
37  if (!rdoContainer.isValid()) {
38  ATH_MSG_ERROR("Failed to retrieve HGTD RDO container");
39  return StatusCode::FAILURE;
40  }
41 
43  ATH_CHECK(clusterContainer.record(std::make_unique<xAOD::HGTDClusterContainer>(),
44  std::make_unique<xAOD::HGTDClusterAuxContainer>()));
45 
46  for (const auto rdoCollection : *rdoContainer) {
47  if (rdoCollection->empty()) {
48  continue;
49  }
50 
51  ATH_CHECK(m_clusteringTool->clusterize(*rdoCollection, ctx, *clusterContainer));
52  }
53 
54  return StatusCode::SUCCESS;
55  }
56 
57 
58 }
ActsTrk::HgtdClusterizationAlg::m_clusteringTool
ToolHandle< IHGTDClusteringTool > m_clusteringTool
Definition: HgtdClusterizationAlg.h:31
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
HgtdClusterizationAlg.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
ActsTrk::HgtdClusterizationAlg::initialize
virtual StatusCode initialize() override
Definition: HgtdClusterizationAlg.cxx:16
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HGTD_DetectorElement.h
ActsTrk::HgtdClusterizationAlg::HgtdClusterizationAlg
HgtdClusterizationAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HgtdClusterizationAlg.cxx:11
ActsTrk::HgtdClusterizationAlg::m_rdoContainerKey
SG::ReadHandleKey< HGTD_RDO_Container > m_rdoContainerKey
Definition: HgtdClusterizationAlg.h:34
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
plotBeamSpotMon.mon
mon
Definition: plotBeamSpotMon.py:67
ActsTrk::HgtdClusterizationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: HgtdClusterizationAlg.cxx:29
ActsTrk::HgtdClusterizationAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: HgtdClusterizationAlg.h:32
ActsTrk::HgtdClusterizationAlg::m_clusterContainerKey
SG::WriteHandleKey< xAOD::HGTDClusterContainer > m_clusterContainerKey
Definition: HgtdClusterizationAlg.h:35
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32