ATLAS Offline Software
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 
25 {
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 
43 TRTRawContByteStreamCnv::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 }
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
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
TRTRawContByteStreamCnv::initialize
virtual StatusCode initialize() override
initialize
Definition: TRTRawContByteStreamCnv.cxx:24
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
RawEvent.h
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
TRTRawContByteStreamCnv::TRTRawContByteStreamCnv
TRTRawContByteStreamCnv(ISvcLocator *svcloc)
Definition: TRTRawContByteStreamCnv.cxx:15
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRTRawContByteStreamCnv::m_tool
ToolHandle< ITRTRawContByteStreamTool > m_tool
Definition: TRTRawContByteStreamCnv.h:49
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
TRTRawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
this creates the RawEvent fragments for the TRT
Definition: TRTRawContByteStreamCnv.cxx:43
TRTRawContByteStreamCnv.h
TRTRawContByteStreamCnv::classID
static const CLID & classID()
Definition: TRTRawContByteStreamCnv.h:35