ATLAS Offline Software
L1CaloErrorByteStreamCnv.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 
10 #include "GaudiKernel/DataObject.h"
11 #include "GaudiKernel/IOpaqueAddress.h"
12 #include "GaudiKernel/ISvcLocator.h"
13 #include "GaudiKernel/StatusCode.h"
14 
16 #include "SGTools/StlVectorClids.h"
19 
21 
23 
24 namespace LVL1BS {
25 
27  : AthConstConverter( storageType(), classID(), svcloc, "L1CaloErrorByteStreamCnv" ),
28  m_tool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool")
29 {
30 }
31 
33 {
34 }
35 
36 // CLID
37 
39 {
41 }
42 
44 {
46 }
47 
48 // Init method gets all necessary services etc.
49 
50 
52 {
54  ATH_CHECK( m_tool.retrieve() );
55 
56  return StatusCode::SUCCESS;
57 }
58 
59 // createObj should create the RDO from bytestream.
60 
62  DataObject*& pObj ) const
63 {
64  ByteStreamAddress *pBS_Addr;
65  pBS_Addr = dynamic_cast<ByteStreamAddress *>( pAddr );
66  if ( !pBS_Addr ) {
67  ATH_MSG_ERROR( " Can not cast to ByteStreamAddress " );
68  return StatusCode::FAILURE;
69  }
70 
71  const std::string nm = *( pBS_Addr->par() );
72 
73  ATH_MSG_DEBUG( " Creating Objects " << nm );
74 
75  auto errCollection = std::make_unique<std::vector<unsigned int> >();
76 
77  ATH_CHECK( m_tool->errors(errCollection.get()) );
78 
79  pObj = SG::asStorable(std::move(errCollection));
80 
81  return StatusCode::SUCCESS;
82 }
83 
84 } // end namespace
LVL1BS::L1CaloErrorByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition: L1CaloErrorByteStreamCnv.cxx:51
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
StorableConversions.h
convert to and from a SG storable
LVL1BS::L1CaloErrorByteStreamCnv::createObjConst
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create error vector from ByteStream.
Definition: L1CaloErrorByteStreamCnv.cxx:61
initialize
void initialize()
Definition: run_EoverP.cxx:894
SG::asStorable
DataObject * asStorable(T *pObject)
Definition: StorableConversions.h:158
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
LVL1BS::L1CaloErrorByteStreamCnv::~L1CaloErrorByteStreamCnv
virtual ~L1CaloErrorByteStreamCnv()
Definition: L1CaloErrorByteStreamCnv.cxx:32
LVL1BS::L1CaloErrorByteStreamCnv::m_tool
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_tool
Tool that does the actual work.
Definition: L1CaloErrorByteStreamCnv.h:49
StlVectorClids.h
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...
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
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
LVL1BS::L1CaloErrorByteStreamCnv::storageType
static long storageType()
Definition: L1CaloErrorByteStreamCnv.cxx:43
L1CaloErrorByteStreamTool.h
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
LVL1BS::L1CaloErrorByteStreamCnv::classID
static const CLID & classID()
Definition: L1CaloErrorByteStreamCnv.cxx:38
L1CaloErrorByteStreamCnv.h
LVL1BS::L1CaloErrorByteStreamCnv::L1CaloErrorByteStreamCnv
L1CaloErrorByteStreamCnv(ISvcLocator *svcloc)
Definition: L1CaloErrorByteStreamCnv.cxx:26