ATLAS Offline Software
CSC_RawDataProviderToolCore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
13 #include "StoreGate/ReadHandle.h"
14 #include "StoreGate/WriteHandle.h"
15 
17 
18 //================ Constructor =================================================
19 
20 Muon::CSC_RawDataProviderToolCore::CSC_RawDataProviderToolCore(const std::string& t, const std::string& n, const IInterface* p) :
21  AthAlgTool(t, n, p), m_robDataProvider("ROBDataProviderSvc", n), m_cabling("CSCcablingSvc", n) {}
22 
23 //================ Initialisation =================================================
24 
26  ATH_CHECK(m_cabling.retrieve());
27  ATH_CHECK(m_robDataProvider.retrieve());
28  ATH_MSG_INFO("Retrieved service " << m_robDataProvider);
29 
30  ATH_CHECK(m_idHelperSvc.retrieve());
31  m_hid2re.set(&(*m_cabling), &m_idHelperSvc->cscIdHelper());
32 
33  // Retrieve decoder
34  ATH_CHECK(m_decoder.retrieve());
35  ATH_MSG_INFO("Retrieved tool " << m_decoder);
36 
37  ATH_CHECK(m_containerKey.initialize());
38  ATH_CHECK(m_eventInfoKey.initialize());
39 
40  ATH_MSG_INFO("initialize() successful in " << name());
41  return StatusCode::SUCCESS;
42 }
43 
44 //============================================================================================
45 
47  const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vecRobs, const EventContext& ctx,
48  CscRawDataContainer& container) const {
49  std::set<uint32_t> robIdSet;
50  SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey, ctx);
51 
52  ATH_MSG_DEBUG("Before processing numColls=" << container.numberOfCollections());
53 
54  ATH_MSG_DEBUG("vector of ROB ID to decode: size = " << vecRobs.size());
55 
56  for (const ROBFragment* frag : vecRobs) {
57  uint32_t robid = frag->rod_source_id();
58 
59  // check if this ROBFragment was already decoded (EF case in ROIs
60  if (!robIdSet.insert(robid).second) {
61  ATH_MSG_DEBUG(" ROB Fragment with ID " << std::hex << robid << std::dec << " already decoded, skip");
62  } else {
63  m_decoder->fillCollection(*eventInfo, *frag, container);
64  }
65  }
66 
67  ATH_MSG_DEBUG("After processing numColls=" << container.numberOfCollections());
68 
69  return StatusCode::SUCCESS;
70 }
CscIdHelper.h
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Muon::CSC_RawDataProviderToolCore::CSC_RawDataProviderToolCore
CSC_RawDataProviderToolCore(const std::string &t, const std::string &n, const IInterface *p)
Definition: CSC_RawDataProviderToolCore.cxx:20
ROBData.h
Defines the ROB data entity. The ROB data is an abstract entity that is used to discase the raw event...
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
WriteHandle.h
Handle class for recording to StoreGate.
IdentifiableContainerMT::numberOfCollections
virtual size_t numberOfCollections() const override final
return number of collections
Definition: IdentifiableContainerMT.h:216
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
Muon::CSC_RawDataProviderToolCore::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: CSC_RawDataProviderToolCore.cxx:25
beamspotman.n
n
Definition: beamspotman.py:731
RawEvent.h
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
Muon::CSC_RawDataProviderToolCore::convertIntoContainer
StatusCode convertIntoContainer(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, const EventContext &ctx, CscRawDataContainer &container) const
function to decode the passed ROB fragments into the passed container
Definition: CSC_RawDataProviderToolCore.cxx:46
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ByteStreamAddress.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition: RawEvent.h:27
MuonDetectorManager.h
CSC_RawDataProviderToolCore.h
CscRawDataContainer
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Definition: CscRawDataContainer.h:23
ByteStreamCnvSvcBase.h
ReadHandle.h
Handle class for reading from StoreGate.
AthAlgTool
Definition: AthAlgTool.h:26