CMS 3D CMS Logo

L1TEGammaDiff_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from DQMOffline.L1Trigger import L1TEGammaOffline_cfi
3 import six
4 
5 variables = {
6  'electron': L1TEGammaOffline_cfi.electronEfficiencyThresholds,
7 }
8 
9 plots = {
10  'electron': [
11  "efficiencyElectronET_EB", "efficiencyElectronET_EE",
12  "efficiencyElectronET_EB_EE"
13  ],
14 }
15 
16 allEfficiencyPlots = []
17 add_plot = allEfficiencyPlots.append
18 for variable, thresholds in six.iteritems(variables):
19  for plot in plots[variable]:
20  for threshold in thresholds:
21  plotName = '{0}_threshold_{1}'.format(plot, threshold)
22  add_plot(plotName)
23 
24 resolution_plots = [
25  "resolutionElectronET_EB", "resolutionElectronET_EE",
26  "resolutionElectronET_EB_EE", "resolutionElectronPhi_EB", "resolutionElectronPhi_EE",
27  "resolutionElectronPhi_EB_EE", "resolutionElectronEta",
28  #
29  "resolutionPhotonET_EB", "resolutionPhotonET_EE",
30  "resolutionPhotonET_EB_EE", "resolutionPhotonPhi_EB", "resolutionPhotonPhi_EE",
31  "resolutionPhotonPhi_EB_EE", "resolutionPhotonEta",
32 ]
33 plots2D = [
34  'L1EGammaETvsElectronET_EB', 'L1EGammaETvsElectronET_EE', 'L1EGammaETvsElectronET_EB_EE',
35  'L1EGammaPhivsElectronPhi_EB', 'L1EGammaPhivsElectronPhi_EE', 'L1EGammaPhivsElectronPhi_EB_EE',
36  'L1EGammaEtavsElectronEta',
37  #
38  'L1EGammaETvsPhotonET_EB', 'L1EGammaETvsPhotonET_EE', 'L1EGammaETvsPhotonET_EB_EE',
39  'L1EGammaPhivsPhotonPhi_EB', 'L1EGammaPhivsPhotonPhi_EE', 'L1EGammaPhivsPhotonPhi_EB_EE',
40  'L1EGammaEtavsPhotonEta',
41 ]
42 
43 # remove photon variables (code to produce them is currently commented out)
44 resolution_plots = [plot for plot in resolution_plots if 'Photon' not in plot]
45 plots2D = [plot for plot in plots2D if 'Photon' not in plot]
46 
47 allPlots = []
48 allPlots.extend(allEfficiencyPlots)
49 allPlots.extend(resolution_plots)
50 allPlots.extend(plots2D)
51 
52 
53 from DQMOffline.L1Trigger.L1TDiffHarvesting_cfi import l1tDiffHarvesting
54 l1tEGammaEmuDiff = l1tDiffHarvesting.clone(
55  plotCfgs=cms.untracked.VPSet(
56  cms.untracked.PSet( # EMU comparison
57  dir1=cms.untracked.string("L1T/L1TObjects/L1TEGamma/L1TriggerVsReco"),
58  dir2=cms.untracked.string("L1TEMU/L1TObjects/L1TEGamma/L1TriggerVsReco"),
59  outputDir=cms.untracked.string(
60  "L1TEMU/L1TObjects/L1TEGamma/L1TriggerVsReco/Comparison"),
61  plots=cms.untracked.vstring(allPlots)
62  ),
63  )
64 )
65 
66 # modifications for the pp reference run
67 variables_HI = {
68  'electron': L1TEGammaOffline_cfi.electronEfficiencyThresholds_HI,
69 }
70 
71 allEfficiencyPlots_HI = []
72 add_plot = allEfficiencyPlots_HI.append
73 for variable, thresholds in six.iteritems(variables_HI):
74  for plot in plots[variable]:
75  for threshold in thresholds:
76  plotName = '{0}_threshold_{1}'.format(plot, threshold)
77  add_plot(plotName)
78 
79 allPlots_HI = []
80 allPlots_HI.extend(allEfficiencyPlots_HI)
81 allPlots_HI.extend(resolution_plots)
82 allPlots_HI.extend(plots2D)
83 
84 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017
85 ppRef_2017.toModify(l1tEGammaEmuDiff,
86  plotCfgs = {0:dict(plots = allPlots_HI)}
87 )
L1TEGammaDiff_cfi.add_plot
add_plot
Definition: L1TEGammaDiff_cfi.py:17
format