ATLAS Offline Software
Loading...
Searching...
No Matches
RpcRdoToPrepDataToolMT.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
27namespace Muon {
28
30
32 : public extends<AthAlgTool, IMuonRdoToPrepDataTool> {
33 public:
34 using base_class::base_class;
35 // setup/teardown functions, similar like those for Algorithm/Service
36 virtual StatusCode initialize() override;
37
38 virtual StatusCode finalize() override;
39
40 virtual StatusCode decode(const EventContext& ctx,
41 const std::vector<IdentifierHash>& idVect) const override;
42
43 virtual StatusCode decode(const EventContext& ctx,
44 const std::vector<uint32_t>& robIds) const override;
45 virtual StatusCode provideEmptyContainer(const EventContext& ctx) const override;
46
47 protected:
48 struct State {
49 State(const IMuonIdHelperSvc* idHelperSvc);
50
53
54
56
57 std::vector<std::unique_ptr<RpcPrepDataCollection>> rpcPrepDataCollections{};
58 std::vector<std::unique_ptr<RpcCoinDataCollection>> rpcCoinDataCollections{};
59
61 std::unique_ptr<RpcPrepDataContainer> prepDataCont{nullptr};
63 std::unique_ptr<RpcCoinDataContainer> coinDataCont{nullptr};
64
65
66 // keepTrackOfFullEventDecoding
67 bool m_fullEventDone{false};
68
69 // the set of already requested and decoded offline (PrepRawData)
70 // collections
71 std::unordered_set<IdentifierHash> m_decodedOfflineHashIds{};
72
73 // the set of unrequested collections with phi hits stored with
74 // ambiguityFlag > 1
75 std::unordered_set<IdentifierHash> m_ambiguousCollections{};
76
77 // the set of already requested and decoded ROBs
78 std::unordered_set<uint32_t> m_decodedRobIds{};
79 };
80
82 StatusCode transferAndRecordPrepData(const EventContext& ctx,
83 State& state) const;
85 StatusCode transferAndRecordCoinData(const EventContext& ctx,
86 State& state) const;
88 StatusCode loadProcessedChambers(const EventContext& ctx, State& state) const;
89
90 void printMTPrepData(const RpcPrepDataContainer& prepData) const;
91 void printMTCoinData(const RpcCoinDataContainer& prepData) const;
92
93 // decoding method
94 StatusCode decodeImpl(const EventContext& ctx, State& state,
95 const std::vector<IdentifierHash>& idVect,
96 bool firstTimeInTheEvent) const;
97 StatusCode decodeImpl(const EventContext& ctx, State& state,
98 const std::vector<uint32_t>& robIds,
99 bool firstTimeInTheEvent) const;
100
101 StatusCode processPad(const EventContext& ctx, State& state,
102 const RpcPad* rdoColl, bool& processingetaview,
103 bool& processingphiview, int& nPrepRawData,
104 const std::vector<IdentifierHash>& idVect,
105 bool doingSecondLoopAmbigColls) const;
106
109 bool highptpad, // these are inputs
110 bool& triggerHit, unsigned short& threshold,
111 unsigned short& overlap, bool& toSkip) const;
112
113 StatusCode processNrpcRdo(const EventContext& ctx, State& state) const;
114
115
116
118 Gaudi::Property<float> m_etaphi_coincidenceTime{
119 this, "etaphi_coincidenceTime", 20., "time for phi*eta coincidence"};
120
121 Gaudi::Property<float> m_overlap_timeTolerance{
122 this, "overlap_timeTolerance", 10.,
123 "tolerance of the timing calibration"};
124 Gaudi::Property<bool> m_producePRDfromTriggerWords{
125 this, "produceRpcCoinDatafromTriggerWords", true,
126 "tore as prd the trigger hits"};
127 Gaudi::Property<bool> m_solvePhiAmbiguities{
128 this, "solvePhiAmbiguities", true,
129 "toggle on/off the removal of phi ambiguities"};
130 Gaudi::Property<bool> m_reduceCablingOverlap{
131 this, "reduceCablingOverlap", true, "toggle on/off the overlap removal"};
132 Gaudi::Property<float> m_timeShift{this, "timeShift", -12.5,
133 "any global time shift ?!"};
134 Gaudi::Property<bool> m_decodeData{
135 this, "DecodeData",
136 true};
137 Gaudi::Property<bool> m_RPCInfoFromDb{this, "RPCInfoFromDb", false};
138
139 Gaudi::Property<bool> m_isMC{this, "isMC", false};
140
142 this, "DetectorManagerKey", "MuonDetectorManager",
143 "Key of input MuonDetectorManager condition data"};
144
146 this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
147
150 this, "OutputCollection", "RPC_Measurements"};
151
153 this, "TriggerOutputCollection", "RPC_triggerHits"};
154
156 "RPCPAD"};
157
159 this, "NrpcInputCollection", "NRPCRDO"};
160
161 // Rob Data Provider handle
162 ToolHandle<IRPC_RDO_Decoder> m_rpcRdoDecoderTool{
163 this, "RdoDecoderTool", "Muon::RpcRDO_Decoder"};
164
166 this, "ReadKey", "RpcCondDbData", "Key of RpcCondDbData"};
168 this, "RpcCablingKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
169 SG::ReadCondHandleKey<RpcCablingMap> m_nRpcCablingKey{this, "NrpcCablingKey","MuonNRPC_CablingMap",
170 "Key of MuonNRPC_CablingMap"};
171
174 this, "RpcPrdContainerCacheKey", "",
175 "Optional external cache for the RPC PRD container"};
177 this, "RpcCoinDataContainerCacheKey", "",
178 "Optional external cache for the RPC coin data container"};
179
181 this, "xAODKey", "",
182 "If empty, do not produce xAOD, otherwise this is the key of the output "
183 "xAOD MDT PRD container"};
184
185 Gaudi::Property<double> m_stripTimeResolution{this, "timeResolution", 0.6 * Gaudi::Units::nanosecond,
186 "Estimated time resolution of the strip readout"};
187
188 private:
189 mutable std::atomic_int m_spuriousHitCounter;
190};
191} // namespace Muon
192
193#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
SG::WriteHandleKey< xAOD::RpcStripContainer > m_xAODKey
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.
MuonCoinDataCollection< RpcCoinData > RpcCoinDataCollection
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer
MuonCoinDataContainer< RpcCoinDataCollection > RpcCoinDataContainer
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)