ATLAS Offline Software
PixelRawContByteStreamCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // PixelRawContByteStreamCnv.cxx
7 // Implementation file for class PixelRawContByteStreamCnv
9 // (c) ATLAS Pixel Detector software
11 // classID() - returning PixelRDO_Container ID
12 // createObj() - creates PixelRDO_Container
13 // createRep() - convert Pixel_RDO in the container into ByteStream
15 // Version 00-00-39 05/03/2007 Daniel Dobos
17 
19 
25 
26 //#define PIXEL_DEBUG
27 
28 
30 // constructor
33  AthConstConverter(storageType(), classID(),svcloc, "PixelRawContByteStreamCnv"),
34  m_PixelRawContBSTool(nullptr),
35  m_ByteStreamEventAccess("ByteStreamCnvSvc", "PixelRawContByteStreamCnv")
36 {}
37 
39 // initialize()
42 
44 
45  ATH_CHECK( m_ByteStreamEventAccess.retrieve() );
46  ATH_MSG_INFO( "ByteStreamCnvSvc retrieved" );
47 
48  ServiceHandle<IToolSvc> toolSvc ("ToolSvc", name());
49  ATH_CHECK( toolSvc.retrieve() );
50 
51  const std::string toolType = "PixelRawContByteStreamTool";
52  ATH_CHECK( toolSvc->retrieveTool(toolType,m_PixelRawContBSTool) );
53 
54  return StatusCode::SUCCESS;
55 }
56 
58 // classID() - returning PixelRDO_Container ID
61 
63 
64 }
65 
67 {
69 }
70 
72 // createRep() - convert Pixel_RDO in the container into ByteStream
74 StatusCode PixelRawContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const {
75 
76  PixelRDO_Container* cont=nullptr;
77 
78  if(!SG::fromStorable(pObj,cont)) {
79  ATH_MSG_ERROR( "Can not cast to PixelRDO_Container" );
80  return StatusCode::FAILURE;
81  }
82 
83  std::string nm = pObj->registry()->name();
84  pAddr = new ByteStreamAddress(classID(),nm,"");
85 
87 
88  return StatusCode::SUCCESS ;
89 }
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PixelRawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
this creates the RawEvent fragments for Pixel
Definition: PixelRawContByteStreamCnv.cxx:74
PixelRawContByteStreamCnv::m_ByteStreamEventAccess
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
Definition: PixelRawContByteStreamCnv.h:53
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition: StorableConversions.h:180
StorableConversions.h
convert to and from a SG storable
initialize
void initialize()
Definition: run_EoverP.cxx:894
PixelRawContByteStreamTool::convert
StatusCode convert(PixelRDO_Container *cont) const
Definition: PixelRawContByteStreamTool.cxx:69
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
PixelRawContByteStreamCnv::storageType
static long storageType()
Definition: PixelRawContByteStreamCnv.cxx:66
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
PixelRDORawData.h
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
PixelRawContByteStreamCnv::classID
static const CLID & classID()
Definition: PixelRawContByteStreamCnv.cxx:60
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
PixelRawContByteStreamCnv::PixelRawContByteStreamCnv
PixelRawContByteStreamCnv(ISvcLocator *svcloc)
Definition: PixelRawContByteStreamCnv.cxx:32
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
PixelRawContByteStreamCnv.h
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
PixelRawContByteStreamTool.h
ByteStreamCnvSvcBase.h
PixelRawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition: PixelRawContByteStreamCnv.cxx:41
PixelRawContByteStreamCnv::m_PixelRawContBSTool
const PixelRawContByteStreamTool * m_PixelRawContBSTool
Definition: PixelRawContByteStreamCnv.h:52
AthConstConverter::name
std::string name() const
Definition: AthConstConverter.h:67
ServiceHandle< IToolSvc >