ATLAS Offline Software
BCM_RawContByteStreamCnv.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 // BCM_RawContByteStreamCnv.cxx
7 // Implementation file for class BCM_RawContByteStreamCnv
10 // classID() - returning BCM_RDO_Container ID
11 // createRep() - convert BCM_RawData in the container into ByteStream
13 // Version 00-00-39 05/03/2007 Daniel Dobos for pixels
15 
17 
20 #include "StoreGate/StoreGateSvc.h"
22 
25 
27 // constructor
30  AthConstConverter(storageType(), classID(),svcloc,"BCM_RawContByteStreamCnv"),
31  m_BCMRawContBSTool{}
32 {
33 }
34 
35 // ////////////////////////
36 // // destructor
37 // ////////////////////////
38 // BCM_RawContByteStreamCnv::~BCM_RawContByteStreamCnv() {
39 // }
40 
42 // initialize()
45 
47 
48  // retrieve Tool
49  SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service("ToolSvc")};
50  ATH_CHECK( toolSvc.isValid() );
51  ATH_CHECK( toolSvc->retrieveTool("BCM_RawContByteStreamTool", m_BCMRawContBSTool) );
52  return StatusCode::SUCCESS;
53 }
54 
56 // classID() - returning BCM_RDO_Container ID
60 }
61 
64 }
65 
67 // createRep() - convert BCM_RawData in the container into ByteStream
70 BCM_RawContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const
71 {
72  BCM_RDO_Container* cont = nullptr;
73  if(! SG::fromStorable(pObj,cont)) {
74  ATH_MSG_ERROR( "Can not cast to BCM_RDO_Container" );
75  return StatusCode::FAILURE;
76  }
77 
78  std::string nm = pObj->registry()->name();
79  pAddr = new ByteStreamAddress(classID(),nm,"");
80 
82 
83  return StatusCode::SUCCESS;
84 }
BCM_RawContByteStreamCnv::storageType
static long storageType()
Definition: BCM_RawContByteStreamCnv.cxx:62
BCM_RawContByteStreamCnv.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
initialize
void initialize()
Definition: run_EoverP.cxx:894
BCM_RawContByteStreamTool::convert
StatusCode convert(BCM_RDO_Container *cont) const
Definition: BCM_RawContByteStreamTool.cxx:59
BCM_RawContByteStreamTool.h
BCM_RawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition: BCM_RawContByteStreamCnv.cxx:44
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
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
BCM_RDO_Container
Definition: BCM_RDO_Container.h:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ByteStreamAddress.h
BCM_RawContByteStreamCnv::m_BCMRawContBSTool
BCM_RawContByteStreamTool * m_BCMRawContBSTool
Definition: BCM_RawContByteStreamCnv.h:43
BCM_RawContByteStreamCnv::classID
static const CLID & classID()
Definition: BCM_RawContByteStreamCnv.cxx:58
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
InDetBCM_RawDataCLASS_DEF.h
BCM_RawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition: BCM_RawContByteStreamCnv.cxx:70
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
BCM_RawContByteStreamCnv::BCM_RawContByteStreamCnv
BCM_RawContByteStreamCnv(ISvcLocator *svcloc)
Definition: BCM_RawContByteStreamCnv.cxx:29
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
ByteStreamCnvSvcBase.h
StoreGateSvc.h