ATLAS Offline Software
Loading...
Searching...
No Matches
RpcTrackAnaAlg.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 RPCRAWDATAMONITORING_RPCTRACKANAALG_H
6#define RPCRAWDATAMONITORING_RPCTRACKANAALG_H
7
8#include <time.h>
9
10#include <map>
11#include <set>
12#include <string>
13#include <utility>
14#include <vector>
15
16// Athena/Gaudi
21
22// ATLAS
35
36// local
37#include "RPCDQUtils.h"
38
40 public:
41 RpcTrackAnaAlg(const std::string& name, ISvcLocator* pSvcLocator);
42 virtual ~RpcTrackAnaAlg();
43
44 virtual StatusCode initialize() override;
45 virtual StatusCode fillHistograms(const EventContext& ctx) const override;
46
47 typedef std::map<Identifier, std::shared_ptr<RpcPanel>> RpcPanelMap;
48 typedef std::pair<ExResult, const std::shared_ptr<GasGapData>> GasGapResult;
49
50 private:
51 enum BarrelDL {
52 BI = 1,
58 }; // Barrel doublet: BM_dbR
59 enum MuonSource { AllMuon = 0, ZCand };
60
61 StatusCode readElIndexFromXML();
62 StatusCode initRpcPanel();
63 StatusCode setPanelIndex(std::shared_ptr<RpcPanel> panel);
64
65 StatusCode initTrigTag();
66 StatusCode initArrayHistosMap();
67
68 StatusCode fillMuonExtrapolateEff(const EventContext& ctx) const;
69 StatusCode fillHistPRD(const EventContext& ctx) const;
70
71 StatusCode triggerMatching(const xAOD::Muon*,
72 const std::vector<TagDef>&) const;
73
74 StatusCode extrapolate2RPC(const xAOD::TrackParticle* track,
75 const Trk::PropDirection direction,
76 std::vector<GasGapResult>& results,
77 BarrelDL barrelDL) const;
78 std::unique_ptr<Trk::TrackParameters> computeTrackIntersectionWithGasGap(
79 ExResult& result, const xAOD::TrackParticle* track_particle,
80 const std::shared_ptr<GasGapData>& gap) const;
81
82 StatusCode extrapolate2RPC(std::unique_ptr<Trk::TrackParameters> trackParam,
83 const Trk::PropDirection direction,
84 std::vector<GasGapResult>& results,
85 BarrelDL barrelDL) const;
86 std::unique_ptr<Trk::TrackParameters> computeTrackIntersectionWithGasGap(
87 ExResult& result, const Trk::TrackParameters* trackParam,
88 const std::shared_ptr<GasGapData>& gap) const;
89
90 StatusCode readHitsPerGasgap(const EventContext& ctx,
91 std::vector<GasGapResult>& results,
92 MuonSource muon_source) const;
93 StatusCode fillClusterSize(std::vector<const Muon::RpcPrepData*>& view_hits,
94 const int panel_index, int LB, int phiSector,
95 int isPhi) const;
96 bool IsNearbyHit(const std::vector<const Muon::RpcPrepData*>& cluster_hits,
97 const Muon::RpcPrepData* hit) const;
98
99 private:
100 BooleanProperty m_plotMuonEff{
101 this, "plotMuonEff", false,
102 "switch to plot histograms for Muon Efficiency"};
103 BooleanProperty m_plotPRD{
104 this, "plotPRD", false,
105 "switch to plot histograms for Prepare Data objects"};
106 BooleanProperty m_useAODParticle{this, "useAODParticle", false,
107 "use AOD Particle"};
108
109 FloatProperty m_lbDuraThr{this, "lbDuraThr", 10.,
110 "Thrshold of luminosity block deruation"};
111 StringProperty m_packageName{this, "PackageName", "RpcTrackAnaAlg",
112 "group name for histograming"};
113
114 StringProperty m_elementsFileName{this, "ElementsFileName", "RpcRawDataMonitoring/Element.xml",
115 "Elements xml file"};
116
117 StringProperty m_trigTagList{
118 this, "TagTrigList", "HLT_mu_ivarmedium;HLT_mu50",
119 "list of triggers to be used for trigger matching"};
120 FloatProperty m_trigMatchWindow{this, "TrigMatchingWindow", 0.005,
121 "Window size in R for trigger matching"};
122 BooleanProperty m_TagAndProbe{this, "TagAndProbe", false,
123 "switch to perform tag-and-probe method"};
124 BooleanProperty m_TagAndProbeZmumu{
125 this, "TagAndProbeZmumu", false,
126 "switch to perform tag-and-probe method Z->mumu"};
127
128 // cuts for muons
129 FloatProperty m_minPt{this, "minPt", 25.0e3, "minmum pT of muon"};
130 FloatProperty m_maxEta{this, "maxEta", 2.5,
131 "max eta absolute value of muon"};
132
133 // cuts for barrel muons
134 FloatProperty m_barrelMinPt{this, "barrelMinPt", 2.0e3};
135 FloatProperty m_barrelMinEta{this, "barrelMinEta", 0.1};
136 FloatProperty m_barrelMaxEta{this, "barrelMaxEta", 1.05};
137
138 FloatProperty m_muonMass{this, "MuonMass", ParticleConstants::muonMassInMeV,
139 "muon invariant mass in MeV"};
140 FloatProperty m_zMass_lowLimit{
141 this, "zMass_lowLimit", 50000.,
142 "2 muon invariant mass low limit in Zmumu event"};
143 FloatProperty m_zMass_upLimit{
144 this, "zMass_upLimit", 150000.,
145 "2 muon invariant mass up limit in Zmumu event"};
146
147 FloatProperty m_isolationWindow{
148 this, "IsolationWindow", 0.1,
149 "Window size in R for isolation with other muons"};
150 FloatProperty m_l1trigMatchWindow{
151 this, "L1TrigMatchingWindow", 0.3,
152 "Window size in R for L1 trigger matching"};
153 // StringProperty
154 // m_MuonEFContainerName{this,"MuonEFContainerName","HLT_MuonsCBOutsideIn","HLT
155 // RoI-based muon track container"};
156 FloatProperty m_minDRTrackToGasGap{
157 this, "minDRTrackToGasGap", 0.02,
158 "minimum of DR between track and gasgap"};
159
161 this, "boundsToleranceReadoutElement", 100.0,
162 "boundsToleranceReadoutElement"};
164 this, "boundsToleranceReadoutElementTight", 20.0,
165 "boundsToleranceReadoutElementTight"};
166
168 this, "diffHitTrackPostion", 30.0,
169 "the largest distance between hit and tracks local postion"};
170 FloatProperty m_outtime{this, "outtime", 12.5, "the out-time time"};
171
174 this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
175
176 const RpcIdHelper* m_rpcIdHelper{nullptr};
177
178 ToolHandle<Trk::IExtrapolator> m_extrapolator{
179 this, "TrackExtrapolator", "Trk::Extrapolator/AtlasExtrapolator",
180 "Track extrapolator"};
182 this, "MuonRoIContainerName", "LVL1MuonRoIs", "Key for L1 ROIs"};
184 this, "MuonContainerKey", "Muons",
185 "Key for Offline muon track Containers"};
187 this, "RpcPrepDataContainer", "RPC_Measurements", "RPC PRDs"};
189 this, "PrimaryVertexContainerName", "PrimaryVertices",
190 "Primary Vertex Container"};
191
192 // accessors for beam spot uncertainty
194 this, "beamPosSigmaX", "EventInfo.beamPosSigmaX",
195 "Beam spot position sigma in X"};
197 this, "beamPosSigmaY", "EventInfo.beamPosSigmaY",
198 "Beam spot position sigma in Y"};
199 // note that this last entry is a covariance: the units are mm^2,
200 // whereas the above have units of mm
202 this, "beamPosSigmaXY", "EventInfo.beamPosSigmaXY",
203 "Beam spot covariance in XY"};
204
206
207 std::vector<TagDef> m_trigTagDefs{};
208
209 std::map<std::pair<int, int>, std::vector<std::shared_ptr<GasGapData>>>
211
212 // 2=BML,3=BMS,4=BOL,5=BOS,8=BMF,9=BOF,10=BOG,53=BME
213 std::map<BarrelDL, std::vector<int>> m_StationNames{};
214 std::map<std::string, int> m_elementIndex{};
215
216 std::map<std::string, int> m_SectorGroup{};
217 std::map<std::string, int> m_TriggerThrGroup{};
218};
219
220#endif
A number of constexpr particle constants to avoid hardcoding them directly in various places.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Class to represent RPC measurements.
Definition RpcPrepData.h:35
std::map< std::string, int > m_elementIndex
BooleanProperty m_TagAndProbe
StatusCode initRpcPanel()
BooleanProperty m_plotMuonEff
FloatProperty m_minDRTrackToGasGap
StatusCode fillClusterSize(std::vector< const Muon::RpcPrepData * > &view_hits, const int panel_index, int LB, int phiSector, int isPhi) const
FloatProperty m_zMass_lowLimit
virtual StatusCode initialize() override
initialize
FloatProperty m_lbDuraThr
std::map< std::pair< int, int >, std::vector< std::shared_ptr< GasGapData > > > m_gasGapData
StatusCode initArrayHistosMap()
FloatProperty m_l1trigMatchWindow
FloatProperty m_outtime
SG::ReadDecorHandleKey< xAOD::EventInfo > m_beamSigmaX
FloatProperty m_muonMass
FloatProperty m_barrelMinPt
FloatProperty m_diffHitTrackPostion
std::map< std::string, int > m_SectorGroup
StatusCode fillHistPRD(const EventContext &ctx) const
StatusCode triggerMatching(const xAOD::Muon *, const std::vector< TagDef > &) const
StatusCode setPanelIndex(std::shared_ptr< RpcPanel > panel)
std::vector< TagDef > m_trigTagDefs
FloatProperty m_maxEta
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::pair< ExResult, const std::shared_ptr< GasGapData > > GasGapResult
FloatProperty m_trigMatchWindow
virtual ~RpcTrackAnaAlg()
StatusCode initTrigTag()
std::map< Identifier, std::shared_ptr< RpcPanel > > RpcPanelMap
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
FloatProperty m_barrelMaxEta
RpcPanelMap m_rpcPanelMap
FloatProperty m_barrelMinEta
const RpcIdHelper * m_rpcIdHelper
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_rpcPrdKey
StatusCode readElIndexFromXML()
SG::ReadDecorHandleKey< xAOD::EventInfo > m_beamSigmaXY
FloatProperty m_isolationWindow
FloatProperty m_boundsToleranceReadoutElement
BooleanProperty m_plotPRD
ToolHandle< Trk::IExtrapolator > m_extrapolator
std::map< std::string, int > m_TriggerThrGroup
bool IsNearbyHit(const std::vector< const Muon::RpcPrepData * > &cluster_hits, const Muon::RpcPrepData *hit) const
FloatProperty m_minPt
StringProperty m_elementsFileName
SG::ReadDecorHandleKey< xAOD::EventInfo > m_beamSigmaY
StatusCode fillMuonExtrapolateEff(const EventContext &ctx) const
std::unique_ptr< Trk::TrackParameters > computeTrackIntersectionWithGasGap(ExResult &result, const xAOD::TrackParticle *track_particle, const std::shared_ptr< GasGapData > &gap) const
StatusCode extrapolate2RPC(const xAOD::TrackParticle *track, const Trk::PropDirection direction, std::vector< GasGapResult > &results, BarrelDL barrelDL) const
FloatProperty m_zMass_upLimit
StringProperty m_packageName
SG::ReadHandleKey< xAOD::MuonRoIContainer > m_MuonRoIContainerKey
RpcTrackAnaAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::map< BarrelDL, std::vector< int > > m_StationNames
StatusCode readHitsPerGasgap(const EventContext &ctx, std::vector< GasGapResult > &results, MuonSource muon_source) const
SG::ReadHandleKey< xAOD::VertexContainer > m_PrimaryVertexContainerKey
FloatProperty m_boundsToleranceReadoutElementTight
StringProperty m_trigTagList
BooleanProperty m_TagAndProbeZmumu
BooleanProperty m_useAODParticle
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
constexpr double muonMassInMeV
the mass of the muon (in MeV)
PropDirection
PropDirection, enum for direction of the propagation.
ParametersBase< TrackParametersDim, Charged > TrackParameters
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version: