ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
ITkPixelByteStreamCnv
src
ITkPixelRawContBytestreamCnv.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
* Author: Ondra Kovanda, ondrej.kovanda at cern.ch
7
* Date: 03/2025
8
* Description: The BS converter for ITk pixels
9
*/
10
11
#include "
ITkPixelRawContBytestreamCnv.h
"
12
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
13
#include "
ITkPixelRDO_Container.h
"
14
#include "
AthenaBaseComps/AthCheckMacros.h
"
15
#include "
ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
"
16
#include "
AthenaKernel/StorableConversions.h
"
17
18
ITkPixelRawContByteStreamCnv::ITkPixelRawContByteStreamCnv
(ISvcLocator* svcloc) :
19
AthConstConverter
(
ByteStreamAddress
::
storageType
(), 1328667962, svcloc,
"ITkPixelRawContByteStreamCnv"
),
20
m_ByteStreamEventAccess
(
"ByteStreamCnvSvc"
,
"ITkPixelRawContByteStreamCnv"
),
21
m_cnvTool
(
"ITkPixelCnvTool"
)
22
{}
23
24
StatusCode
ITkPixelRawContByteStreamCnv::initialize
(){
25
26
ATH_CHECK
(AthConstConverter::initialize());
27
28
ATH_CHECK
(
m_ByteStreamEventAccess
.retrieve());
29
30
ATH_CHECK
(
m_cnvTool
.retrieve());
31
32
ATH_MSG_INFO
(
"ITkPixelRawContByteStreamCnv initialized!!!"
);
33
34
return
StatusCode::SUCCESS;
35
}
36
42
43
StatusCode
ITkPixelRawContByteStreamCnv::createRepConst
(DataObject* pObj, IOpaqueAddress*& pAddr)
const
{
44
45
ITkPixelRDO_Container
* cont = 0;
46
47
//retrieve & cast the container from SG
48
ATH_CHECK
(
SG::fromStorable
(pObj, cont));
49
50
//create BS address
51
std::string
name
= pObj->registry()->name();
52
std::unique_ptr<ByteStreamAddress> addr(
new
ByteStreamAddress
(
classID
(),
name
,
""
));
53
pAddr = addr.release();
54
55
//Segfault without this line. No clue why.
56
pAddr->addRef();
57
ATH_MSG_DEBUG
(
"BS address object created for "
<<
classID
() <<
" name '"
<<
name
<<
"'"
);
58
59
//Run all the conversion steps scheduled in the ITkPixelCnvTool
60
ATH_CHECK
(
m_cnvTool
->convertToByteStream(cont));
61
62
return
StatusCode::SUCCESS;
63
}
64
65
CLID
ITkPixelRawContByteStreamCnv::classID
(){
66
67
return
ClassID_traits<ITkPixelRDO_Container>::ID
();
68
}
69
70
long
ITkPixelRawContByteStreamCnv::storageType
(){
71
72
return
ByteStreamAddress::storageType
();
73
}
AthCheckMacros.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ByteStreamAddress.h
ByteStreamCnvSvcBase.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ITkPixelRDO_Container.h
ITkPixelRDO_Container
InDetRawDataContainer< InDetRawDataCollection< ITkPixelRDORawData > > ITkPixelRDO_Container
Definition
ITkPixelRDO_Container.h:22
ITkPixelRawContBytestreamCnv.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
ITkPixelRawContByteStreamCnv::m_ByteStreamEventAccess
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
Definition
ITkPixelRawContBytestreamCnv.h:40
ITkPixelRawContByteStreamCnv::classID
static CLID classID()
Definition
ITkPixelRawContBytestreamCnv.cxx:65
ITkPixelRawContByteStreamCnv::ITkPixelRawContByteStreamCnv
ITkPixelRawContByteStreamCnv(ISvcLocator *svcloc)
Definition
ITkPixelRawContBytestreamCnv.cxx:18
ITkPixelRawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
ITkPixelRawContBytestreamCnv.cxx:24
ITkPixelRawContByteStreamCnv::storageType
static long storageType()
Definition
ITkPixelRawContBytestreamCnv.cxx:70
ITkPixelRawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
This function is called for the RDO -> BS conversion and orchestrates the necessary steps,...
Definition
ITkPixelRawContBytestreamCnv.cxx:43
ITkPixelRawContByteStreamCnv::m_cnvTool
ToolHandle< ITkPixelCnvTool > m_cnvTool
Definition
ITkPixelRawContBytestreamCnv.h:42
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