ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonByteStream
src
TgcRdoContByteStreamCnv.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/TgcRdoContByteStreamCnv.h
"
6
7
#include <inttypes.h>
8
9
#include <sstream>
10
11
#include "
AthenaKernel/StorableConversions.h
"
12
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
13
#include "
ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
"
14
#include "
ByteStreamData/RawEvent.h
"
15
#include "GaudiKernel/DataObject.h"
16
#include "GaudiKernel/IToolSvc.h"
17
#include "GaudiKernel/MsgStream.h"
18
#include "GaudiKernel/StatusCode.h"
19
#include "
MuonRDO/TgcRdoContainer.h
"
20
#include "
MuonRDO/TgcRdoIdHash.h
"
21
22
const
std::string
const_cnvName
=
"TgcRdoContByteStreamCnv"
;
23
24
// constructor
25
TgcRdoContByteStreamCnv::TgcRdoContByteStreamCnv
(ISvcLocator* svcloc) :
26
AthConstConverter
(
storageType
(),
classID
(), svcloc,
"TgcRdoContByteStreamCnv"
),
m_tool
(
"Muon::TgcRdoContByteStreamTool"
) {}
27
28
// class ID
29
CLID
TgcRdoContByteStreamCnv::classID
() {
return
ClassID_traits<TgcRdoContainer>::ID
(); }
30
31
long
TgcRdoContByteStreamCnv::storageType
() {
return
ByteStreamAddress::storageType
(); }
32
33
// initialize
34
StatusCode
TgcRdoContByteStreamCnv::initialize
() {
35
ATH_MSG_DEBUG
(
" initialize "
);
36
ATH_CHECK
(Converter::initialize());
37
ATH_CHECK
(
m_tool
.retrieve());
38
return
StatusCode::SUCCESS;
39
}
40
41
// convert TGC RDOs in the container into ByteStream
42
StatusCode
TgcRdoContByteStreamCnv::createRepConst
(DataObject* pObj, IOpaqueAddress*& pAddr)
const
{
43
// retrieve TGC RDO container
44
TgcRdoContainer
* cont(
nullptr
);
45
SG::fromStorable
(pObj, cont);
46
if
(!cont) {
47
ATH_MSG_ERROR
(
" Can not cast to TgcRdoContainer"
);
48
return
StatusCode::FAILURE;
49
}
50
51
// create address
52
std::string nm = pObj->registry()->name();
53
pAddr =
new
ByteStreamAddress
(
classID
(), nm,
""
);
54
55
// convert
56
return
m_tool
->convert(cont);
57
}
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
ByteStreamCnvSvcBase.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
RawEvent.h
StorableConversions.h
convert to and from a SG storable
const_cnvName
const std::string const_cnvName
Definition
TgcRdoContByteStreamCnv.cxx:22
TgcRdoContByteStreamCnv.h
TgcRdoContainer.h
TgcRdoIdHash.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
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
TgcRdoContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition
TgcRdoContByteStreamCnv.cxx:42
TgcRdoContByteStreamCnv::classID
static CLID classID()
Definition
TgcRdoContByteStreamCnv.cxx:29
TgcRdoContByteStreamCnv::storageType
static long storageType()
Definition
TgcRdoContByteStreamCnv.cxx:31
TgcRdoContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
TgcRdoContByteStreamCnv.cxx:34
TgcRdoContByteStreamCnv::TgcRdoContByteStreamCnv
TgcRdoContByteStreamCnv(ISvcLocator *svcloc)
Definition
TgcRdoContByteStreamCnv.cxx:25
TgcRdoContByteStreamCnv::m_tool
ToolHandle< Muon::ITGC_RDOtoByteStreamTool > m_tool
Definition
TgcRdoContByteStreamCnv.h:47
TgcRdoContainer
Definition
TgcRdoContainer.h:25
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