ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
SCT_RawDataByteStreamCnv
src
SCTRawContByteStreamCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
SCTRawContByteStreamCnv.h
"
6
#include "
SCTRawContByteStreamToolProviderTool.h
"
7
8
#include "
SCT_RawDataByteStreamCnv/ISCTRawContByteStreamTool.h
"
9
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
10
#include "
ByteStreamData/RawEvent.h
"
11
12
#include "
AthenaBaseComps/AthCheckMacros.h
"
13
#include "
StoreGate/StoreGateSvc.h
"
14
15
#include "GaudiKernel/DataObject.h"
16
#include "GaudiKernel/MsgStream.h"
17
18
// Constructor
19
20
SCTRawContByteStreamCnv::SCTRawContByteStreamCnv
(ISvcLocator* svcLoc) :
21
AthConstConverter
(
storageType
(),
classID
(), svcLoc,
"SCTRawContByteStreamCnv"
),
22
m_rawContByteStreamToolProvider
{
"SCTRawContByteStreamToolProviderTool"
},
23
m_rawContByteStreamTool
(nullptr),
// {"SCTRawContByteStreamTool"},
24
m_byteStreamEventAccess
{
"ByteStreamCnvSvc"
,
"SCTRawContByteStreamCnv"
}
25
{
26
}
27
28
// Initialize
29
30
StatusCode
SCTRawContByteStreamCnv::initialize
()
31
{
32
ATH_CHECK
(AthConstConverter::initialize());
33
ATH_MSG_DEBUG
(
" initialize "
);
34
35
ATH_CHECK
(
m_rawContByteStreamToolProvider
.retrieve());
36
m_rawContByteStreamTool
= &(
m_rawContByteStreamToolProvider
->getTool());
37
if
(!
m_rawContByteStreamTool
) {
38
ATH_MSG_FATAL
(
"Failed to get SCTRawContByteStreamTool"
);
39
return
StatusCode::FAILURE;
40
}
41
42
// Retrieve ByteStreamCnvSvc
43
ATH_CHECK
(
m_byteStreamEventAccess
.retrieve());
44
ATH_MSG_INFO
(
"Retrieved service "
<<
m_byteStreamEventAccess
);
45
46
return
StatusCode::SUCCESS;
47
}
48
49
// Method to create RawEvent fragments
50
51
StatusCode
SCTRawContByteStreamCnv::createRepConst
(DataObject* pDataObject, IOpaqueAddress*& pOpaqueAddress)
const
52
{
53
// Get IDC for SCT Raw Data
54
SCT_RDO_Container
* sctRDOCont{
nullptr
};
55
if
(not
SG::fromStorable
(pDataObject, sctRDOCont)) {
56
ATH_MSG_ERROR
(
" Can not cast to SCTRawContainer "
);
57
return
StatusCode::FAILURE;
58
}
59
60
// Set up the IOpaqueAddress for Storegate
61
std::string dataObjectName{pDataObject->registry()->name()};
62
if
( pOpaqueAddress !=
nullptr
) pOpaqueAddress->release();
63
pOpaqueAddress =
new
ByteStreamAddress
(
classID
(), dataObjectName,
""
);
64
pOpaqueAddress->addRef();
65
66
// Use the tool to do the conversion
67
ATH_CHECK
(
m_rawContByteStreamTool
->convert(sctRDOCont) );
68
69
return
StatusCode::SUCCESS;
70
}
AthCheckMacros.h
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_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
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
ISCTRawContByteStreamTool.h
Athena Algorithm Tool to fill Collections of SCT RDO Containers.
RawEvent.h
SCTRawContByteStreamCnv.h
SCTRawContByteStreamToolProviderTool.h
SCT_RDO_Container
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
Definition
SCT_RDO_Container.h:23
StoreGateSvc.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
SCTRawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Initialize.
Definition
SCTRawContByteStreamCnv.cxx:30
SCTRawContByteStreamCnv::classID
static CLID classID()
Class ID.
Definition
SCTRawContByteStreamCnv.h:50
SCTRawContByteStreamCnv::m_rawContByteStreamToolProvider
PublicToolHandle< ISCTRawContByteStreamToolProviderTool > m_rawContByteStreamToolProvider
Tool to do coversion from SCT RDO container to ByteStream.
Definition
SCTRawContByteStreamCnv.h:71
SCTRawContByteStreamCnv::SCTRawContByteStreamCnv
SCTRawContByteStreamCnv(ISvcLocator *svcLoc)
Constructor.
Definition
SCTRawContByteStreamCnv.cxx:20
SCTRawContByteStreamCnv::m_byteStreamEventAccess
ServiceHandle< IByteStreamEventAccess > m_byteStreamEventAccess
Interface for accessing raw data.
Definition
SCTRawContByteStreamCnv.h:76
SCTRawContByteStreamCnv::storageType
static long storageType()
Storage type.
Definition
SCTRawContByteStreamCnv.h:48
SCTRawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pDataObject, IOpaqueAddress *&pOpaqueAddress) const override
Method to convert SCT Raw Data into ByteStream.
Definition
SCTRawContByteStreamCnv.cxx:51
SCTRawContByteStreamCnv::m_rawContByteStreamTool
const ISCTRawContByteStreamTool * m_rawContByteStreamTool
Definition
SCTRawContByteStreamCnv.h:72
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition
StorableConversions.h:169
Generated on
for ATLAS Offline Software by
1.17.0