ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonByteStream
src
MdtCsmContByteStreamCnv.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
#include "
MuonByteStream/MdtCsmContByteStreamCnv.h
"
6
7
#include "
AthenaBaseComps/AthCheckMacros.h
"
8
#include "
AthenaKernel/StorableConversions.h
"
9
#include "GaudiKernel/IRegistry.h"
10
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
11
#include "
MuonMDT_CnvTools/IMDT_RDOtoByteStreamTool.h
"
12
#include "
MuonRDO/MdtCsmContainer.h
"
13
14
MdtCsmContByteStreamCnv::MdtCsmContByteStreamCnv
(ISvcLocator* svcloc) :
15
AthConstConverter
(
storageType
(),
classID
(), svcloc,
"MdtCsmContByteStreamCnv"
),
m_tool
(
"Muon::MdtCsmContByteStreamTool"
) {}
16
17
CLID
MdtCsmContByteStreamCnv::classID
() {
return
ClassID_traits<MdtCsmContainer>::ID
(); }
18
19
long
MdtCsmContByteStreamCnv::storageType
() {
return
ByteStreamAddress::storageType
(); }
20
21
StatusCode
MdtCsmContByteStreamCnv::initialize
() {
22
ATH_MSG_DEBUG
(
" initialize "
);
23
ATH_CHECK
(AthConstConverter::initialize());
24
ATH_CHECK
(
m_tool
.retrieve());
25
return
StatusCode::SUCCESS;
26
}
27
28
StatusCode
MdtCsmContByteStreamCnv::createRepConst
(DataObject* pObj, IOpaqueAddress*& pAddr)
const
{
29
MdtCsmContainer
* cont =
nullptr
;
30
SG::fromStorable
(pObj, cont);
31
if
(!cont) {
32
ATH_MSG_ERROR
(
" Can not cast to MdtCsmContainer "
);
33
return
StatusCode::FAILURE;
34
}
35
36
std::string nm = pObj->registry()->name();
37
pAddr =
new
ByteStreamAddress
(
classID
(), nm,
""
);
38
return
m_tool
->convert(cont,
msg
());
39
}
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_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ByteStreamAddress.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
MdtCsmContByteStreamCnv.h
MdtCsmContainer.h
IMDT_RDOtoByteStreamTool.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
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition
AthMessaging.h:167
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
MdtCsmContByteStreamCnv::MdtCsmContByteStreamCnv
MdtCsmContByteStreamCnv(ISvcLocator *svcloc)
Definition
MdtCsmContByteStreamCnv.cxx:14
MdtCsmContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
MdtCsmContByteStreamCnv.cxx:21
MdtCsmContByteStreamCnv::storageType
static long storageType()
Definition
MdtCsmContByteStreamCnv.cxx:19
MdtCsmContByteStreamCnv::m_tool
ToolHandle< Muon::IMDT_RDOtoByteStreamTool > m_tool
Definition
MdtCsmContByteStreamCnv.h:29
MdtCsmContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition
MdtCsmContByteStreamCnv.cxx:28
MdtCsmContByteStreamCnv::classID
static CLID classID()
Definition
MdtCsmContByteStreamCnv.cxx:17
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition
MdtCsmContainer.h:22
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