ATLAS Offline Software
CpByteStreamV1Cnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #include <vector>
7 
10 
12 #include "ByteStreamData/ROBData.h"
13 
15 
16 #include "GaudiKernel/DataObject.h"
17 #include "GaudiKernel/IOpaqueAddress.h"
18 #include "GaudiKernel/IRegistry.h"
19 #include "GaudiKernel/ISvcLocator.h"
20 #include "GaudiKernel/StatusCode.h"
21 
25 
27 
28 #include "CpByteStreamV1Cnv.h"
29 #include "CpByteStreamV1Tool.h"
30 
31 namespace LVL1BS {
32 
34  : AthConstConverter( storageType(), classID(), svcloc, "CpByteStreamV1Cnv" ),
35  m_tool("LVL1BS::CpByteStreamV1Tool/CpByteStreamV1Tool")
36 {
37 }
38 
40 {
41 }
42 
43 // CLID
44 
46 {
48 }
49 
51 {
53 }
54 
55 // Init method gets all necessary services etc.
56 
57 
59 {
61  ATH_CHECK( m_tool.retrieve() );
62 
63  return StatusCode::SUCCESS;
64 }
65 
66 // createRep should create the bytestream from RDOs.
67 
69  IOpaqueAddress*& pAddr ) const
70 {
72  if( !SG::fromStorable( pObj, cp ) ) {
73  ATH_MSG_ERROR( "Cannot cast to CPBSCollectionV1" );
74  return StatusCode::FAILURE;
75  }
76 
77  const std::string nm = pObj->registry()->name();
78 
79  ByteStreamAddress* addr = new ByteStreamAddress( classID(), nm, "" );
80 
81  pAddr = addr;
82 
83  // Convert to ByteStream
84  return m_tool->convert( cp );
85 }
86 
87 } // end namespace
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
LVL1BS::CpByteStreamV1Cnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Create ByteStream from Cp Container.
Definition: CpByteStreamV1Cnv.cxx:68
LVL1BS::CpByteStreamV1Cnv::CpByteStreamV1Cnv
CpByteStreamV1Cnv(ISvcLocator *svcloc)
Definition: CpByteStreamV1Cnv.cxx:33
ROBData.h
Defines the ROB data entity. The ROB data is an abstract entity that is used to discase the raw event...
initialize
void initialize()
Definition: run_EoverP.cxx:894
IByteStreamEventAccess.h
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
LVL1BS::CpByteStreamV1Cnv::storageType
static long storageType()
Definition: CpByteStreamV1Cnv.cxx:50
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
CPBSCollectionV1.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1BS::CpByteStreamV1Cnv::initialize
virtual StatusCode initialize() override
Definition: CpByteStreamV1Cnv.cxx:58
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
RawEvent.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
CpByteStreamV1Tool.h
LVL1BS::CpByteStreamV1Cnv::m_tool
ToolHandle< LVL1BS::CpByteStreamV1Tool > m_tool
Tool that does the actual work.
Definition: CpByteStreamV1Cnv.h:50
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CpByteStreamV1Cnv.h
ByteStreamAddress.h
LVL1::CPBSCollectionV1
Cluster Processor container for writing bytestream.
Definition: CPBSCollectionV1.h:24
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
LVL1BS::CpByteStreamV1Cnv::classID
static const CLID & classID()
Definition: CpByteStreamV1Cnv.cxx:45
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
errorcheck.h
Helpers for checking error return status codes and reporting errors.
LArNewCalib_PedestalAutoCorr.cp
cp
Definition: LArNewCalib_PedestalAutoCorr.py:175
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
LVL1BS::CpByteStreamV1Cnv::~CpByteStreamV1Cnv
virtual ~CpByteStreamV1Cnv()
Definition: CpByteStreamV1Cnv.cxx:39
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47