ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloByteStream
src
RodHeaderByteStreamCnv.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
6
#include <vector>
7
#include <stdint.h>
8
9
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
10
#include "
ByteStreamCnvSvcBase/IROBDataProviderSvc.h
"
11
12
#include "
ByteStreamData/RawEvent.h
"
13
#include "
ByteStreamData/ROBData.h
"
14
15
#include "
AthContainers/DataVector.h
"
16
17
#include "GaudiKernel/DataObject.h"
18
#include "GaudiKernel/IOpaqueAddress.h"
19
#include "GaudiKernel/ISvcLocator.h"
20
#include "GaudiKernel/StatusCode.h"
21
22
#include "
AthenaKernel/ClassID_traits.h
"
23
#include "
AthenaKernel/StorableConversions.h
"
24
#include "
AthenaKernel/errorcheck.h
"
25
26
#include "
TrigT1CaloEvent/RODHeader.h
"
27
28
#include "
RodHeaderByteStreamTool.h
"
29
30
#include "
RodHeaderByteStreamCnv.h
"
31
32
namespace
LVL1BS
{
33
34
RodHeaderByteStreamCnv::RodHeaderByteStreamCnv
( ISvcLocator* svcloc )
35
:
AthConstConverter
(
storageType
(),
classID
(), svcloc,
"RodHeaderByteStreamCnv"
),
36
m_tool
(
"LVL1BS::RodHeaderByteStreamTool/RodHeaderByteStreamTool"
)
37
{
38
}
39
40
RodHeaderByteStreamCnv::~RodHeaderByteStreamCnv
()
41
{
42
}
43
44
// CLID
45
46
CLID
RodHeaderByteStreamCnv::classID
()
47
{
48
return
ClassID_traits<DataVector<LVL1::RODHeader>
>::ID();
49
}
50
51
long
RodHeaderByteStreamCnv::storageType
()
52
{
53
return
ByteStreamAddress::storageType
();
54
}
55
56
// Init method gets all necessary services etc.
57
58
59
StatusCode
RodHeaderByteStreamCnv::initialize
()
60
{
61
ATH_CHECK
( Converter::initialize() );
62
ATH_CHECK
(
m_tool
.retrieve() );
63
64
return
StatusCode::SUCCESS;
65
}
66
67
// createObj should create the RDO from bytestream.
68
69
StatusCode
RodHeaderByteStreamCnv::createObjConst
( IOpaqueAddress* pAddr,
70
DataObject*& pObj )
const
71
{
72
ByteStreamAddress
*pBS_Addr;
73
pBS_Addr =
dynamic_cast<
ByteStreamAddress
*
>
( pAddr );
74
if
( !pBS_Addr ) {
75
ATH_MSG_ERROR
(
" Can not cast to ByteStreamAddress "
);
76
return
StatusCode::FAILURE;
77
}
78
79
const
EventContext& ctx = pBS_Addr->
getEventContext
();
80
const
std::string nm = *( pBS_Addr->par() );
81
// size check
82
auto
rhCollection = std::make_unique<DataVector<LVL1::RODHeader> >();
83
ATH_CHECK
(
m_tool
->convert(ctx, nm, rhCollection.get()) );
84
85
pObj =
SG::asStorable
(std::move(rhCollection));
86
87
return
StatusCode::SUCCESS;
88
}
89
90
}
// end namespace
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
ByteStreamAddress.h
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
errorcheck.h
Helpers for checking error return status codes and reporting errors.
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IROBDataProviderSvc.h
ROBData.h
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
RawEvent.h
RodHeaderByteStreamCnv.h
RodHeaderByteStreamTool.h
StorableConversions.h
convert to and from a SG storable
RODHeader.h
AthConstConverter::AthConstConverter
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
Definition
AthConstConverter.h:35
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamAddress::getEventContext
const EventContext & getEventContext() const
Definition
ByteStreamAddress.h:62
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
LVL1BS::RodHeaderByteStreamCnv::~RodHeaderByteStreamCnv
virtual ~RodHeaderByteStreamCnv()
Definition
RodHeaderByteStreamCnv.cxx:40
LVL1BS::RodHeaderByteStreamCnv::RodHeaderByteStreamCnv
RodHeaderByteStreamCnv(ISvcLocator *svcloc)
Definition
RodHeaderByteStreamCnv.cxx:34
LVL1BS::RodHeaderByteStreamCnv::m_tool
ToolHandle< LVL1BS::RodHeaderByteStreamTool > m_tool
Tool that does the actual work.
Definition
RodHeaderByteStreamCnv.h:50
LVL1BS::RodHeaderByteStreamCnv::classID
static CLID classID()
Definition
RodHeaderByteStreamCnv.cxx:46
LVL1BS::RodHeaderByteStreamCnv::createObjConst
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create RodHeaders from ByteStream.
Definition
RodHeaderByteStreamCnv.cxx:69
LVL1BS::RodHeaderByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
RodHeaderByteStreamCnv.cxx:59
LVL1BS::RodHeaderByteStreamCnv::storageType
static long storageType()
Definition
RodHeaderByteStreamCnv.cxx:51
LVL1BS
Definition
ZdcModifySlices.h:10
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
Generated on
for ATLAS Offline Software by
1.17.0