ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
PixelRawDataByteStreamCnv
src
PixelRawContByteStreamCnv.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
// PixelRawContByteStreamCnv.cxx
7
// Implementation file for class PixelRawContByteStreamCnv
9
// (c) ATLAS Pixel Detector software
11
// classID() - returning PixelRDO_Container ID
12
// createObj() - creates PixelRDO_Container
13
// createRep() - convert Pixel_RDO in the container into ByteStream
15
// Version 00-00-39 05/03/2007 Daniel Dobos
17
18
#include "
PixelRawContByteStreamCnv.h
"
19
20
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
21
#include "
PixelRawContByteStreamTool.h
"
22
#include "
ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
"
23
#include "
InDetRawData/PixelRDORawData.h
"
24
#include "
AthenaKernel/StorableConversions.h
"
25
26
//#define PIXEL_DEBUG
27
28
30
// constructor
32
PixelRawContByteStreamCnv::PixelRawContByteStreamCnv
(ISvcLocator* svcloc) :
33
AthConstConverter
(
storageType
(),
classID
(),svcloc,
"PixelRawContByteStreamCnv"
),
34
m_PixelRawContBSTool
(nullptr),
35
m_ByteStreamEventAccess
(
"ByteStreamCnvSvc"
,
"PixelRawContByteStreamCnv"
)
36
{}
37
39
// initialize()
41
StatusCode
PixelRawContByteStreamCnv::initialize
() {
42
43
ATH_CHECK
( AthConstConverter::initialize() );
44
45
ATH_CHECK
(
m_ByteStreamEventAccess
.retrieve() );
46
ATH_MSG_INFO
(
"ByteStreamCnvSvc retrieved"
);
47
48
ServiceHandle<IToolSvc>
toolSvc (
"ToolSvc"
,
name
());
49
ATH_CHECK
( toolSvc.retrieve() );
50
51
const
std::string toolType =
"PixelRawContByteStreamTool"
;
52
ATH_CHECK
( toolSvc->retrieveTool(toolType,
m_PixelRawContBSTool
) );
53
54
return
StatusCode::SUCCESS;
55
}
56
58
// classID() - returning PixelRDO_Container ID
60
CLID
PixelRawContByteStreamCnv::classID
() {
61
62
return
ClassID_traits<PixelRDO_Container>::ID
() ;
63
64
}
65
66
long
PixelRawContByteStreamCnv::storageType
()
67
{
68
return
ByteStreamAddress::storageType
();
69
}
70
72
// createRep() - convert Pixel_RDO in the container into ByteStream
74
StatusCode
PixelRawContByteStreamCnv::createRepConst
(DataObject* pObj, IOpaqueAddress*& pAddr)
const
{
75
76
PixelRDO_Container
* cont=
nullptr
;
77
78
if
(!
SG::fromStorable
(pObj,cont)) {
79
ATH_MSG_ERROR
(
"Can not cast to PixelRDO_Container"
);
80
return
StatusCode::FAILURE;
81
}
82
83
std::string nm = pObj->registry()->name();
84
pAddr =
new
ByteStreamAddress
(
classID
(),nm,
""
);
85
86
ATH_CHECK
(
m_PixelRawContBSTool
->convert(cont) );
87
88
return
StatusCode::SUCCESS ;
89
}
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
ByteStreamAddress.h
ByteStreamCnvSvcBase.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
PixelRDORawData.h
PixelRDO_Container
InDetRawDataContainer< InDetRawDataCollection< PixelRDORawData > > PixelRDO_Container
Definition
PixelRDO_Container.h:25
PixelRawContByteStreamCnv.h
PixelRawContByteStreamTool.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
AthConstConverter::name
const std::string & name() const
Definition
AthConstConverter.h:67
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
PixelRawContByteStreamCnv::m_ByteStreamEventAccess
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
Definition
PixelRawContByteStreamCnv.h:53
PixelRawContByteStreamCnv::PixelRawContByteStreamCnv
PixelRawContByteStreamCnv(ISvcLocator *svcloc)
Definition
PixelRawContByteStreamCnv.cxx:32
PixelRawContByteStreamCnv::m_PixelRawContBSTool
const PixelRawContByteStreamTool * m_PixelRawContBSTool
Definition
PixelRawContByteStreamCnv.h:52
PixelRawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
PixelRawContByteStreamCnv.cxx:41
PixelRawContByteStreamCnv::classID
static CLID classID()
Definition
PixelRawContByteStreamCnv.cxx:60
PixelRawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
this creates the RawEvent fragments for Pixel
Definition
PixelRawContByteStreamCnv.cxx:74
PixelRawContByteStreamCnv::storageType
static long storageType()
Definition
PixelRawContByteStreamCnv.cxx:66
ServiceHandle
Definition
ClusterMakerTool.h:36
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