ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
ITkStripsByteStreamCnv
src
ITkStripsRawContByteStreamCnv.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 "
ITkStripsRawContByteStreamCnv.h
"
6
7
#include "
SCT_RawDataByteStreamCnv/ISCTRawContByteStreamTool.h
"
8
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
9
#include "
ByteStreamData/RawEvent.h
"
10
11
#include "
AthenaBaseComps/AthCheckMacros.h
"
12
#include "
StoreGate/StoreGateSvc.h
"
13
14
#include "GaudiKernel/DataObject.h"
15
#include "GaudiKernel/MsgStream.h"
16
17
// Constructor
18
19
ITkStripsRawContByteStreamCnv::ITkStripsRawContByteStreamCnv
(ISvcLocator* svcLoc) :
20
AthConstConverter
(
storageType
(),
classID
(), svcLoc,
"ITkStripsRawContByteStreamCnv"
),
21
m_rawContByteStreamTool
{
"ITkStripsRawContByteStreamTool"
},
22
m_byteStreamEventAccess
{
"ByteStreamCnvSvc"
,
"ITkStripsRawContByteStreamCnv"
}
23
{
24
}
25
26
// Initialize
27
28
StatusCode
ITkStripsRawContByteStreamCnv::initialize
()
29
{
30
ATH_CHECK
(AthConstConverter::initialize());
31
ATH_MSG_DEBUG
(
" initialize "
);
32
33
// Retrieve ByteStreamCnvSvc
34
ATH_CHECK
(
m_byteStreamEventAccess
.retrieve());
35
ATH_MSG_VERBOSE
(
"Retrieved service "
<<
m_byteStreamEventAccess
);
36
37
// Retrieve byte stream tool
38
ATH_CHECK
(
m_rawContByteStreamTool
.retrieve());
39
ATH_MSG_VERBOSE
(
"Retrieved tool "
<<
m_rawContByteStreamTool
);
40
41
return
StatusCode::SUCCESS;
42
}
43
44
// Method to create RawEvent fragments
45
46
StatusCode
ITkStripsRawContByteStreamCnv::createRepConst
(DataObject* pDataObject, IOpaqueAddress*& pOpaqueAddress)
const
47
{
48
// Get IDC for ITK Raw Data
49
SCT_RDO_Container
* itkStripsRDOCont{
nullptr
};
50
if
(not
SG::fromStorable
(pDataObject, itkStripsRDOCont)) {
51
ATH_MSG_ERROR
(
" Can not cast to SCTRawContainer "
);
52
return
StatusCode::FAILURE;
53
}
54
55
// Set up the IOpaqueAddress for Storegate
56
std::string dataObjectName{pDataObject->registry()->name()};
57
pOpaqueAddress =
new
ByteStreamAddress
(
classID
(), dataObjectName,
""
);
58
pOpaqueAddress->addRef();
//avoid memory leak
59
// Use the tool to do the conversion
60
ATH_CHECK
(
m_rawContByteStreamTool
->convert(itkStripsRDOCont) );
61
62
return
StatusCode::SUCCESS;
63
}
AthCheckMacros.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x,...)
Definition
AthMsgStreamMacros.h:42
ByteStreamAddress.h
ISCTRawContByteStreamTool.h
Athena Algorithm Tool to fill Collections of SCT RDO Containers.
ITkStripsRawContByteStreamCnv.h
RawEvent.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
ITkStripsRawContByteStreamCnv::storageType
static long storageType()
Storage type.
Definition
ITkStripsRawContByteStreamCnv.h:43
ITkStripsRawContByteStreamCnv::classID
static CLID classID()
Class ID.
Definition
ITkStripsRawContByteStreamCnv.h:45
ITkStripsRawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Initialize.
Definition
ITkStripsRawContByteStreamCnv.cxx:28
ITkStripsRawContByteStreamCnv::m_rawContByteStreamTool
ToolHandle< ISCTRawContByteStreamTool > m_rawContByteStreamTool
Tool to do coversion from ITkStrips RDO container to ByteStream.
Definition
ITkStripsRawContByteStreamCnv.h:66
ITkStripsRawContByteStreamCnv::m_byteStreamEventAccess
ServiceHandle< IByteStreamEventAccess > m_byteStreamEventAccess
Interface for accessing raw data.
Definition
ITkStripsRawContByteStreamCnv.h:69
ITkStripsRawContByteStreamCnv::ITkStripsRawContByteStreamCnv
ITkStripsRawContByteStreamCnv(ISvcLocator *svcLoc)
Constructor.
Definition
ITkStripsRawContByteStreamCnv.cxx:19
ITkStripsRawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pDataObject, IOpaqueAddress *&pOpaqueAddress) const override
Method to convert ITkStrips Raw Data into ByteStream.
Definition
ITkStripsRawContByteStreamCnv.cxx:46
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