CMS 3D CMS Logo

L1TEGammaEfficiency_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from DQMOffline.L1Trigger import L1TEGammaOffline_cfi
3 
4 variables = {
5  'electron': L1TEGammaOffline_cfi.electronEfficiencyThresholds,
6  'photon': L1TEGammaOffline_cfi.photonEfficiencyThresholds,
7 }
8 
9 deepInspectionThresholds = {
10  'electron': L1TEGammaOffline_cfi.deepInspectionElectronThresholds,
11  'photon': [],
12 }
13 
14 plots = {
15  'electron': [
16  "efficiencyElectronET_EB", "efficiencyElectronET_EE",
17  "efficiencyElectronET_EB_EE", "efficiencyElectronPhi_vs_Eta",
18  ],
19  'photon': [
20  "efficiencyPhotonET_EB", "efficiencyPhotonET_EE",
21  "efficiencyPhotonET_EB_EE"
22  ]
23 }
24 
25 deepInspectionPlots = {
26  'electron': [
27  'efficiencyElectronEta', 'efficiencyElectronPhi',
28  'efficiencyElectronNVertex'
29  ],
30  'photon': [],
31 }
32 
33 allEfficiencyPlots = []
34 add_plot = allEfficiencyPlots.append
35 for variable, thresholds in variables.iteritems():
36  for plot in plots[variable]:
37  for threshold in thresholds:
38  plotName = '{0}_threshold_{1}'.format(plot, threshold)
39  add_plot(plotName)
40 
41 for variable, thresholds in deepInspectionThresholds.iteritems():
42  for plot in deepInspectionPlots[variable]:
43  for threshold in thresholds:
44  plotName = '{0}_threshold_{1}'.format(plot, threshold)
45  add_plot(plotName)
46 
47 from DQMOffline.L1Trigger.L1TEfficiencyHarvesting_cfi import l1tEfficiencyHarvesting
48 l1tEGammaEfficiency = l1tEfficiencyHarvesting.clone(
49  plotCfgs=cms.untracked.VPSet(
50  cms.untracked.PSet(
51  numeratorDir=cms.untracked.string("L1T/L1TEGamma/efficiency_raw"),
52  outputDir=cms.untracked.string("L1T/L1TEGamma"),
53  numeratorSuffix=cms.untracked.string("_Num"),
54  denominatorSuffix=cms.untracked.string("_Den"),
55  plots=cms.untracked.vstring(allEfficiencyPlots)
56  ),
57  )
58 )
59 
60 l1tEGammaEmuEfficiency = l1tEfficiencyHarvesting.clone(
61  plotCfgs=cms.untracked.VPSet(
62  cms.untracked.PSet(
63  numeratorDir=cms.untracked.string(
64  "L1TEMU/L1TEGamma/efficiency_raw"),
65  outputDir=cms.untracked.string("L1TEMU/L1TEGamma"),
66  numeratorSuffix=cms.untracked.string("_Num"),
67  denominatorSuffix=cms.untracked.string("_Den"),
68  plots=cms.untracked.vstring(allEfficiencyPlots)
69  ),
70  )
71 )
72 
73 # modifications for the pp reference run
74 variables_HI = {
75  'electron': L1TEGammaOffline_cfi.electronEfficiencyThresholds_HI,
76  'photon': L1TEGammaOffline_cfi.photonEfficiencyThresholds_HI,
77 }
78 
79 deepInspectionThresholds_HI = {
80  'electron': L1TEGammaOffline_cfi.deepInspectionElectronThresholds_HI,
81  'photon': [],
82 }
83 
84 allEfficiencyPlots_HI = []
85 add_plot = allEfficiencyPlots_HI.append
86 for variable, thresholds in variables_HI.iteritems():
87  for plot in plots[variable]:
88  for threshold in thresholds:
89  plotName = '{0}_threshold_{1}'.format(plot, threshold)
90  add_plot(plotName)
91 
92 for variable, thresholds in deepInspectionThresholds_HI.iteritems():
93  for plot in deepInspectionPlots[variable]:
94  for threshold in thresholds:
95  plotName = '{0}_threshold_{1}'.format(plot, threshold)
96  add_plot(plotName)
97 
98 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017
99 ppRef_2017.toModify(l1tEGammaEfficiency,
100  plotCfgs = {
101  0:dict(plots = allEfficiencyPlots_HI),
102  }
103 )
104 ppRef_2017.toModify(l1tEGammaEmuEfficiency,
105  plotCfgs = {
106  0:dict(plots = allEfficiencyPlots_HI),
107  }
108 )