ATLAS Offline Software
JepRoiByteStreamV1Cnv.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 
9 
11 #include "ByteStreamData/ROBData.h"
12 
14 
15 #include "GaudiKernel/DataObject.h"
16 #include "GaudiKernel/IOpaqueAddress.h"
17 #include "GaudiKernel/IRegistry.h"
18 #include "GaudiKernel/ISvcLocator.h"
19 #include "GaudiKernel/StatusCode.h"
20 
24 
26 
27 #include "JepRoiByteStreamV1Cnv.h"
28 #include "JepRoiByteStreamV1Tool.h"
29 
30 namespace LVL1BS {
31 
33  : AthConstConverter( storageType(), classID(), svcloc, "JepRoiByteStreamV1Cnv" ),
34  m_tool("LVL1BS::JepRoiByteStreamV1Tool/JepRoiByteStreamV1Tool")
35 {
36 }
37 
39 {
40 }
41 
42 // CLID
43 
45 {
47 }
48 
50 {
52 }
53 
54 // Init method gets all necessary services etc.
55 
56 
58 {
60  ATH_CHECK( m_tool.retrieve() );
61 
62  return StatusCode::SUCCESS;
63 }
64 
65 // createRep should create the bytestream from RDOs.
66 
68  IOpaqueAddress*& pAddr ) const
69 {
71  if( !SG::fromStorable( pObj, jep ) ) {
72  ATH_MSG_ERROR( " Cannot cast to JEPRoIBSCollectionV1" );
73  return StatusCode::FAILURE;
74  }
75 
76  const std::string nm = pObj->registry()->name();
77 
78  pAddr = new ByteStreamAddress( classID(), nm, "" );
79 
80  // Convert to ByteStream
81  return m_tool->convert( jep );
82 }
83 
84 } // 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
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::JepRoiByteStreamV1Cnv::classID
static const CLID & classID()
Definition: JepRoiByteStreamV1Cnv.cxx:44
JepRoiByteStreamV1Cnv.h
LVL1BS::JepRoiByteStreamV1Cnv::~JepRoiByteStreamV1Cnv
virtual ~JepRoiByteStreamV1Cnv()
Definition: JepRoiByteStreamV1Cnv.cxx:38
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
LVL1BS::JepRoiByteStreamV1Cnv::m_tool
ToolHandle< LVL1BS::JepRoiByteStreamV1Tool > m_tool
Tool that does the actual work.
Definition: JepRoiByteStreamV1Cnv.h:50
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
LVL1::JEPRoIBSCollectionV1
Jet/Energy Processor RoI container for writing bytestream pre-LS1.
Definition: JEPRoIBSCollectionV1.h:25
LVL1BS::JepRoiByteStreamV1Cnv::storageType
static long storageType()
Definition: JepRoiByteStreamV1Cnv.cxx:49
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
LVL1BS::JepRoiByteStreamV1Cnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Create ByteStream from JEP Container.
Definition: JepRoiByteStreamV1Cnv.cxx:67
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ByteStreamAddress.h
LVL1BS::JepRoiByteStreamV1Cnv::initialize
virtual StatusCode initialize() override
Definition: JepRoiByteStreamV1Cnv.cxx:57
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.
JEPRoIBSCollectionV1.h
JepRoiByteStreamV1Tool.h
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
LVL1BS::JepRoiByteStreamV1Cnv::JepRoiByteStreamV1Cnv
JepRoiByteStreamV1Cnv(ISvcLocator *svcloc)
Definition: JepRoiByteStreamV1Cnv.cxx:32
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47