ATLAS Offline Software
Loading...
Searching...
No Matches
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
43 ATH_CHECK( AthConstConverter::initialize() );
44
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
65
70
72// createRep() - convert Pixel_RDO in the container into ByteStream
74StatusCode 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
86 ATH_CHECK( m_PixelRawContBSTool->convert(cont) );
87
88 return StatusCode::SUCCESS ;
89}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
uint32_t CLID
The Class ID type.
InDetRawDataContainer< InDetRawDataCollection< PixelRDORawData > > PixelRDO_Container
convert to and from a SG storable
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
const std::string & name() const
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
PixelRawContByteStreamCnv(ISvcLocator *svcloc)
const PixelRawContByteStreamTool * m_PixelRawContBSTool
virtual StatusCode initialize() override
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
this creates the RawEvent fragments for Pixel
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)