ATLAS Offline Software
JepRoiByteStreamCnv.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 "JepRoiByteStreamCnv.h"
29 #include "JepRoiByteStreamTool.h"
30 
31 namespace LVL1BS {
32 
34  : AthConstConverter( storageType(), classID(), svcloc, "JepRoiByteStreamCnv" ),
35  m_tool("LVL1BS::JepRoiByteStreamTool/JepRoiByteStreamTool")
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 {
71  LVL1::JEPRoIBSCollection* jep = 0;
72  if( !SG::fromStorable( pObj, jep ) ) {
73  ATH_MSG_ERROR( " Cannot cast to JEPRoIBSCollection" );
74  return StatusCode::FAILURE;
75  }
76 
77  const std::string nm = pObj->registry()->name();
78 
79  pAddr = new ByteStreamAddress( classID(), nm, "" );
80 
81  // Convert to ByteStream
82  return m_tool->convert( jep );
83 }
84 
85 } // end namespace
LVL1BS::JepRoiByteStreamCnv::JepRoiByteStreamCnv
JepRoiByteStreamCnv(ISvcLocator *svcloc)
Definition: JepRoiByteStreamCnv.cxx:33
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
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
LVL1BS::JepRoiByteStreamCnv::m_tool
ToolHandle< LVL1BS::JepRoiByteStreamTool > m_tool
Tool that does the actual work.
Definition: JepRoiByteStreamCnv.h:56
LVL1BS::JepRoiByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Create ByteStream from JEP Container.
Definition: JepRoiByteStreamCnv.cxx:68
IByteStreamEventAccess.h
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
JEPRoIBSCollection.h
LVL1BS::JepRoiByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition: JepRoiByteStreamCnv.cxx:58
LVL1BS::JepRoiByteStreamCnv::~JepRoiByteStreamCnv
virtual ~JepRoiByteStreamCnv()
Definition: JepRoiByteStreamCnv.cxx:39
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
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1BS::JepRoiByteStreamCnv::classID
static const CLID & classID()
Definition: JepRoiByteStreamCnv.cxx:45
LVL1::JEPRoIBSCollection
Jet/Energy Processor RoI container for writing bytestream.
Definition: JEPRoIBSCollection.h:25
ByteStreamAddress.h
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
errorcheck.h
Helpers for checking error return status codes and reporting errors.
JepRoiByteStreamCnv.h
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
LVL1BS::JepRoiByteStreamCnv::storageType
static long storageType()
Definition: JepRoiByteStreamCnv.cxx:50
JepRoiByteStreamTool.h