ATLAS Offline Software
SCTRawDataProviderTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 #include "StoreGate/ReadHandle.h"
9 
11 
12 // Constructor
13 SCTRawDataProviderTool::SCTRawDataProviderTool(const std::string& type, const std::string& name,
14  const IInterface* parent) :
15  base_class(type, name, parent)
16 {
17 }
18 
19 // Initialize
21 {
22  ATH_CHECK(m_decoder.retrieve());
23 
24  return StatusCode::SUCCESS;
25 }
26 
27 
28 // Convert method
29 StatusCode SCTRawDataProviderTool::convert(std::vector<const ROBFragment*>& vecROBFrags,
30  SCT_RDO_Container& rdoIDCont,
32  DataPool<SCT3_RawData>* dataItemsPool,
33  const EventContext& ctx) const
34 {
35  if (vecROBFrags.empty()) return StatusCode::SUCCESS;
36  ATH_MSG_DEBUG("SCTRawDataProviderTool::convert()");
37 
38 
39  // loop over the ROB fragments
40  StatusCode sc{StatusCode::SUCCESS};
41  for (const ROBFragment* robFrag : vecROBFrags) {
42  // get the ID of this ROB/ROD
43  sc = m_decoder->fillCollection(*robFrag, rdoIDCont, errs, dataItemsPool, ctx);
44  if (sc == StatusCode::FAILURE) {
45  if (m_decodeErrCount <= 100) {
46  if (100 == m_decodeErrCount) {
47  ATH_MSG_ERROR("Too many Problem with SCT Decoding messages, turning message off.");
48  }
49  else {
50  ATH_MSG_ERROR("Problem with SCT ByteStream Decoding!");
51  }
53  }
54  }
55  }
56 
57  if (sc == StatusCode::FAILURE) {
58  ATH_MSG_ERROR("There was a problem with SCT ByteStream conversion");
59  return sc;
60  }
61 
62  return sc;
63 }
SCTRawDataProviderTool::m_decodeErrCount
std::atomic_int m_decodeErrCount
Number of decode errors encountered in decoding.
Definition: SCTRawDataProviderTool.h:65
IDCInDetBSErrContainer
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
Definition: IDCInDetBSErrContainer.h:19
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SCTRawDataProviderTool::initialize
virtual StatusCode initialize() override
Initialize.
Definition: SCTRawDataProviderTool.cxx:20
SCTRawDataProviderTool::SCTRawDataProviderTool
SCTRawDataProviderTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: SCTRawDataProviderTool.cxx:13
SCTRawDataProviderTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition: RawEvent.h:27
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:47
SCTRawDataProviderTool::m_decoder
ToolHandle< ISCT_RodDecoder > m_decoder
Algorithm Tool to decode ROD byte stream into RDO.
Definition: SCTRawDataProviderTool.h:61
ISCT_RodDecoder.h
ReadHandle.h
Handle class for reading from StoreGate.
SCTRawDataProviderTool::convert
virtual StatusCode convert(std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecROBFrags, SCT_RDO_Container &rdoIDCont, IDCInDetBSErrContainer &errs, DataPool< SCT3_RawData > *dataItemsPool, const EventContext &ctx) const override
Main decoding method.
Definition: SCTRawDataProviderTool.cxx:29