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