ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataWrite
src
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$
11
12
13
#include "
xAODTestWriteSymlinks.h
"
14
#include "
StoreGate/WriteHandle.h
"
15
#include "
StoreGate/ReadHandle.h
"
16
17
18
namespace
DMTest
{
19
20
26
xAODTestWriteSymlinks::xAODTestWriteSymlinks
(
const
std::string &name,
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
39
StatusCode
xAODTestWriteSymlinks::initialize
()
40
{
41
m_s1Key
=
m_s2Key
.key();
42
43
ATH_CHECK
(
m_s2Key
.initialize() );
44
ATH_CHECK
(
m_s1Key
.initialize() );
45
ATH_CHECK
(
m_aliasKey
.initialize() );
46
return
StatusCode::SUCCESS;
47
}
48
49
53
StatusCode
xAODTestWriteSymlinks::execute
(
const
EventContext& ctx)
const
54
{
55
SG::WriteHandle<DMTest::S2>
s2 (
m_s2Key
, ctx);
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
DMTest::xAODTestWriteSymlinks::m_s2Key
SG::WriteHandleKey< DMTest::S2 > m_s2Key
Main output.
Definition
xAODTestWriteSymlinks.h:57
DMTest::xAODTestWriteSymlinks::xAODTestWriteSymlinks
xAODTestWriteSymlinks(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
xAODTestWriteSymlinks.cxx:26
DMTest::xAODTestWriteSymlinks::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
xAODTestWriteSymlinks.cxx:39
DMTest::xAODTestWriteSymlinks::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
xAODTestWriteSymlinks.cxx:53
DMTest::xAODTestWriteSymlinks::m_aliasKey
SG::WriteHandleKey< DMTest::S2 > m_aliasKey
Alias.
Definition
xAODTestWriteSymlinks.h:63
DMTest::xAODTestWriteSymlinks::m_s1Key
SG::WriteHandleKey< DMTest::S1 > m_s1Key
Symlink.
Definition
xAODTestWriteSymlinks.h:60
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
DMTest
Definition
B.h:23
xAODTestWriteSymlinks.h
Testing making symlinks/aliases through handles.
Generated on
for ATLAS Offline Software by
1.17.0