CMS 3D CMS Logo

nanoDQM_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import copy
3 
4 from PhysicsTools.NanoAOD.nanoDQM_cfi import nanoDQM
6 
7 ## Modify plots accordingly to era
8 _vplots80X = nanoDQM.vplots.clone()
9 # Tau plots
10 _tauPlots80X = cms.VPSet()
11 for plot in _vplots80X.Tau.plots:
12  if (plot.name.value().find("MVA")>-1 and plot.name.value().find("2017")>-1) or (plot.name.value().find("AntiEle")>-1 and plot.name.value().find("2018")>-1):
13  continue
14  _tauPlots80X.append(plot)
15 _tauPlots80X.append(Plot1D('idMVAnewDM', 'idMVAnewDM', 64, -0.5, 63.5, 'IsolationMVArun2v1DBnewDMwLT ID working point: bitmask 1 = VLoose, 2 = Loose, 4 = Medium, 8 = Tight, 16 = VTight, 32 = VVTight'))
16 _tauPlots80X.append(Plot1D('idMVAoldDMdR03', 'idMVAoldDMdR03', 64, -0.5, 63.5, 'IsolationMVArun2v1DBdR03oldDMwLT ID working point: bitmask 1 = VLoose, 2 = Loose, 4 = Medium, 8 = Tight, 16 = VTight, 32 = VVTight'))
17 _tauPlots80X.append(Plot1D('rawMVAnewDM', 'rawMVAnewDM', 20, -1, 1, 'byIsolationMVArun2v1DBnewDMwLT raw output discriminator'))
18 _tauPlots80X.append(Plot1D('rawMVAoldDMdR03', 'rawMVAoldDMdR03', 20, -1, 1, 'byIsolationMVArun2v1DBdR03oldDMwLT raw output discriminator'))
19 _vplots80X.Tau.plots = _tauPlots80X
20 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
21 run2_miniAOD_80XLegacy.toModify(nanoDQM,
22  vplots = _vplots80X
23 )
24 
25 _METFixEE2017_DQMentry = nanoDQM.vplots.MET.clone()
26 _METFixEE2017_plots = cms.VPSet()
27 for plot in _METFixEE2017_DQMentry.plots:
28  if plot.name.value().find("fiducial")>-1: continue
29  _METFixEE2017_plots.append(plot)
30 _METFixEE2017_DQMentry.plots = _METFixEE2017_plots
31 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv1_cff import run2_nanoAOD_94XMiniAODv1
32 from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2
33 for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
34  modifier.toModify(nanoDQM.vplots, METFixEE2017 = _METFixEE2017_DQMentry)
35 
36 _Electron_plots_2016 = copy.deepcopy(nanoDQM.vplots.Electron.plots)
37 _Electron_plots_2016.append(Plot1D('cutBased_HLTPreSel', 'cutBased_HLTPreSel', 2, -0.5, 1.5, 'cut-based HLT pre-selection ID'))
38 _Electron_plots_2016.append(Plot1D('cutBased_Spring15', 'cutBased_Spring15', 5, -0.5, 4.5, 'cut-based Spring15 ID (0:fail, 1:veto, 2:loose, 3:medium, 4:tight)'))
39 _Electron_plots_2016.append(Plot1D('mvaSpring16GP', 'mvaSpring16GP', 20, -1, 1, 'MVA Spring16 general-purpose ID score'))
40 _Electron_plots_2016.append(Plot1D('mvaSpring16GP_WP80', 'mvaSpring16GP_WP80', 2, -0.5, 1.5, 'MVA Spring16 general-purpose ID WP80'))
41 _Electron_plots_2016.append(Plot1D('mvaSpring16GP_WP90', 'mvaSpring16GP_WP90', 2, -0.5, 1.5, 'MVA Spring16 general-purpose ID WP90'))
42 _Electron_plots_2016.append(Plot1D('mvaSpring16HZZ', 'mvaSpring16HZZ', 20, -1, 1, 'MVA Spring16 HZZ ID score'))
43 _Electron_plots_2016.append(Plot1D('mvaSpring16HZZ_WPL', 'mvaSpring16HZZ_WPL', 2, -0.5, 1.5, 'MVA Spring16 HZZ ID loose WP'))
44 _Electron_plots_2016.append(NoPlot('vidNestedWPBitmapSpring15'))
45 
46 _Photon_plots_2016 = copy.deepcopy(nanoDQM.vplots.Photon.plots)
47 _Photon_plots_2016.append(Plot1D('cutBased', 'cutBased', 4, -0.5, 3.5, 'cut-based Spring16-V2p2 ID (0:fail, 1::loose, 2:medium, 3:tight)'))
48 _Photon_plots_2016.append(Plot1D('cutBased17Bitmap', 'cutBased17Bitmap', 8, -0.5, 7.5, 'cut-based Fall17-94X-V1 ID bitmap, 2^(0:loose, 1:medium, 2:tight)'))
49 _Photon_plots_2016.append(Plot1D('mvaID17', 'mvaID17', 20, -1, 1, 'MVA Fall17v1p1 ID score'))
50 _Photon_plots_2016.append(Plot1D('mvaID17_WP80', 'mvaID17_WP80', 2, -0.5, 1.5, 'MVA Fall17v1p1 ID WP80'))
51 _Photon_plots_2016.append(Plot1D('mvaID17_WP90', 'mvaID17_WP90', 2, -0.5, 1.5, 'MVA Fall17v1p1 ID WP90'))
52 
53 _FatJet_plots_80x = copy.deepcopy(nanoDQM.vplots.FatJet.plots)
54 _FatJet_plots_80x.append(Plot1D('msoftdrop_chs', 'msoftdrop_chs', 20, -300, 300, 'Legacy uncorrected soft drop mass with CHS'))
55 
56 _Flag_plots_80x = copy.deepcopy(nanoDQM.vplots.Flag.plots)
57 _Flag_plots_80x.append(Plot1D('BadGlobalMuon', 'BadGlobalMuon', 2, -0.5, 1.5, 'Bad muon flag'))
58 _Flag_plots_80x.append(Plot1D('CloneGlobalMuon', 'CloneGlobalMuon', 2, -0.5, 1.5, 'Clone muon flag'))
59 
60 from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016
61 for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
62  modifier.toModify(nanoDQM.vplots.Electron, plots = _Electron_plots_2016)
63  modifier.toModify(nanoDQM.vplots.Photon, plots = _Photon_plots_2016)
64 run2_miniAOD_80XLegacy.toModify(nanoDQM.vplots.FatJet, plots = _FatJet_plots_80x)
65 run2_miniAOD_80XLegacy.toModify(nanoDQM.vplots.Flag, plots = _Flag_plots_80x)
66 
67 run2_miniAOD_80XLegacy.toModify(nanoDQM.vplots, IsoTrack = None)
68 
69 ## MC
70 nanoDQMMC = nanoDQM.clone()
71 nanoDQMMC.vplots.Electron.sels.Prompt = cms.string("genPartFlav == 1")
72 nanoDQMMC.vplots.Muon.sels.Prompt = cms.string("genPartFlav == 1")
73 nanoDQMMC.vplots.Photon.sels.Prompt = cms.string("genPartFlav == 1")
74 nanoDQMMC.vplots.Tau.sels.Prompt = cms.string("genPartFlav == 5")
75 nanoDQMMC.vplots.Jet.sels.Prompt = cms.string("genJetIdx != 1")
76 nanoDQMMC.vplots.Jet.sels.PromptB = cms.string("genJetIdx != 1 && hadronFlavour == 5")
77 
78 nanoDQMQTester = cms.EDAnalyzer("QualityTester",
79  qtList = cms.untracked.FileInPath('PhysicsTools/NanoAOD/test/dqmQualityTests.xml'),
80  prescaleFactor = cms.untracked.int32(1),
81  testInEventloop = cms.untracked.bool(False),
82  qtestOnEndLumi = cms.untracked.bool(False),
83  verboseQT = cms.untracked.bool(True)
84 )
85 
86 nanoHarvest = cms.Sequence( nanoDQMQTester )
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20