ATLAS Offline Software
AFP_RawDataProviderTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // AFP_ByteStream2RawCnv includes
7 
8 static const InterfaceID
9  IID_IAFP_RawCollByteStreamTool("AFP_RawDataProviderTool", 1, 0);
11  return IID_IAFP_RawCollByteStreamTool;
12 }
13 
15  const std::string &name,
16  const IInterface *parent)
18 {
19  declareInterface<AFP_RawDataProviderTool>(this);
20 }
21 
23 
25  ATH_MSG_INFO("Initializing " << name() << "...");
26 
28  ATH_MSG_DEBUG("INITIALIZE AFP_RawDataProviderTool");
29  if (sc.isFailure()) {
30  ATH_MSG_WARNING(" Failed to init baseclass");
31  return StatusCode::SUCCESS;
32  }
33 
34  if (m_decoder.retrieve().isFailure()) {
35  ATH_MSG_WARNING("FAILED TO RETRIEVE TOOL " << m_decoder);
36  return StatusCode::SUCCESS;
37  } else {
38  ATH_MSG_DEBUG("Retrieved decoder tool " << m_decoder);
39  }
40  return StatusCode::SUCCESS;
41 }
42 
44 AFP_RawDataProviderTool::convert(std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *> &vecRobs,
45  AFP_RawContainer *rawContainer) const
46 {
47  std::set<uint32_t> robIdSet;
48 
49  if (!rawContainer) {
50  ATH_MSG_WARNING("NULL pointer passed in rawContainer.");
51  return StatusCode::SUCCESS;
52  }
53 
54  if (vecRobs.empty()) {
55  ATH_MSG_DEBUG("vecRobs.size() == 0");
56  return StatusCode::SUCCESS;
57  }
58 
59  // Loop over robs and fill rawContainer
60  for (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* rob : vecRobs) {
61  const uint32_t robId = rob->rod_source_id();
62 
63  if (robIdSet.insert(robId).second) {
64  StatusCode sc = m_decoder->fillCollection(rob, rawContainer);
65  if (sc.isFailure()) {
66  ATH_MSG_ERROR("Failed filling collection");
67  return StatusCode::FAILURE;
68  }
69  }
70 
71  } // end for loop
72 
73  return StatusCode::SUCCESS;
74 }
75 
78  ATH_MSG_DEBUG("FINALIZE AFP_RawDataProviderTool");
79  if (sc.isFailure()) {
80  ATH_MSG_WARNING("FINALIZE failed");
81  return StatusCode::SUCCESS;
82  }
83 
84  return StatusCode::SUCCESS;
85 }
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
AFP_RawDataProviderTool::initialize
virtual StatusCode initialize()
Definition: AFP_RawDataProviderTool.cxx:24
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AFP_RawDataProviderTool::finalize
virtual StatusCode finalize()
Definition: AFP_RawDataProviderTool.cxx:76
initialize
void initialize()
Definition: run_EoverP.cxx:894
AFP_RawDataProviderTool::AFP_RawDataProviderTool
AFP_RawDataProviderTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AFP_RawDataProviderTool.cxx:14
AFP_RawDataProviderTool::m_decoder
ToolHandle< AFP_ByteStream2RawCnv > m_decoder
Definition: AFP_RawDataProviderTool.h:39
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AFP_RawContainer
Definition: AFP_RawContainer.h:13
AFP_RawDataProviderTool::interfaceID
static const InterfaceID & interfaceID()
Definition: AFP_RawDataProviderTool.cxx:10
AFP_RawDataProviderTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
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
AFP_RawDataProviderTool::convert
StatusCode convert(std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, AFP_RawContainer *rawContainer) const
Fill rawContainer with collections created from provided vecRobs.
Definition: AFP_RawDataProviderTool.cxx:44
AFP_RawDataProviderTool::~AFP_RawDataProviderTool
virtual ~AFP_RawDataProviderTool()
Does nothing.
Definition: AFP_RawDataProviderTool.cxx:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthAlgTool
Definition: AthAlgTool.h:26