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