ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
AtlasTest
DatabaseTest
AthenaPoolTest
src
EventInfoReader.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
13
14
#include "
EventInfoReader.h
"
15
16
// Constructor with parameters:
17
EventInfoReader::EventInfoReader
(
const
std::string &name,
18
ISvcLocator *pSvcLocator) :
19
AthReentrantAlgorithm
(name,pSvcLocator),
20
m_geoModel
(
"GeoModelSvc"
, name),
21
m_tagInfoMgr
(
"TagInfoMgr"
, name)
22
{}
23
24
// Initialize method:
25
StatusCode
EventInfoReader::initialize
()
26
{
27
ATH_MSG_INFO
(
"EventInfoReader::initialize()"
);
28
ATH_CHECK
(
m_geoModel
.retrieve() );
29
ATH_CHECK
(
m_tagInfoMgr
.retrieve() );
30
ATH_CHECK
(
m_eventInfoKey
.initialize() );
31
return
StatusCode::SUCCESS;
32
}
33
34
// Execute method:
35
StatusCode
EventInfoReader::execute
(
const
EventContext& ctx)
const
36
{
37
ATH_MSG_DEBUG
(
"EventInfoReader::execute()"
);
38
39
SG::ReadHandle<xAOD::EventInfo>
eventInfo (
m_eventInfoKey
, ctx);
40
if
(!eventInfo.
isValid
()) {
41
ATH_MSG_ERROR
(
" Could not get event info"
);
42
return
StatusCode::FAILURE;
43
}
44
45
ATH_MSG_DEBUG
(
"Event ID: ["
46
<< eventInfo->runNumber() <<
","
47
<< eventInfo->eventNumber() <<
":"
48
<< eventInfo->timeStamp() <<
"] "
);
49
ATH_MSG_DEBUG
(
"Event type: IS_SIMULATION "
<< std::boolalpha
50
<< eventInfo->eventType(
xAOD::EventInfo::IS_SIMULATION
) <<
" weight "
51
<< eventInfo->mcEventWeight() );
52
53
54
// Print out the tags found
55
ATH_MSG_DEBUG
(
"Tag pairs from EventInfo: "
);
56
for
(
const
auto
& ddTag : eventInfo->detDescrTags() ) {
57
ATH_MSG_DEBUG
( ddTag.first <<
" : "
<< ddTag.second);
58
}
59
60
// Dump out Tags
61
ATH_MSG_DEBUG
(
"Tags from TagInfoMgr:"
);
62
ATH_MSG_DEBUG
(
m_tagInfoMgr
->dumpTagInfoToStr() );
63
64
// Print out current Release version
65
std::string releaseVersion =
m_tagInfoMgr
->findTag(
"AtlasRelease"
);
66
ATH_MSG_DEBUG
(
"Found Release version from TagInfoMgr: "
<< releaseVersion);
67
68
return
StatusCode::SUCCESS;
69
}
70
71
72
// Finalize method:
73
StatusCode
EventInfoReader::finalize
()
74
{
75
ATH_MSG_INFO
(
"EventInfoReader::finalize()"
);
76
return
StatusCode::SUCCESS;
77
}
78
79
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
EventInfoReader.h
Test Algorithm for checking TagInfoMgr and the storing of geometry and conditions tags in EventInfo,...
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
EventInfoReader::initialize
virtual StatusCode initialize() override
Algorithm initialize at begin of job.
Definition
EventInfoReader.cxx:25
EventInfoReader::m_geoModel
ServiceHandle< IGeoModelSvc > m_geoModel
Access to GeoModelSvc for tags.
Definition
EventInfoReader.h:52
EventInfoReader::EventInfoReader
EventInfoReader(const std::string &name, ISvcLocator *pSvcLocator)
Algorithm constructor.
Definition
EventInfoReader.cxx:17
EventInfoReader::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm execute once per event.
Definition
EventInfoReader.cxx:35
EventInfoReader::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG key for Event Info.
Definition
EventInfoReader.h:56
EventInfoReader::m_tagInfoMgr
ServiceHandle< ITagInfoMgr > m_tagInfoMgr
Access to TagInfoMgr for tags.
Definition
EventInfoReader.h:54
EventInfoReader::finalize
virtual StatusCode finalize() override
Algorithm finalize at end of job.
Definition
EventInfoReader.cxx:73
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition
EventInfo_v1.h:151
Generated on
for ATLAS Offline Software by
1.17.0