Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-01-19 02:53:14

0001 import FWCore.ParameterSet.Config as cms
0002 import copy
0003 
0004 from PhysicsTools.NanoAOD.nanoDQM_cfi import nanoDQM
0005 from PhysicsTools.NanoAOD.nanoDQM_tools_cff import *
0006 from PhysicsTools.NanoAOD.nano_eras_cff import *
0007 
0008 _boostedTauPlotsV10 = cms.VPSet()
0009 for plot in nanoDQM.vplots.boostedTau.plots:
0010     _boostedTauPlotsV10.append(plot)
0011 _boostedTauPlotsV10.extend([
0012     Plot1D('idMVAoldDMdR032017v2', 'idMVAoldDMdR032017v2', 11, -0.5, 10.5, 'IsolationMVArun2017v2DBoldDMdR0p3wLT ID working point (2017v2): int 1 = VVLoose, 2 = VLoose, 3 = Loose, 4 = Medium, 5 = Tight, 6 = VTight, 7 = VVTight'),
0013     Plot1D('rawMVAoldDMdR032017v2', 'rawMVAoldDMdR032017v2', 20, -1, 1, 'byIsolationMVArun2017v2DBoldDMdR0p3wLT raw output discriminator (2017v2)')
0014 ])
0015 
0016 (run2_nanoAOD_106Xv2).toModify(
0017     nanoDQM.vplots.boostedTau,
0018     plots = _boostedTauPlotsV10
0019 )
0020 
0021 _Electron_Run2_plots = cms.VPSet()
0022 for plot in nanoDQM.vplots.Electron.plots:
0023     if 'Fall17V2' not in plot.name.value():
0024         _Electron_Run2_plots.append(plot)
0025 _Electron_Run2_plots.extend([
0026     Plot1D('dEscaleUp', 'dEscaleUp', 100, -0.01, 0.01, '#Delta E scaleUp'),
0027     Plot1D('dEscaleDown', 'dEscaleDown', 100, -0.01, 0.01, '#Delta E scaleDown'),
0028     Plot1D('dEsigmaUp', 'dEsigmaUp', 100, -0.1, 0.1, '#Delta E sigmaUp'),
0029     Plot1D('dEsigmaDown', 'dEsigmaDown', 100, -0.1, 0.1, '#Delta E sigmaDown'),
0030     Plot1D('eCorr', 'eCorr', 20, 0.8, 1.2, 'ratio of the calibrated energy/miniaod energy'),
0031 ])
0032 run2_egamma.toModify(
0033      nanoDQM.vplots.Electron, 
0034      plots = _Electron_Run2_plots
0035 )
0036 
0037 _Photon_Run2_plots = cms.VPSet()
0038 def _match(name):
0039     if 'Fall17V2' in name: return True
0040     if '_quadratic' in name: return True
0041     if 'hoe_PUcorr' in name: return True
0042     return False
0043 for plot in nanoDQM.vplots.Photon.plots:
0044     if not _match(plot.name.value()):
0045         _Photon_Run2_plots.append(plot)
0046 _Photon_Run2_plots.extend([
0047     Plot1D('pfRelIso03_all', 'pfRelIso03_all', 20, 0, 2, 'PF relative isolation dR=0.3, total (with rho*EA PU Fall17V2 corrections)'),
0048     Plot1D('pfRelIso03_chg', 'pfRelIso03_chg', 20, 0, 2, 'PF relative isolation dR=0.3, charged component (with rho*EA PU Fall17V2 corrections)'),
0049     Plot1D('dEscaleUp', 'dEscaleUp', 100, -0.01, 0.01, '#Delta E scaleUp'),
0050     Plot1D('dEscaleDown', 'dEscaleDown', 100, -0.01, 0.01, '#Delta E scaleDown'),
0051     Plot1D('dEsigmaUp', 'dEsigmaUp', 100, -0.1, 0.1, '#Delta E sigmaUp'),
0052     Plot1D('dEsigmaDown', 'dEsigmaDown', 100, -0.1, 0.1, '#Delta E sigmaDown'),
0053     Plot1D('eCorr', 'eCorr', 20, 0.8, 1.2, 'ratio of the calibrated energy/miniaod energy'),
0054 ])
0055 run2_egamma.toModify(
0056      nanoDQM.vplots.Photon, 
0057      plots = _Photon_Run2_plots
0058 )
0059 
0060 _FatJet_Run2_plots = cms.VPSet()
0061 for plot in nanoDQM.vplots.FatJet.plots:
0062     _FatJet_Run2_plots.append(plot)
0063 _FatJet_Run2_plots.extend([
0064     Plot1D('btagCSVV2', 'btagCSVV2', 20, -1, 1, ' pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)'),
0065 ])
0066 
0067 _Jet_Run2_plots = cms.VPSet()
0068 for plot in nanoDQM.vplots.Jet.plots:
0069     _Jet_Run2_plots.append(plot)
0070 _Jet_Run2_plots.extend([
0071     Plot1D('btagCSVV2', 'btagCSVV2', 20, -1, 1, ' pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)'),
0072 ])
0073 
0074 _SubJet_Run2_plots = cms.VPSet()
0075 for plot in nanoDQM.vplots.SubJet.plots:
0076     _SubJet_Run2_plots.append(plot)
0077 _SubJet_Run2_plots.extend([
0078     Plot1D('btagCSVV2', 'btagCSVV2', 20, -1, 1, ' pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)'),
0079 ])
0080 
0081 run2_nanoAOD_ANY.toModify(
0082     nanoDQM.vplots.FatJet,
0083     plots = _FatJet_Run2_plots
0084 ).toModify(
0085     nanoDQM.vplots.Jet,
0086     plots = _Jet_Run2_plots
0087 ).toModify(
0088     nanoDQM.vplots.SubJet,
0089     plots = _SubJet_Run2_plots
0090 )
0091 
0092 ## MC
0093 nanoDQMMC = nanoDQM.clone()
0094 nanoDQMMC.vplots.Electron.sels.Prompt = cms.string("genPartFlav == 1")
0095 nanoDQMMC.vplots.LowPtElectron.sels.Prompt = cms.string("genPartFlav == 1")
0096 nanoDQMMC.vplots.Muon.sels.Prompt = cms.string("genPartFlav == 1")
0097 nanoDQMMC.vplots.Photon.sels.Prompt = cms.string("genPartFlav == 1")
0098 nanoDQMMC.vplots.Tau.sels.Prompt = cms.string("genPartFlav == 5")
0099 nanoDQMMC.vplots.Jet.sels.Prompt = cms.string("genJetIdx != 1")
0100 nanoDQMMC.vplots.Jet.sels.PromptB = cms.string("genJetIdx != 1 && hadronFlavour == 5")
0101 
0102 from DQMServices.Core.DQMQualityTester import DQMQualityTester
0103 nanoDQMQTester = DQMQualityTester(
0104     qtList = cms.untracked.FileInPath('PhysicsTools/NanoAOD/test/dqmQualityTests.xml'),
0105     prescaleFactor = cms.untracked.int32(1),
0106     testInEventloop = cms.untracked.bool(False),
0107     qtestOnEndLumi = cms.untracked.bool(False),
0108     verboseQT =  cms.untracked.bool(True)
0109 )
0110 
0111 nanoHarvest = cms.Sequence( nanoDQMQTester )