ATLAS Offline Software
L2OverlapRemoverMonConfig.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 
6 
7  from AthenaConfiguration.ComponentFactory import CompFactory
8 
9  GroupName = 'OR'
10 
11  from MuonSelectorTools.MuonSelectorToolsConfig import MuonSelectionToolCfg
12  from .MuonMatchingToolConfig import MuonMatchingToolConfig
13  monAlg = helper.addAlgorithm(CompFactory.L2OverlapRemoverMon,'L2OverlapRemoverMon',
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 '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_2mu14_L12MU8F']
27 
28  monAlg.Group = GroupName
29 
30 
31  # configration for specific chain
32  for chain in monAlg.MonitoredChains:
33 
34  histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/L2OverlapRemover/'+chain)
35  defineOverlapRemoverHistograms(histGroup, GroupName, chain, 'L2SA')
36  defineOverlapRemoverHistograms(histGroup, GroupName, chain, 'L2CB')
37 
38  return
39 
40 
41 def defineOverlapRemoverHistograms(histGroup, GroupName, chain, trigstep):
42 
43  histGroup.defineHistogram(trigstep+'_'+chain+'_NInMuon;'+trigstep+GroupName+'_NInMuon',
44  title=trigstep+' OverlapRemover number of input muons '+chain+';number of input muons;Events',
45  type='TH1I', path='',xbins=10,xmin=0,xmax=10)
46 
47  histGroup.defineHistogram(trigstep+'_'+chain+'_NOutMuon;'+trigstep+GroupName+'_NOutMuon',
48  title=trigstep+' OverlapRemover number of output muons '+chain+';number of output muons;Events',
49  type='TH1I', path='',xbins=10,xmin=0,xmax=10)
50 
51  histGroup.defineHistogram(trigstep+'_'+chain+'_NRemovedMuon;'+trigstep+GroupName+'_NRemovedMuon',
52  title=trigstep+' OverlapRemover number of removed muons '+chain+';number of removed muons;Events',
53  type='TH1I', path='',xbins=10,xmin=0,xmax=10)
54 
55  histGroup.defineHistogram(trigstep+'_'+chain+'_dR;'+trigstep+GroupName+'_dR',
56  title=trigstep+' OverlapRemover dR '+chain+';dR;Events',
57  type='TH1F', path='',xbins=105,xmin=0.,xmax=3.5)
58 
59  histGroup.defineHistogram(trigstep+'_'+chain+'_invMass;'+trigstep+GroupName+'_invMass',
60  title=trigstep+' OverlapRemover invariant mass '+chain+';invariant mass [GeV];Events',
61  type='TH1F', path='',xbins=200,xmin=0.,xmax=100.)
62 
63  histGroup.defineHistogram(trigstep+'_'+chain+'_invMass,'+trigstep+'_'+chain+'_dR;'+trigstep+GroupName+'_invMass_vs_dR',
64  title=trigstep+' OverlapRemover invariant mass vs dR '+chain+';invariant mass [GeV];dR',
65  type='TH2F', path='',xbins=200,xmin=0.,xmax=100.,ybins=105,ymin=0.,ymax=3.5)
66 
67  histGroup.defineHistogram(trigstep+'_'+chain+'_dRLog10;'+trigstep+GroupName+'_dRLog10',
68  title=trigstep+' OverlapRemover dR (Log10) '+chain+';dR (Log10);Events',
69  type='TH1F', path='',xbins=100,xmin=-4.,xmax=1.)
70 
71  histGroup.defineHistogram(trigstep+'_'+chain+'_invMassLog10;'+trigstep+GroupName+'_invMassLog10',
72  title=trigstep+' OverlapRemover invariant mass (Log10) '+chain+';invariant mass (Log10) [GeV];Events',
73  type='TH1F', path='',xbins=140,xmin=-4.,xmax=3.)
74 
75  histGroup.defineHistogram(trigstep+'_'+chain+'_RemovedEta,'+trigstep+'_'+chain+'_RemovedPhi;'+trigstep+GroupName+'_RemovedEta_vs_RemovedPhi',
76  title=trigstep+' OverlapRemover Eta vs Phi of removed muons '+chain+';Eta;Phi',
77  type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7,ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
78 
79  histGroup.defineHistogram(trigstep+'_'+chain+'_RemovedPt;'+trigstep+GroupName+'_RemovedPt',
80  title=trigstep+' OverlapRemover Pt of removed muons '+chain+';p_{T} [GeV];Events',
81  type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
82 
83  histGroup.defineHistogram(trigstep+'_'+chain+'_OverlapInsonsistent;'+trigstep+GroupName+'_OverlapInsonsistent',
84  title=trigstep+' Overlap Insonsistent '+chain+';;Events',
85  type='TH1I', path='',xbins=2,xmin=0,xmax=2)
python.TriggerConfigAccess.getHLTMonitoringAccess
HLTMonitoringAccess getHLTMonitoringAccess(flags=None)
Definition: TriggerConfigAccess.py:256
python.L2OverlapRemoverMonConfig.L2OverlapRemoverMonConfig
def L2OverlapRemoverMonConfig(helper)
Definition: L2OverlapRemoverMonConfig.py:5
python.L2OverlapRemoverMonConfig.defineOverlapRemoverHistograms
def defineOverlapRemoverHistograms(histGroup, GroupName, chain, trigstep)
Definition: L2OverlapRemoverMonConfig.py:41
python.MuonSelectorToolsConfig.MuonSelectionToolCfg
def MuonSelectionToolCfg(flags, name="MuonSelectionTool", **kwargs)
Definition: MuonSelectorToolsConfig.py:13
python.MuonMatchingToolConfig.MuonMatchingToolConfig
def MuonMatchingToolConfig(flags)
Definition: MuonMatchingToolConfig.py:3