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