CMS 3D CMS Logo

HLTEGTnPMonitor_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 #this is the config to define t&p based DQM offline monitoring for e/gamma
4 
5 etBinsStd=cms.vdouble(5,10,12.5,15,17.5,20,22.5,25,30,35,40,45,50,60,80,100,150,200,250,300,350,400)
6 scEtaBinsStd = cms.vdouble(-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,-1.8,-1.7,-1.566,-1.4442,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4442,1.566,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5)
7 phiBinsStd = cms.vdouble(-3.32,-2.97,-2.62,-2.27,-1.92,-1.57,-1.22,-0.87,-0.52,-0.18,0.18,0.52,0.87,1.22,1.57,1.92,2.27,2.62,2.97,3.32)
8 
9 etRangeCut= cms.PSet(
10  rangeVar=cms.string("et"),
11  allowedRanges=cms.vstring("0:10000"),
12  )
13 ecalBarrelEtaCut=cms.PSet(
14  rangeVar=cms.string("scEta"),
15  allowedRanges=cms.vstring("-1.4442:1.4442")
16  )
17 ecalEndcapEtaCut=cms.PSet(
18  rangeVar=cms.string("scEta"),
19  allowedRanges=cms.vstring("-2.5:-1.556","1.556:2.5")
20  )
21 ecalBarrelAndEndcapEtaCut = cms.PSet(
22  rangeVar=cms.string("scEta"),
23  allowedRanges=cms.vstring("-1.4442:1.4442","-2.5:-1.556","1.556:2.5"),
24  )
25 hcalPosEtaCut= cms.PSet(
26  rangeVar=cms.string("scEta"),
27  allowedRanges=cms.vstring("1.3:1.4442","1.556:2.5"),
28  )
29 hcalNegEtaCut= cms.PSet(
30  rangeVar=cms.string("scEta"),
31  allowedRanges=cms.vstring("-2.5:-1.556","-1.4442:-1.3"),
32  )
33 hcalPhi17Cut = cms.PSet(
34  rangeVar=cms.string("phi"),
35  allowedRanges=cms.vstring("-0.87:-0.52"),
36  )
37 
38 
39 tagAndProbeConfigEle27WPTight = cms.PSet(
40  trigEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"),
41  objColl = cms.InputTag("gedGsfElectrons"),
42  tagVIDCuts = cms.InputTag("egmGsfElectronIDsForDQM:cutBasedElectronID-Summer16-80X-V1-tight"),
43  probeVIDCuts = cms.InputTag("egmGsfElectronIDsForDQM:cutBasedElectronID-Summer16-80X-V1-tight"),
44  sampleTrigRequirements = cms.PSet(
45  hltInputTag = cms.InputTag("TriggerResults","","HLT"),
46  hltPaths = cms.vstring("HLT_Ele27_WPTight_Gsf_v*","HLT_Ele32_WPTight_Gsf_v*","HLT_Ele35_WPTight_Gsf_v*"
47  "HLT_Ele38_WPTight_Gsf_v*",
48  "HLT_Ele27_WPTight_Gsf_L1DoubleEG_v*","HLT_Ele32_WPTight_Gsf_L1DoubleEG_v*",
49  )
50  ),
51  #it is intended that these are the filters of the triggers listed for sampleTrigRequirements
52  tagFilters = cms.vstring("hltEle27WPTightGsfTrackIsoFilter",
53  "hltEle32noerWPTightGsfTrackIsoFilter"
54  "hltEle35noerWPTightGsfTrackIsoFilter"
55  "hltEle38noerWPTightGsfTrackIsoFilter"
56  "hltEle27L1DoubleEGWPTightGsfTrackIsoFilter",
57  "hltEle32L1DoubleEGWPTightGsfTrackIsoFilter" ),
58  tagFiltersORed = cms.bool(True),
59  tagRangeCuts = cms.VPSet(ecalBarrelEtaCut),
60  probeFilters = cms.vstring(),
61  probeFiltersORed = cms.bool(False),
62  probeRangeCuts = cms.VPSet(ecalBarrelAndEndcapEtaCut),
63  minMass = cms.double(70.0),
64  maxMass = cms.double(110.0),
65  requireOpSign = cms.bool(False),
66 
67 
68  )
69 
70 
71 tagAndProbeConfigEle27WPTightHEP17 = tagAndProbeConfigEle27WPTight.clone(
72  probeRangeCuts = cms.VPSet(
73  hcalPosEtaCut,
74  hcalPhi17Cut,
75 ))
76 tagAndProbeConfigEle27WPTightHEM17 = tagAndProbeConfigEle27WPTight.clone(
77  probeRangeCuts = cms.VPSet(
78  hcalNegEtaCut,
79  hcalPhi17Cut,
80 ))
81 
82 
83 egammaStdHistConfigs = cms.VPSet(
84  cms.PSet(
85  histType=cms.string("1D"),
86  vsVar=cms.string("et"),
87  nameSuffex=cms.string("_EBvsEt"),
88  rangeCuts=cms.VPSet(ecalBarrelEtaCut),
89  binLowEdges=etBinsStd,
90  ),
91  cms.PSet(
92  histType=cms.string("1D"),
93  vsVar=cms.string("et"),
94  nameSuffex=cms.string("_EEvsEt"),
95  rangeCuts=cms.VPSet(ecalEndcapEtaCut),
96  binLowEdges=etBinsStd,
97  ),
98  cms.PSet(
99  histType=cms.string("1D"),
100  vsVar=cms.string("scEta"),
101  nameSuffex=cms.string("_vsSCEta"),
102  rangeCuts=cms.VPSet(),
103  binLowEdges=scEtaBinsStd,
104  ),
105  cms.PSet(
106  histType=cms.string("1D"),
107  vsVar=cms.string("phi"),
108  nameSuffex=cms.string("_EBvsPhi"),
109  rangeCuts=cms.VPSet(ecalBarrelEtaCut),
110  binLowEdges=phiBinsStd,
111  ),
112  cms.PSet(
113  histType=cms.string("1D"),
114  vsVar=cms.string("phi"),
115  nameSuffex=cms.string("_EEvsPhi"),
116  rangeCuts=cms.VPSet(ecalEndcapEtaCut),
117  binLowEdges=phiBinsStd,
118  ),
119  cms.PSet(
120  histType=cms.string("2D"),
121  xVar=cms.string("scEta"),
122  yVar=cms.string("phi"),
123  nameSuffex=cms.string("_vsSCEtaPhi"),
124  rangeCuts=cms.VPSet(),
125  xBinLowEdges=scEtaBinsStd,
126  yBinLowEdges=phiBinsStd,
127  ),
128 
129  )
130 
131 egammaStdFiltersToMonitor= cms.VPSet(
132  cms.PSet(
133  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DoubleEle33_CaloIdL_MW"),
134  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("40:99999")),),
135  filterName = cms.string("hltEle33CaloIdLMWPMS2Filter"),
136  histTitle = cms.string(""),
137  tagExtraFilter = cms.string(""),
138  ),
139  cms.PSet(
140  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DoubleEle33_CaloIdL_MW"),
141  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("40:99999")),),
142  filterName = cms.string("hltDiEle33CaloIdLMWPMS2UnseededFilter"),
143  histTitle = cms.string(""),
144  tagExtraFilter = cms.string("hltEle33CaloIdLMWPMS2Filter"),
145  ),
146  cms.PSet(
147  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon300_NoHE"),
148  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("320:99999")),),
149  filterName = cms.string("hltEG300erFilter"),
150  histTitle = cms.string(""),
151  tagExtraFilter = cms.string(""),
152  ),
153  cms.PSet(
154  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DoublePhoton70"),
155  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("80:99999")),),
156  filterName = cms.string("hltEG70HEFilter"),
157  histTitle = cms.string(""),
158  tagExtraFilter = cms.string(""),
159  ),
160  cms.PSet(
161  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DoublePhoton70"),
162  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("80:99999")),),
163  filterName = cms.string("hltDiEG70HEUnseededFilter"),
164  histTitle = cms.string(""),
165  tagExtraFilter = cms.string("hltEG70HEFilter"),
166  ),
167  cms.PSet(
168  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DoublePhoton85"),
169  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("90:99999")),),
170  filterName = cms.string("hltEG85HEFilter"),
171  histTitle = cms.string(""),
172  tagExtraFilter = cms.string(""),
173  ),
174  cms.PSet(
175  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DoublePhoton85"),
176  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("80:99999")),),
177  filterName = cms.string("hltDiEG85HEUnseededFilter"),
178  histTitle = cms.string(""),
179  tagExtraFilter = cms.string("hltEG85HEFilter"),
180  ),
181 
182  cms.PSet(
183  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DiSC30_18_EIso_AND_HE_Mass70"),
184  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("35:99999")),),
185  filterName = cms.string("hltEG30EIso15HE30EcalIsoLastFilter"),
186  histTitle = cms.string(""),
187  tagExtraFilter = cms.string(""),
188  ),
189  cms.PSet(
190  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_DiSC30_18_EIso_AND_HE_Mass70"),
191  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("35:99999")),),
192  filterName = cms.string("hltEG18EIso15HE30EcalIsoUnseededFilter"),
193  histTitle = cms.string(""),
194  tagExtraFilter = cms.string("hltEG30EIso15HE30EcalIsoLastFilter"),
195  ),
196  cms.PSet(
197  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL"),
198  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("26:99999")),),
199  filterName = cms.string("hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter"),
200  histTitle = cms.string(""),
201  tagExtraFilter = cms.string(""),
202  ),
203  cms.PSet(
204  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL"),
205  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("15:99999")),),
206  filterName = cms.string("hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter"),
207  histTitle = cms.string(""),
208  tagExtraFilter = cms.string(""),
209  ),
210  cms.PSet(
211  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele27_WPTight_Gsf"),
212  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("30:99999")),),
213  filterName = cms.string("hltEle27WPTightGsfTrackIsoFilter"),
214  histTitle = cms.string(""),
215  tagExtraFilter = cms.string(""),
216  ),
217  cms.PSet(
218  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele32_WPTight_Gsf"),
219  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("35:99999")),),
220  filterName = cms.string("hltEle32noerWPTightGsfTrackIsoFilter"),
221  histTitle = cms.string(""),
222  tagExtraFilter = cms.string(""),
223  ),
224  cms.PSet(
225  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele35_WPTight_Gsf"),
226  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("42:99999")),),
227  filterName = cms.string("hltEle35noerWPTightGsfTrackIsoFilter"),
228  histTitle = cms.string(""),
229  tagExtraFilter = cms.string(""),
230  ),
231  cms.PSet(
232  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele38_WPTight_Gsf"),
233  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("42:99999")),),
234  filterName = cms.string("hltEle38noerWPTightGsfTrackIsoFilter"),
235  histTitle = cms.string(""),
236  tagExtraFilter = cms.string(""),
237  ),
238  cms.PSet(
239  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele27_WPTight_Gsf_L1DoubleEG"),
240  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("30:99999")),),
241  filterName = cms.string("hltEle27L1DoubleEGWPTightGsfTrackIsoFilter"),
242  histTitle = cms.string(""),
243  tagExtraFilter = cms.string(""),
244  ),
245  cms.PSet(
246  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Ele32_WPTight_Gsf_L1DoubleEG"),
247  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("35:99999")),),
248  filterName = cms.string("hltEle32L1DoubleEGWPTightGsfTrackIsoFilter"),
249  histTitle = cms.string(""),
250  tagExtraFilter = cms.string(""),
251  ),
252  cms.PSet(
253  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon33"),
254  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("35:99999")),),
255  filterName = cms.string("hltEG33L1EG26HEFilter"),
256  histTitle = cms.string(""),
257  tagExtraFilter = cms.string(""),
258  ),
259  cms.PSet(
260  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon50"),
261  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("55:99999")),),
262  filterName = cms.string("hltEG50HEFilter"),
263  histTitle = cms.string(""),
264  tagExtraFilter = cms.string(""),
265  ),
266  cms.PSet(
267  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon75"),
268  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("80:99999")),),
269  filterName = cms.string("hltEG75HEFilter"),
270  histTitle = cms.string(""),
271  tagExtraFilter = cms.string(""),
272  ),
273  cms.PSet(
274  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon90"),
275  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("95:99999")),),
276  filterName = cms.string("hltEG90HEFilter"),
277  histTitle = cms.string(""),
278  tagExtraFilter = cms.string(""),
279  ),
280  cms.PSet(
281  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon120"),
282  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("95:99999")),),
283  filterName = cms.string("hltEG120HEFilter"),
284  histTitle = cms.string(""),
285  tagExtraFilter = cms.string(""),
286  ),
287  cms.PSet(
288  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon150"),
289  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("160:99999")),),
290  filterName = cms.string("hltEG150HEFilter"),
291  histTitle = cms.string(""),
292  tagExtraFilter = cms.string(""),
293  ),
294  cms.PSet(
295  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon175"),
296  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("180:99999")),),
297  filterName = cms.string("hltEG175HEFilter"),
298  histTitle = cms.string(""),
299  tagExtraFilter = cms.string(""),
300  ),
301  cms.PSet(
302  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_Photon200"),
303  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("220:99999")),),
304  filterName = cms.string("hltEG200HEFilter"),
305  histTitle = cms.string(""),
306  tagExtraFilter = cms.string(""),
307  ),
308  cms.PSet(
309  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_CaloJet500"),
310  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("500:99999")),),
311  filterName = cms.string("hltSingleCaloJet500"),
312  histTitle = cms.string(""),
313  tagExtraFilter = cms.string(""),
314  ),
315  cms.PSet(
316  folderName = cms.string("HLT/EGTagAndProbeEffs/HLT_CaloJet550"),
317  rangeCuts = cms.VPSet(etRangeCut.clone(allowedRanges=cms.vstring("550:99999")),),
318  filterName = cms.string("hltSingleCaloJet550"),
319  histTitle = cms.string(""),
320  tagExtraFilter = cms.string(""),
321  ),
322 
323  )
324 
325 
326 
327 egHLTDQMOfflineTnPSource = cms.EDAnalyzer("HLTEleTagAndProbeOfflineSource",
328  tagAndProbeCollections = cms.VPSet(
329  cms.PSet(
330  tagAndProbeConfigEle27WPTight,
331  histConfigs = egammaStdHistConfigs,
332  baseHistName = cms.string("eleWPTightTag_"),
333  filterConfigs = egammaStdFiltersToMonitor,
334  ),
335  cms.PSet(
336  tagAndProbeConfigEle27WPTightHEM17,
337  histConfigs = egammaStdHistConfigs,
338  baseHistName = cms.string("eleWPTightTag-HEM17_"),
339  filterConfigs = egammaStdFiltersToMonitor,
340  ),
341  cms.PSet(
342  tagAndProbeConfigEle27WPTightHEP17,
343  histConfigs = egammaStdHistConfigs,
344  baseHistName = cms.string("eleWPTightTag-HEP17_"),
345  filterConfigs = egammaStdFiltersToMonitor,
346  ),
347 
348  )
349  )
350 
351 from RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cff import egmGsfElectronIDs
352 
353 egmGsfElectronIDsForDQM = egmGsfElectronIDs.clone()
354 egmGsfElectronIDsForDQM.physicsObjectsIDs = cms.VPSet()
355 egmGsfElectronIDsForDQM.physicsObjectSrc == cms.InputTag('gedGsfElectrons')
356 #note: be careful here to when selecting new ids that the vid tools dont do extra setup for them
357 #for example the HEEP cuts need an extra producer which vid tools automatically handles
358 from PhysicsTools.SelectorUtils.tools.vid_id_tools import setupVIDSelection
359 my_id_modules = ['RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Summer16_80X_V1_cff']
360 for id_module_name in my_id_modules:
361  idmod= __import__(id_module_name, globals(), locals(), ['idName','cutFlow'])
362  for name in dir(idmod):
363  item = getattr(idmod,name)
364  if hasattr(item,'idName') and hasattr(item,'cutFlow'):
365  setupVIDSelection(egmGsfElectronIDsForDQM,item)
def setupVIDSelection(vidproducer, cutflow)
Definition: vid_id_tools.py:11
dbl *** dir
Definition: mlp_gen.cc:35