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