ATLAS Offline Software
xAODTestWriteSymlinks.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
3  */
4 // $Id$
13 #include "xAODTestWriteSymlinks.h"
14 #include "StoreGate/WriteHandle.h"
15 #include "StoreGate/ReadHandle.h"
16 
17 
18 namespace DMTest {
19 
20 
27  ISvcLocator *pSvcLocator)
28  : AthReentrantAlgorithm (name, pSvcLocator)
29 {
30  declareProperty ("S2Key", m_s2Key = "S2");
31  declareProperty ("S1Key", m_s1Key = "S2");
32  declareProperty ("AliasKey", m_aliasKey = "S2alias");
33 }
34 
35 
40 {
41  m_s1Key = m_s2Key.key();
42 
46  return StatusCode::SUCCESS;
47 }
48 
49 
53 StatusCode xAODTestWriteSymlinks::execute (const EventContext& ctx) const
54 {
56  unsigned int eventNumber = ctx.eventID().event_number();
57  ATH_CHECK( s2.record (std::make_unique<DMTest::S2> (eventNumber*100)) );
58  ATH_CHECK( s2.alias (m_aliasKey) );
59  ATH_CHECK( s2.symLink (m_s1Key) );
60  return StatusCode::SUCCESS;
61 }
62 
63 
64 } // namespace DMTest
65 
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
WriteHandle.h
Handle class for recording to StoreGate.
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
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
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
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
ReadHandle.h
Handle class for reading from StoreGate.
DMTest
Definition: B.h:23