ATLAS Offline Software
CscRdoContByteStreamCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 #include "GaudiKernel/IRegistry.h"
12 
14  AthConstConverter(storageType(), classID(), svcloc, "CscRdoContByteStreamCnv"), m_tool("Muon::CscRdoContByteStreamTool") {}
15 
16 // class ID
18 
20 
21 // initialize
23  ATH_MSG_DEBUG(" initialize ");
24 
26  ATH_CHECK(m_tool.retrieve());
27  return StatusCode::SUCCESS;
28 }
29 
30 // convert CSC RDOs in the container into ByteStream
31 StatusCode CscRdoContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const {
32  // retrieve CSC RDO container
33  CscRawDataContainer* cont = nullptr;
34  SG::fromStorable(pObj, cont);
35  if (!cont) {
36  ATH_MSG_ERROR(" Can not cast to CscRawDataContainer");
37  return StatusCode::FAILURE;
38  }
39 
40  // create address
41  std::string nm = pObj->registry()->name();
42  pAddr = new ByteStreamAddress(classID(), nm, "");
43 
44  return m_tool->convert(cont, msg());
45 }
CscRdoContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition: CscRdoContByteStreamCnv.cxx:22
AthCheckMacros.h
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition: StorableConversions.h:167
StorableConversions.h
convert to and from a SG storable
CscRawDataContainer.h
initialize
void initialize()
Definition: run_EoverP.cxx:894
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
CscRdoContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition: CscRdoContByteStreamCnv.cxx:31
CscRdoContByteStreamCnv::storageType
static long storageType()
Definition: CscRdoContByteStreamCnv.cxx:19
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CscRdoContByteStreamCnv::CscRdoContByteStreamCnv
CscRdoContByteStreamCnv(ISvcLocator *svcloc)
Definition: CscRdoContByteStreamCnv.cxx:13
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ByteStreamAddress.h
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
CscRdoContByteStreamCnv::classID
static const CLID & classID()
Definition: CscRdoContByteStreamCnv.cxx:17
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
CscRdoContByteStreamCnv::m_tool
ToolHandle< Muon::ICSC_RDOtoByteStreamTool > m_tool
Definition: CscRdoContByteStreamCnv.h:40
CscRawDataContainer
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Definition: CscRawDataContainer.h:23
CscRdoContByteStreamCnv.h