ATLAS Offline Software
RegionsOfInterestCreatorAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace ActsTrk {
8 
10  ISvcLocator* pSvcLocator)
11  : AthReentrantAlgorithm(name, pSvcLocator)
12 {}
13 
15 {
16  ATH_MSG_DEBUG("Initialising " << name() << " ...");
17 
19  ATH_CHECK(m_roiTool.retrieve());
20 
21  return StatusCode::SUCCESS;
22 }
23 
24 StatusCode RegionsOfInterestCreatorAlg::execute(const EventContext& ctx) const
25 {
26  ATH_MSG_DEBUG("Executing " << name() << " ...");
27 
28  ATH_MSG_DEBUG("Creating ROI with key " << m_roiCollectionKey.key());
30  ATH_CHECK( roiCollectionHandle.record( std::make_unique< TrigRoiDescriptorCollection >() ) );
31  TrigRoiDescriptorCollection *collectionRoI = roiCollectionHandle.ptr();
32  ATH_CHECK(collectionRoI != nullptr);
33 
34  ATH_CHECK( m_roiTool->defineRegionsOfInterest(ctx, *collectionRoI) );
35  return StatusCode::SUCCESS;
36 }
37 
38 }
ActsTrk::RegionsOfInterestCreatorAlg::RegionsOfInterestCreatorAlg
RegionsOfInterestCreatorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: RegionsOfInterestCreatorAlg.cxx:9
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
ActsTrk::RegionsOfInterestCreatorAlg::m_roiTool
ToolHandle< ActsTrk::IRoICreatorTool > m_roiTool
Definition: RegionsOfInterestCreatorAlg.h:25
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
ActsTrk::RegionsOfInterestCreatorAlg::m_roiCollectionKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roiCollectionKey
Definition: RegionsOfInterestCreatorAlg.h:28
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::RegionsOfInterestCreatorAlg::initialize
virtual StatusCode initialize() override
Definition: RegionsOfInterestCreatorAlg.cxx:14
SG::WriteHandle< TrigRoiDescriptorCollection >
ActsTrk::RegionsOfInterestCreatorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: RegionsOfInterestCreatorAlg.cxx:24
RegionsOfInterestCreatorAlg.h
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
TrigRoiDescriptorCollection
Definition: TrigRoiDescriptorCollection.h:21
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34