ATLAS Offline Software
Loading...
Searching...
No Matches
TRTRawContByteStreamCnv.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
9#include "GaudiKernel/DataObject.h"
10#include "GaudiKernel/MsgStream.h"
11#include <string>
12// ------------------------------------------------------
13// constructor
14
16 AthConstConverter(storageType(), classID(),svcloc,"TRTRawContByteStreamCnv"),
17 m_tool ("TRTRawContByteStreamTool") // init tool handles
18{}
19
20// ------------------------------------------------------
21// initialize
22
23StatusCode
25{
26 ATH_CHECK( AthConstConverter::initialize() );
27
28 ATH_MSG_DEBUG( " initialize " );
29
30 // Retrieve byte stream tool
31 ATH_CHECK( m_tool.retrieve() );
32 ATH_MSG_INFO( "Retrieved tool " << m_tool );
33
34 ATH_MSG_INFO( "Leaving TRTRawContByteStreamCnv::initialize()" );
35 return StatusCode::SUCCESS;
36
37}
38
39// ------------------------------------------------------
40// convert TRT Raw Data in the container into ByteStream
41
42StatusCode
43TRTRawContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const
44{
45 // get IDC for TRT Raw Data
46 TRT_RDO_Container* cont=nullptr;
47 if(!SG::fromStorable(pObj, cont)){
48 ATH_MSG_ERROR( " Can not cast to TRTRawContainer " );
49 return StatusCode::FAILURE;
50 }
51
52 // set up the IOpaqueAddress for Storegate
53 std::string nm = pObj->registry()->name();
54 pAddr = new ByteStreamAddress(classID(),nm,"");
55
56 // now use the tool to do the conversion
57 ATH_CHECK( m_tool->convert(cont) );
58
59 return StatusCode::SUCCESS ;
60}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
convert to and from a SG storable
InDetRawDataContainer< InDetRawDataCollection< TRT_RDORawData > > TRT_RDO_Container
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
this creates the RawEvent fragments for the TRT
virtual StatusCode initialize() override
initialize
static const CLID & classID()
ToolHandle< ITRTRawContByteStreamTool > m_tool
TRTRawContByteStreamCnv(ISvcLocator *svcloc)
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)