ATLAS Offline Software
TrkCollectionAliasAlg.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 // TrkCollectionAliasAlg.cxx, (c) ATLAS Detector software
8 
10 
11 //================ Constructor =================================================
12 
13 Trk::TrkCollectionAliasAlg::TrkCollectionAliasAlg(const std::string& name, ISvcLocator* pSvcLocator) :
14  AthReentrantAlgorithm(name,pSvcLocator) {}
15 
16 //================ Destructor =================================================
17 
19 = default;
20 
21 
22 //================ Initialisation =================================================
23 
25 {
26  ATH_CHECK( m_collectionName.initialize() );
27  ATH_CHECK( m_aliasName.initialize() );
28 
29  return StatusCode::SUCCESS;
30 }
31 
32 //================ Finalisation =================================================
33 
35 {
36  return StatusCode::SUCCESS;
37 }
38 
39 //================ Execution ====================================================
40 
41 StatusCode Trk::TrkCollectionAliasAlg::execute(const EventContext& ctx) const
42 {
43  SG::ReadHandle<TrackCollection> tracks(m_collectionName, ctx );
44  return tracks.alias(m_aliasName);
45 }
46 
47 //============================================================================================
48 
Trk::TrkCollectionAliasAlg::execute
StatusCode execute(const EventContext &ctx) const
standard Athena-Algorithm method
Definition: TrkCollectionAliasAlg.cxx:41
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Trk::TrkCollectionAliasAlg::finalize
StatusCode finalize()
standard Athena-Algorithm method
Definition: TrkCollectionAliasAlg.cxx:34
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrkCollectionAliasAlg.h
Trk::TrkCollectionAliasAlg::TrkCollectionAliasAlg
TrkCollectionAliasAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: TrkCollectionAliasAlg.cxx:13
Trk::TrkCollectionAliasAlg::~TrkCollectionAliasAlg
~TrkCollectionAliasAlg()
Default Destructor.
Trk::TrkCollectionAliasAlg::initialize
StatusCode initialize()
standard Athena-Algorithm method
Definition: TrkCollectionAliasAlg.cxx:24
SG::ReadHandle::alias
StatusCode alias(const WriteHandleKey< T > &key)
Make an alias.