ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloByteStream
src
CpByteStreamCnv.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
8
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
9
10
#include "
ByteStreamData/RawEvent.h
"
11
#include "
ByteStreamData/ROBData.h
"
12
13
#include "
AthContainers/DataVector.h
"
14
15
#include "GaudiKernel/DataObject.h"
16
#include "GaudiKernel/IOpaqueAddress.h"
17
#include "GaudiKernel/IRegistry.h"
18
#include "GaudiKernel/ISvcLocator.h"
19
#include "GaudiKernel/StatusCode.h"
20
21
#include "
AthenaKernel/ClassID_traits.h
"
22
#include "
AthenaKernel/StorableConversions.h
"
23
#include "
AthenaKernel/errorcheck.h
"
24
25
#include "
TrigT1CaloEvent/CPBSCollection.h
"
26
27
#include "
CpByteStreamCnv.h
"
28
#include "
CpByteStreamTool.h
"
29
30
namespace
LVL1BS
{
31
32
CpByteStreamCnv::CpByteStreamCnv
( ISvcLocator* svcloc )
33
:
AthConstConverter
(
storageType
(),
classID
(), svcloc,
"CpByteStreamCnv"
),
34
m_tool
(
"LVL1BS::CpByteStreamTool/CpByteStreamTool"
)
35
{
36
}
37
38
CpByteStreamCnv::~CpByteStreamCnv
()
39
{
40
}
41
42
// CLID
43
44
CLID
CpByteStreamCnv::classID
()
45
{
46
return
ClassID_traits<LVL1::CPBSCollection>::ID
();
47
}
48
49
long
CpByteStreamCnv::storageType
()
50
{
51
return
ByteStreamAddress::storageType
();
52
}
53
54
// Init method gets all necessary services etc.
55
56
57
StatusCode
CpByteStreamCnv::initialize
()
58
{
59
ATH_CHECK
( Converter::initialize() );
60
ATH_CHECK
(
m_tool
.retrieve() );
61
62
return
StatusCode::SUCCESS;
63
}
64
65
// createRep should create the bytestream from RDOs.
66
67
StatusCode
CpByteStreamCnv::createRepConst
( DataObject* pObj,
68
IOpaqueAddress*& pAddr )
const
69
{
70
LVL1::CPBSCollection
* cp = 0;
71
if
( !
SG::fromStorable
( pObj, cp ) ) {
72
ATH_MSG_ERROR
(
" Cannot cast to CPBSCollection"
);
73
return
StatusCode::FAILURE;
74
}
75
76
const
std::string nm = pObj->registry()->name();
77
78
ByteStreamAddress
* addr =
new
ByteStreamAddress
(
classID
(), nm,
""
);
79
80
pAddr = addr;
81
82
// Convert to ByteStream
83
return
m_tool
->convert( cp );
84
}
85
86
}
// 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
CPBSCollection.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.
CpByteStreamCnv.h
CpByteStreamTool.h
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
ROBData.h
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
RawEvent.h
StorableConversions.h
convert to and from a SG storable
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::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
LVL1BS::CpByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
CpByteStreamCnv.cxx:57
LVL1BS::CpByteStreamCnv::CpByteStreamCnv
CpByteStreamCnv(ISvcLocator *svcloc)
Definition
CpByteStreamCnv.cxx:32
LVL1BS::CpByteStreamCnv::storageType
static long storageType()
Definition
CpByteStreamCnv.cxx:49
LVL1BS::CpByteStreamCnv::~CpByteStreamCnv
virtual ~CpByteStreamCnv()
Definition
CpByteStreamCnv.cxx:38
LVL1BS::CpByteStreamCnv::classID
static CLID classID()
Definition
CpByteStreamCnv.cxx:44
LVL1BS::CpByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Create ByteStream from Cp Container.
Definition
CpByteStreamCnv.cxx:67
LVL1BS::CpByteStreamCnv::m_tool
ToolHandle< LVL1BS::CpByteStreamTool > m_tool
Tool that does the actual work.
Definition
CpByteStreamCnv.h:55
LVL1::CPBSCollection
Cluster Processor container for writing bytestream.
Definition
CPBSCollection.h:24
LVL1BS
Definition
ZdcModifySlices.h:10
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition
StorableConversions.h:169
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
Generated on
for ATLAS Offline Software by
1.17.0