ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
ByteStreamCnvSvc
src
EventInfoByteStreamxAODCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
EventInfoByteStreamxAODCnv.h
"
6
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
7
8
#include "
AthenaKernel/errorcheck.h
"
9
#include "GaudiKernel/MsgStream.h"
10
#include "GaudiKernel/StatusCode.h"
11
#include "GaudiKernel/DataObject.h"
12
#include "GaudiKernel/IRegistry.h"
13
14
#include "
xAODEventInfo/EventInfo.h
"
15
#include "
xAODEventInfo/EventAuxInfo.h
"
16
17
#include "
StoreGate/StoreGateSvc.h
"
18
19
EventInfoByteStreamxAODCnv::EventInfoByteStreamxAODCnv
(ISvcLocator* svcloc)
20
:
Converter
(
storageType
(),
classID
(), svcloc)
21
,
AthMessaging
(svcloc != nullptr ? msgSvc() : nullptr,
"EventInfoByteStreamxAODCnv"
)
22
{
23
}
24
25
CLID
EventInfoByteStreamxAODCnv::classID
()
26
{
27
return
ClassID_traits<xAOD::EventInfo>::ID
();
28
}
29
30
long
EventInfoByteStreamxAODCnv::storageType
()
31
{
32
return
ByteStreamAddress::storageType
();
33
}
34
35
StatusCode
EventInfoByteStreamxAODCnv::initialize
()
36
{
37
ATH_MSG_DEBUG
(
"Initialize"
);
38
CHECK
(Converter::initialize());
39
return
StatusCode::SUCCESS;
40
}
41
42
StatusCode
EventInfoByteStreamxAODCnv::finalize
()
43
{
44
ATH_MSG_DEBUG
(
"Finalize"
);
45
46
StatusCode
sc
= Converter::finalize();
47
if
(
sc
.isFailure()) {
48
ATH_MSG_WARNING
(
"Converter::finalize() failed"
);
49
}
50
return
sc
;
51
}
52
53
StatusCode
EventInfoByteStreamxAODCnv::createObj
(IOpaqueAddress* pAddr, DataObject*& pObj)
54
{
55
ByteStreamAddress
*pRE_Addr{
nullptr
};
56
pRE_Addr =
dynamic_cast<
ByteStreamAddress
*
>
(pAddr);
57
if
(!pRE_Addr) {
58
ATH_MSG_ERROR
(
"Cannot cast to ByteStreamAddress "
);
59
return
StatusCode::FAILURE;
60
}
61
62
ATH_MSG_DEBUG
(
"Creating Objects"
);
63
64
const
std::string nm = *(pRE_Addr->par());
65
const
std::string nmAux = nm +
"Aux."
;
66
67
xAOD::EventInfo
* pEvtInfo =
new
xAOD::EventInfo
();
68
DataLink<xAOD::EventAuxInfo>
link(nmAux);
69
pEvtInfo->setStore(link);
70
pObj =
SG::asStorable
(pEvtInfo);
71
72
ATH_MSG_DEBUG
(
" New EventInfo made, run/event= "
<< pEvtInfo->
runNumber
() <<
" "
<< pEvtInfo->
eventNumber
());
73
74
return
StatusCode::SUCCESS;
75
}
76
77
StatusCode
EventInfoByteStreamxAODCnv::createRep
(DataObject*
/*pObj*/
, IOpaqueAddress*&
/*pAddr*/
)
78
{
79
ATH_MSG_DEBUG
(
"Nothing to be done for xAOD::EventInfo createReps"
);
80
return
StatusCode::SUCCESS;
81
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ByteStreamAddress.h
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
EventAuxInfo.h
EventInfoByteStreamxAODCnv.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
StoreGateSvc.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
Converter::Converter
Converter()
Definition
Converter.h:29
DataLink
Object reference supporting deferred reading from StoreGate.
Definition
AthLinks/DataLink.h:93
EventInfoByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr) override
converter method to write object
Definition
EventInfoByteStreamxAODCnv.cxx:77
EventInfoByteStreamxAODCnv::classID
static CLID classID()
Definition
EventInfoByteStreamxAODCnv.cxx:25
EventInfoByteStreamxAODCnv::EventInfoByteStreamxAODCnv
EventInfoByteStreamxAODCnv(ISvcLocator *svcloc)
Definition
EventInfoByteStreamxAODCnv.cxx:19
EventInfoByteStreamxAODCnv::initialize
virtual StatusCode initialize() override
Definition
EventInfoByteStreamxAODCnv.cxx:35
EventInfoByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
converter method to create object
Definition
EventInfoByteStreamxAODCnv.cxx:53
EventInfoByteStreamxAODCnv::storageType
static long storageType()
Definition
EventInfoByteStreamxAODCnv.cxx:30
EventInfoByteStreamxAODCnv::finalize
virtual StatusCode finalize() override
Definition
EventInfoByteStreamxAODCnv.cxx:42
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0