ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
BCM_RawDataByteStreamCnv
src
BCM_RawContByteStreamCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// BCM_RawContByteStreamCnv.cxx
7
// Implementation file for class BCM_RawContByteStreamCnv
10
// classID() - returning BCM_RDO_Container ID
11
// createRep() - convert BCM_RawData in the container into ByteStream
13
// Version 00-00-39 05/03/2007 Daniel Dobos for pixels
15
16
#include "
BCM_RawContByteStreamCnv.h
"
17
18
#include "
BCM_RawContByteStreamTool.h
"
19
#include "
ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
"
20
#include "
StoreGate/StoreGateSvc.h
"
21
#include "
AthenaKernel/StorableConversions.h
"
22
23
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
24
#include "
InDetBCM_RawData/InDetBCM_RawDataCLASS_DEF.h
"
25
27
// constructor
29
BCM_RawContByteStreamCnv::BCM_RawContByteStreamCnv
(ISvcLocator* svcloc) :
30
AthConstConverter
(
storageType
(),
classID
(),svcloc,
"BCM_RawContByteStreamCnv"
),
31
m_BCMRawContBSTool
{}
32
{
33
}
34
35
// ////////////////////////
36
// // destructor
37
// ////////////////////////
38
// BCM_RawContByteStreamCnv::~BCM_RawContByteStreamCnv() {
39
// }
40
42
// initialize()
44
StatusCode
BCM_RawContByteStreamCnv::initialize
() {
45
46
ATH_CHECK
( AthConstConverter::initialize() );
47
48
// retrieve Tool
49
SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service(
"ToolSvc"
)};
50
ATH_CHECK
( toolSvc.isValid() );
51
ATH_CHECK
( toolSvc->retrieveTool(
"BCM_RawContByteStreamTool"
,
m_BCMRawContBSTool
) );
52
return
StatusCode::SUCCESS;
53
}
54
56
// classID() - returning BCM_RDO_Container ID
58
CLID
BCM_RawContByteStreamCnv::classID
() {
59
return
ClassID_traits<BCM_RDO_Container>::ID
();
60
}
61
62
long
BCM_RawContByteStreamCnv::storageType
() {
63
return
ByteStreamAddress::storageType
();
64
}
65
67
// createRep() - convert BCM_RawData in the container into ByteStream
69
StatusCode
70
BCM_RawContByteStreamCnv::createRepConst
(DataObject* pObj, IOpaqueAddress*& pAddr)
const
71
{
72
BCM_RDO_Container
* cont =
nullptr
;
73
if
(!
SG::fromStorable
(pObj,cont)) {
74
ATH_MSG_ERROR
(
"Can not cast to BCM_RDO_Container"
);
75
return
StatusCode::FAILURE;
76
}
77
78
std::string nm = pObj->registry()->name();
79
pAddr =
new
ByteStreamAddress
(
classID
(),nm,
""
);
80
81
ATH_CHECK
(
m_BCMRawContBSTool
->convert(cont) );
82
83
return
StatusCode::SUCCESS;
84
}
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
BCM_RawContByteStreamCnv.h
BCM_RawContByteStreamTool.h
ByteStreamAddress.h
ByteStreamCnvSvcBase.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
InDetBCM_RawDataCLASS_DEF.h
StorableConversions.h
convert to and from a SG storable
StoreGateSvc.h
AthConstConverter::AthConstConverter
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
Definition
AthConstConverter.h:35
BCM_RDO_Container
Definition
BCM_RDO_Container.h:27
BCM_RawContByteStreamCnv::storageType
static long storageType()
Definition
BCM_RawContByteStreamCnv.cxx:62
BCM_RawContByteStreamCnv::classID
static CLID classID()
Definition
BCM_RawContByteStreamCnv.cxx:58
BCM_RawContByteStreamCnv::BCM_RawContByteStreamCnv
BCM_RawContByteStreamCnv(ISvcLocator *svcloc)
Definition
BCM_RawContByteStreamCnv.cxx:29
BCM_RawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition
BCM_RawContByteStreamCnv.cxx:70
BCM_RawContByteStreamCnv::m_BCMRawContBSTool
BCM_RawContByteStreamTool * m_BCMRawContBSTool
Definition
BCM_RawContByteStreamCnv.h:43
BCM_RawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
BCM_RawContByteStreamCnv.cxx:44
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
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