ATLAS Offline Software
Loading...
Searching...
No Matches
RpcRdoToPrepDataToolMT.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONRDOTOPREPDATA_RPCRDOTOPREPDATATOOLMT_H
6#define MUONRDOTOPREPDATA_RPCRDOTOPREPDATATOOLMT_H
7
8#include <set>
9
26namespace Muon {
27
29
31 : public extends<AthAlgTool, IMuonRdoToPrepDataTool> {
32 public:
33 using base_class::base_class;
34 // setup/teardown functions, similar like those for Algorithm/Service
35 virtual StatusCode initialize() override;
36
37 virtual StatusCode finalize() override;
38
39 virtual StatusCode decode(const EventContext& ctx,
40 const std::vector<IdentifierHash>& idVect) const override;
41
42 virtual StatusCode decode(const EventContext& ctx,
43 const std::vector<uint32_t>& robIds) const override;
44 virtual StatusCode provideEmptyContainer(const EventContext& ctx) const override;
45
46 protected:
47 struct State {
48 State(const IMuonIdHelperSvc* idHelperSvc);
49
52
53
55
56 std::vector<std::unique_ptr<RpcPrepDataCollection>> rpcPrepDataCollections{};
57 std::vector<std::unique_ptr<RpcCoinDataCollection>> rpcCoinDataCollections{};
58
60 std::unique_ptr<RpcPrepDataContainer> prepDataCont{nullptr};
62 std::unique_ptr<RpcCoinDataContainer> coinDataCont{nullptr};
63
64
65 // keepTrackOfFullEventDecoding
66 bool m_fullEventDone{false};
67
68 // the set of already requested and decoded offline (PrepRawData)
69 // collections
70 std::unordered_set<IdentifierHash> m_decodedOfflineHashIds{};
71
72 // the set of unrequested collections with phi hits stored with
73 // ambiguityFlag > 1
74 std::unordered_set<IdentifierHash> m_ambiguousCollections{};
75
76 // the set of already requested and decoded ROBs
77 std::unordered_set<uint32_t> m_decodedRobIds{};
78 };
79
81 StatusCode transferAndRecordPrepData(const EventContext& ctx,
82 State& state) const;
84 StatusCode transferAndRecordCoinData(const EventContext& ctx,
85 State& state) const;
87 StatusCode loadProcessedChambers(const EventContext& ctx, State& state) const;
88
89 void printMTPrepData(const RpcPrepDataContainer& prepData) const;
90 void printMTCoinData(const RpcCoinDataContainer& prepData) const;
91
92 // decoding method
93 StatusCode decodeImpl(const EventContext& ctx, State& state,
94 const std::vector<IdentifierHash>& idVect,
95 bool firstTimeInTheEvent) const;
96 StatusCode decodeImpl(const EventContext& ctx, State& state,
97 const std::vector<uint32_t>& robIds,
98 bool firstTimeInTheEvent) const;
99
100 StatusCode processPad(const EventContext& ctx, State& state,
101 const RpcPad* rdoColl, bool& processingetaview,
102 bool& processingphiview, int& nPrepRawData,
103 const std::vector<IdentifierHash>& idVect,
104 bool doingSecondLoopAmbigColls) const;
105
108 bool highptpad, // these are inputs
109 bool& triggerHit, unsigned short& threshold,
110 unsigned short& overlap, bool& toSkip) const;
111
112 StatusCode processNrpcRdo(const EventContext& ctx, State& state) const;
113
114
115
117 Gaudi::Property<float> m_etaphi_coincidenceTime{
118 this, "etaphi_coincidenceTime", 20., "time for phi*eta coincidence"};
119
120 Gaudi::Property<float> m_overlap_timeTolerance{
121 this, "overlap_timeTolerance", 10.,
122 "tolerance of the timing calibration"};
123 Gaudi::Property<bool> m_producePRDfromTriggerWords{
124 this, "produceRpcCoinDatafromTriggerWords", true,
125 "tore as prd the trigger hits"};
126 Gaudi::Property<bool> m_solvePhiAmbiguities{
127 this, "solvePhiAmbiguities", true,
128 "toggle on/off the removal of phi ambiguities"};
129 Gaudi::Property<bool> m_reduceCablingOverlap{
130 this, "reduceCablingOverlap", true, "toggle on/off the overlap removal"};
131 Gaudi::Property<float> m_timeShift{this, "timeShift", -12.5,
132 "any global time shift ?!"};
133 Gaudi::Property<bool> m_decodeData{
134 this, "DecodeData",
135 true};
136 Gaudi::Property<bool> m_RPCInfoFromDb{this, "RPCInfoFromDb", false};
137
138 Gaudi::Property<bool> m_isMC{this, "isMC", false};
139
141 this, "DetectorManagerKey", "MuonDetectorManager",
142 "Key of input MuonDetectorManager condition data"};
143
145 this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
146
149 this, "OutputCollection", "RPC_Measurements"};
150
152 this, "TriggerOutputCollection", "RPC_triggerHits"};
153
155 "RPCPAD"};
156
158 this, "NrpcInputCollection", "NRPCRDO"};
159
160 // Rob Data Provider handle
161 ToolHandle<IRPC_RDO_Decoder> m_rpcRdoDecoderTool{
162 this, "RdoDecoderTool", "Muon::RpcRDO_Decoder"};
163
165 this, "ReadKey", "RpcCondDbData", "Key of RpcCondDbData"};
167 this, "RpcCablingKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
168 SG::ReadCondHandleKey<RpcCablingMap> m_nRpcCablingKey{this, "NrpcCablingKey","MuonNRPC_CablingMap",
169 "Key of MuonNRPC_CablingMap"};
170
173 this, "RpcPrdContainerCacheKey", "",
174 "Optional external cache for the RPC PRD container"};
176 this, "RpcCoinDataContainerCacheKey", "",
177 "Optional external cache for the RPC coin data container"};
178
179 Gaudi::Property<double> m_stripTimeResolution{this, "timeResolution", 0.6 * Gaudi::Units::nanosecond,
180 "Estimated time resolution of the strip readout"};
181
182 private:
183 mutable std::atomic_int m_spuriousHitCounter;
184};
185} // namespace Muon
186
187#endif // !ATHEXJOBOPTIONS_CONCRETETOOL_H
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
SG::ReadCondHandleKey< RpcCondDbData > m_readKey
StatusCode decodeImpl(const EventContext &ctx, State &state, const std::vector< IdentifierHash > &idVect, bool firstTimeInTheEvent) const
Gaudi::Property< bool > m_RPCInfoFromDb
correct time prd from cool db
ServiceHandle< IMuonIdHelperSvc > m_idHelperSvc
void printMTPrepData(const RpcPrepDataContainer &prepData) const
StatusCode transferAndRecordPrepData(const EventContext &ctx, State &state) const
Stores the PrepData container into store gate.
Gaudi::Property< bool > m_producePRDfromTriggerWords
SG::ReadHandleKey< RpcPadContainer > m_rdoContainerKey
void printMTCoinData(const RpcCoinDataContainer &prepData) const
SG::WriteHandleKey< RpcCoinDataContainer > m_rpcCoinDataContainerKey
RpcCoinData containers.
Gaudi::Property< bool > m_decodeData
toggle on/off the decoding of RPC RDO into RpcPerpData
virtual StatusCode decode(const EventContext &ctx, const std::vector< IdentifierHash > &idVect) const override
This code is thread-safe as we will propagate local thread collection contents to a thread-safe one.
Gaudi::Property< float > m_timeShift
StatusCode loadProcessedChambers(const EventContext &ctx, State &state) const
Load the hashes of the processed chambers.
StatusCode processPad(const EventContext &ctx, State &state, const RpcPad *rdoColl, bool &processingetaview, bool &processingphiview, int &nPrepRawData, const std::vector< IdentifierHash > &idVect, bool doingSecondLoopAmbigColls) const
Gaudi::Property< float > m_overlap_timeTolerance
SG::UpdateHandleKey< RpcCoinDataCollection_Cache > m_coindataContainerCacheKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
StatusCode processNrpcRdo(const EventContext &ctx, State &state) const
15 ns should be the max.diff.
void processTriggerHitHypothesis(RpcCoinMatrix::const_iterator itD, RpcCoinMatrix::const_iterator itD_end, bool highptpad, bool &triggerHit, unsigned short &threshold, unsigned short &overlap, bool &toSkip) const
virtual StatusCode initialize() override
SG::ReadCondHandleKey< RpcCablingCondData > m_rpcReadKey
SG::WriteHandleKey< RpcPrepDataContainer > m_rpcPrepDataContainerKey
RpcPrepData containers.
Gaudi::Property< float > m_etaphi_coincidenceTime
3 ns is the resolution of the RPC readout electronics
ToolHandle< IRPC_RDO_Decoder > m_rpcRdoDecoderTool
virtual StatusCode finalize() override
SG::ReadCondHandleKey< RpcCablingMap > m_nRpcCablingKey
Gaudi::Property< bool > m_solvePhiAmbiguities
Gaudi::Property< double > m_stripTimeResolution
virtual StatusCode provideEmptyContainer(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::NRPCRDOContainer > m_rdoNrpcContainerKey
StatusCode transferAndRecordCoinData(const EventContext &ctx, State &state) const
Stores the CoinData container into store gate.
Gaudi::Property< bool > m_reduceCablingOverlap
SG::UpdateHandleKey< RpcPrepDataCollection_Cache > m_prdContainerCacheKey
This is the key for the cache for the MDT PRD containers, can be empty.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which an UpdateHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer
MuonCoinDataContainer< RpcCoinDataCollection > RpcCoinDataContainer
MuonCoinDataCollection< RpcCoinData > RpcCoinDataCollection
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection
RpcCoinDataCollection * getCoinCollection(const Identifier &id)
std::vector< std::unique_ptr< RpcPrepDataCollection > > rpcPrepDataCollections
std::unique_ptr< RpcPrepDataContainer > prepDataCont
Pointer of the prep container stored in store gate.
std::unique_ptr< RpcCoinDataContainer > coinDataCont
Pointer of the coin container stored in store gate.
std::unordered_set< IdentifierHash > m_ambiguousCollections
std::unordered_set< uint32_t > m_decodedRobIds
std::unordered_set< IdentifierHash > m_decodedOfflineHashIds
std::vector< std::unique_ptr< RpcCoinDataCollection > > rpcCoinDataCollections
State(const IMuonIdHelperSvc *idHelperSvc)
RpcPrepDataCollection * getPrepCollection(const Identifier &id)