ATLAS Offline Software
Loading...
Searching...
No Matches
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
19
21
23
24namespace LVL1BS {
25
27 : AthConstConverter( storageType(), classID(), svcloc, "L1CaloErrorByteStreamCnv" ),
28 m_tool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool")
29{
30}
31
35
36// CLID
37
42
47
48// Init method gets all necessary services etc.
49
50
52{
53 ATH_CHECK( Converter::initialize() );
54 ATH_CHECK( m_tool.retrieve() );
55
56 return StatusCode::SUCCESS;
57}
58
59// createObj should create the RDO from bytestream.
60
61StatusCode L1CaloErrorByteStreamCnv::createObjConst ( IOpaqueAddress* pAddr,
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
std::vector< Identifier > ID
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Helpers for checking error return status codes and reporting errors.
uint32_t CLID
The Class ID type.
convert to and from a SG storable
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create error vector from ByteStream.
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_tool
Tool that does the actual work.
virtual StatusCode initialize() override
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Default, invalid implementation of ClassID_traits.