ATLAS Offline Software
Loading...
Searching...
No Matches
L2muCombMonConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3import ROOT
4
5def L2muCombMonConfig(helper):
6
7 from AthenaConfiguration.ComponentFactory import CompFactory
8
9 GroupName = 'L2muComb'
10
11 from MuonSelectorTools.MuonSelectorToolsConfig import MuonSelectionToolCfg
12 from .MuonMatchingToolConfig import MuonMatchingToolConfig
13 monAlg = helper.addAlgorithm(CompFactory.L2muCombMon,'L2muCombMon',
14 MuonSelectionTool = helper.result().popToolsAndMerge(MuonSelectionToolCfg(helper.flags, MuQuality=1)),
15 MuonMatchingTool = helper.result().popToolsAndMerge(MuonMatchingToolConfig(helper.flags)))
16
17
18 from TrigConfigSvc.TriggerConfigAccess import getHLTMonitoringAccess
19 moniAccess = getHLTMonitoringAccess(helper.flags)
20 Chains = moniAccess.monitoredChains(signatures="muonMon",monLevels=["shifter","t0","val"])
21 monAlg.MonitoredChains = [c for c in Chains if ('mu24_ivarmedium' in c) or ('2mu14' in c)]
22 # adding lower pt chains, useful if menu is not pp collisions
23 if len(monAlg.MonitoredChains) == 0:
24 monAlg.MonitoredChains = [c for c in Chains if ('mu6' in c) or ('mu8' in c) or ('2mu4' in c)]
25
26 # if mon groups not found fall back to hard-coded trigger monitoring list
27 if len(monAlg.MonitoredChains) == 0:
28 # if mon groups not found fall back to hard-coded trigger monitoring list for pp and HI
29 monAlg.MonitoredChains = ['HLT_mu6_L1MU3V', 'HLT_mu8_L1MU8F', 'HLT_2m4_L12MU3V','HLT_mu6_L1MU5VF','HLT_mu24_ivarmedium_L1MU14FCH', 'HLT_2mu14_L12MU8F']
30
31 monAlg.Group = GroupName
32
33 # configuration of etaphi2D and Ratio plots for non-specific chain
34 histGroupNonSpecificChain = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/')
35
36 histGroupNonSpecificChain.defineHistogram('L2CBEta,L2CBPhi;L2muComb_Eta_vs_Phi',
37 title='L2muComb Eta vs Phi ;#eta;#phi',
38 type='TH2F', path='etaphi2D',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
39
40 histGroupNonSpecificChain.defineHistogram('L2CBAboveCut,LB;L2muComb_Over_OfflineCB_4GeV_Cut',
41 title='L2muComb Over OfflineCB 4GeV Cut;LB;Ratio',
42 type='TEfficiency', path='Ratio',xbins=400,xmin=1.,xmax=801.)
43
44
45 # configration for specific chain
46 for chain in monAlg.MonitoredChains:
47
48 histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/L2muComb/'+chain)
49
50
51 # basic EDM variables
52 histGroup.defineHistogram(chain+'_Pt;L2muComb_Pt',
53 title='L2muComb Pt '+chain+';p_{T} [GeV];Events',
54 type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
55
56 histGroup.defineHistogram(chain+'_Eta;L2muComb_Eta',
57 title='L2muComb Eta '+chain+';#eta;Events',
58 type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
59
60 histGroup.defineHistogram(chain+'_Phi;L2muComb_Phi',
61 title='L2muComb Phi '+chain+';#phi;Events',
62 type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
63
64 histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi',
65 title='L2muComb Eta vs Phi '+chain+';#eta;#phi',
66 type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
67
68
69 # eta vs. phi Combine success or failure, and matched or not offline muon
70 histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi_L2CB_success',
71 title='L2muComb Eta vs Phi (L2CB reconstruction success) '+chain+';#eta;#phi',
72 cutmask=chain+'_L2CB_success',
73 type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
74
75 histGroup.defineHistogram(chain+'_Eta,'+chain+'_Phi;L2muComb_Eta_vs_Phi_L2CBOFFmatching_failure',
76 title='L2muComb Eta vs Phi (L2CB reconstruction success Off match failure) '+chain+';#eta;#phi',
77 cutmask=chain+'_L2CBOFFmatching_failure',
78 type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
79
80 histGroup.defineHistogram(chain+'_saEta,'+chain+'_saPhi;L2MuonSA_Eta_vs_Phi_L2CB_failure',
81 title='L2MuonSA Eta vs Phi (L2CB reconstruction failure L2SA Off match success) '+chain+';#eta;#phi',
82 cutmask=chain+'_L2CB_failure',
83 type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
84
85
86 # L2MuonSA EDM variables in case of L2muComb failure
87 histGroup.defineHistogram(chain+'_saPt;L2muComb_failed_saPt',
88 title='L2MuonSA Pt (GeV/c) for muComb fails '+chain+';p_{T} [GeV];Events',
89 cutmask=chain+'_L2SA_success',
90 type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
91
92 histGroup.defineHistogram(chain+'_saEta;L2muComb_failed_saEta',
93 title='L2MuonSA Eta for muComb fails '+chain+';#eta;Events',
94 cutmask=chain+'_L2SA_success',
95 type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
96
97 histGroup.defineHistogram(chain+'_saPhi;L2muComb_failed_saPhi',
98 title='L2MuonSA Phi for muComb fails '+chain+';#phi;Events',
99 cutmask=chain+'_L2SA_success',
100 type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
101
102
103 # comparison L2muComb vs L2MuonSA
104 histGroup.defineHistogram(chain+'_ptratio_toSA;L2muComb_ptratio_toSA',
105 title='L2muComb pt / L2MuonSA pt '+chain+';p_{T} ratio;Events',
106 type='TH1F', path='',xbins=140,xmin=-0.5,xmax=3.)
107
108 histGroup.defineHistogram(chain+'_dR_toSA;L2muComb_dR_toSA',
109 title='L2muComb delta R to L2MuonSA '+chain+';#DeltaR;Events',
110 type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
111
112 histGroup.defineHistogram(chain+'_dEta_toSA;L2muComb_dEta_toSA',
113 title='L2muComb delta eta to L2MuonSA '+chain+';#Delta#eta;Events',
114 type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
115
116 histGroup.defineHistogram(chain+'_dPhi_toSA;L2muComb_dPhi_toSA',
117 title='L2muComb delta phi to L2MuonSA '+chain+';#Delta#phi;Events',
118 type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
119
120 histGroup.defineHistogram(chain+'_MF_error;L2muComb_MF_error',
121 title='L2muComb pointer to MuonFeature Error '+chain+';;Events',
122 type='TH1I', path='',xbins=4,xmin=0,xmax=4,
123 xlabels=["No error","Missing muSATrackLink","TrackLink and ElementLinnk matching error","SA reconstruction Error"])
124
125
126 # ID variables
127 histGroup.defineHistogram(chain+'_trkPt;L2muComb_trkPt',
128 title='L2muComb Trk Pt (GeV/c) '+chain+';p_{T} [GeV];Events',
129 type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
130
131 histGroup.defineHistogram(chain+'_trkEta;L2muComb_trkEta',
132 title='L2muComb Trk Eta '+chain+';#eta;Events',
133 type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
134
135 histGroup.defineHistogram(chain+'_trkPhi;L2muComb_trkPhi',
136 title='L2muComb Trk Phi '+chain+';#phi;Events',
137 type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
138
139 histGroup.defineHistogram(chain+'_trkZ0;L2muComb_trkZ0',
140 title='L2muComb Trk z0 (mm) '+chain+';z0[mm];Events',
141 type='TH1F', path='',xbins=150,xmin=-300.,xmax=300.)
142
143 histGroup.defineHistogram(chain+'_trkChi2;L2muComb_trkChi2',
144 title='L2muComb Trk chi2 '+chain+';#chi^{2};Events',
145 type='TH1F', path='',xbins=50,xmin=0.,xmax=10.)
146
147
148 # comparison L2muComb (ID track) vs L2MuonSA
149 histGroup.defineHistogram(chain+'_ptratio_TrktoSA;L2muComb_ptratio_TrktoSA',
150 title='L2muComb Trk pt / L2MuonSA pt '+chain+';p_{T} ratio;Events',
151 type='TH1F', path='',xbins=140,xmin=-0.5,xmax=3.)
152
153 histGroup.defineHistogram(chain+'_dR_TrktoSA;L2muComb_dR_TrktoSA',
154 title='L2muComb delta R Trk to L2MuonSA '+chain+';#DeltaR;Events',
155 type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
156
157 histGroup.defineHistogram(chain+'_dEta_TrktoSA;L2muComb_dEta_TrktoSA',
158 title='L2muComb delta eta Trk to L2MuonSA '+chain+';#Delta#eta;Events',
159 type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
160
161 histGroup.defineHistogram(chain+'_dPhi_TrktoSA;L2muComb_dPhi_TrktoSA',
162 title='L2muComb delta phi Trk to L2MuonSA '+chain+';#Delta#phi;Events',
163 type='TH1F', path='',xbins=120,xmin=-0.2,xmax=0.2)
164
165
166 # Comparison to Offline
167 histGroup.defineHistogram(chain+'_dRmin;L2muComb_dR_toOffl',
168 title='dR between L2muComb and Offline '+chain+';#DeltaR;Events',
169 type='TH1F', path='',xbins=100,xmin=0.,xmax=2.)
170
171 histGroup.defineHistogram(chain+'_ptresol;L2muComb_ptresol_toOffl',
172 title='L2muComb pT resolution wrt Offline '+chain+';p_{T} resol;Events',
173 type='TH1F', path='',xbins=100,xmin=-2.,xmax=2.)
174
175 histGroup.defineHistogram(chain+'_offEta,'+chain+'_ptresol;L2muComb_ptresol_toOffl_eta',
176 title='L2muComb pT resolution wrt Offline in eta '+chain+';#eta;p_{T} resol',
177 type='TH2F', path='',xbins=16,xmin=-3.2,xmax=3.2, ybins=100,ymin=-2.,ymax=2.)
178
179
180 # Comparison HLT_Roi_L2SAMuon variables to Offline
181 histGroup.defineHistogram(chain+'_L2SARoI_dR;L2MuonSA_L2SARoI_dR_toRecMuonCB',
182 title='L2MuonSA L2SARoI dR wrt offline CB '+chain+';dR(L2SARoI vs offl CB);Events',
183 type='TH1F', path='',xbins=100,xmin=0.,xmax=0.5)
184
185 histGroup.defineHistogram(chain+'_offEta,'+chain+'_L2SARoI_dEta;L2MuonSA_L2SARoI_dEta_vs_Eta_toRecMuonCB',
186 title='L2MuonSA L2SARoI wrt Offline CB muon, d#eta '+chain+';offl CB #eta;d#eta(L2SARoI vs offl CB)',
187 type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=60,ymin=-0.3,ymax=0.3)
188
189 histGroup.defineHistogram(chain+'_offEta,'+chain+'_L2SARoI_dPhi;L2MuonSA_L2SARoI_dPhi_vs_Eta_toRecMuonCB',
190 title='L2MuonSA L2SARoI wrt Offline CB muon, d#phi '+chain+';offl CB #eta;d#phi(L2SARoI vs offl CB)',
191 type='TH2F', path='',xbins=54,xmin=-2.7,xmax=2.7, ybins=44,ymin=-0.2,ymax=0.2)
192
193 return