From 67c1fad1e30aa8a1da5c7b3cfabb84eafcc67303 Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Mon, 13 Jun 2022 10:03:25 +0200 Subject: [PATCH 1/8] Add HZZ electron ID + unique names for egamma IDs Adding mvaHZZ variable with HZZ electron ID training. Introducing generic names for egamma IDs mvaFall17V2Iso --> mvaIso mvaFall17V2noIso --> mvanoIso --- PhysicsTools/NanoAOD/python/electrons_cff.py | 70 ++++++++++++-------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index c136e1a88c05a..4e62a070d9bcf 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -46,6 +46,9 @@ 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V1_cff', 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V2_cff', 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V2_cff', + 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer16UL_ID_ISO_cff', + 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer17UL_ID_ISO_cff', + 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer18UL_ID_ISO_cff', ), WorkingPoints = cms.vstring( "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-veto", @@ -194,8 +197,9 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): userFloats = cms.PSet( mvaFall17V1Iso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Fall17IsoV1Values"), mvaFall17V1noIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Fall17NoIsoV1Values"), - mvaFall17V2Iso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Fall17IsoV2Values"), - mvaFall17V2noIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Fall17NoIsoV2Values"), + mvaIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Fall17IsoV2Values"), + mvaNoIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Fall17NoIsoV2Values"), + mvaHZZIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer18ULIdIsoValues"), miniIsoChg = cms.InputTag("isoForEle:miniIsoChg"), miniIsoAll = cms.InputTag("isoForEle:miniIsoAll"), PFIsoChg = cms.InputTag("isoForEle:PFIsoChg"), @@ -222,12 +226,12 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): mvaFall17V1noIso_WP80 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V1-wp80"), mvaFall17V1noIso_WPL = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V1-wpLoose"), - mvaFall17V2Iso_WP90 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-iso-V2-wp90"), - mvaFall17V2Iso_WP80 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-iso-V2-wp80"), - mvaFall17V2Iso_WPL = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-iso-V2-wpLoose"), - mvaFall17V2noIso_WP90 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V2-wp90"), - mvaFall17V2noIso_WP80 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V2-wp80"), - mvaFall17V2noIso_WPL = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V2-wpLoose"), + mvaIso_WP90 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-iso-V2-wp90"), + mvaIso_WP80 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-iso-V2-wp80"), + mvaIso_WPL = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-iso-V2-wpLoose"), + mvaNoIso_WP90 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V2-wp90"), + mvaNoIso_WP80 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V2-wp80"), + mvaNoIso_WPL = cms.InputTag("egmGsfElectronIDs:mvaEleID-Fall17-noIso-V2-wpLoose"), cutbasedID_Fall17_V1_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V1-veto"), cutbasedID_Fall17_V1_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V1-loose"), @@ -305,6 +309,15 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): VIDNestedWPBitmapSpring15 = cms.InputTag("bitmapVIDForEleSpring15"), VIDNestedWPBitmapSum16 = cms.InputTag("bitmapVIDForEleSum16"), ) +(~run2_nanoAOD_preUL & run2_egamma_2016).toModify(slimmedElectronsWithUserData.userFloats, + mvaHZZIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer16ULIdIsoValues"), +) +(~run2_nanoAOD_preUL & run2_egamma_2017).toModify(slimmedElectronsWithUserData.userFloats, + mvaHZZIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer17ULIdIsoValues") , +) +(~run2_nanoAOD_preUL & run2_egamma_2018).toModify(slimmedElectronsWithUserData.userFloats, + mvaHZZIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer18ULIdIsoValues"), +) #################################################END slimmedElectrons with user data##################### #################################################finalElectrons##################### finalElectrons = cms.EDFilter("PATElectronRefSelector", @@ -331,7 +344,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): LepGood_dxy = cms.string("log(abs(dB('PV2D')))"), LepGood_sip3d = cms.string("abs(dB('PV3D')/edB('PV3D'))"), LepGood_dz = cms.string("log(abs(dB('PVDZ')))"), - LepGood_mvaFall17V2noIso = cms.string("userFloat('mvaFall17V2noIso')"), + LepGood_mvaFall17V2noIso = cms.string("userFloat('mvaNoIso')"), ) ) run2_egamma_2016.toModify(electronMVATTH, @@ -362,14 +375,15 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): eInvMinusPInv = Var("(1-eSuperClusterOverP())/ecalEnergy()",float,doc="1/E_SC - 1/p_trk",precision=10), scEtOverPt = Var("(superCluster().energy()/(pt*cosh(superCluster().eta())))-1",float,doc="(supercluster transverse energy)/pt-1",precision=8), - mvaFall17V2Iso = Var("userFloat('mvaFall17V2Iso')",float,doc="MVA Iso ID V2 score"), - mvaFall17V2Iso_WP80 = Var("userInt('mvaFall17V2Iso_WP80')",bool,doc="MVA Iso ID V2 WP80"), - mvaFall17V2Iso_WP90 = Var("userInt('mvaFall17V2Iso_WP90')",bool,doc="MVA Iso ID V2 WP90"), - mvaFall17V2Iso_WPL = Var("userInt('mvaFall17V2Iso_WPL')",bool,doc="MVA Iso ID V2 loose WP"), - mvaFall17V2noIso = Var("userFloat('mvaFall17V2noIso')",float,doc="MVA noIso ID V2 score"), - mvaFall17V2noIso_WP80 = Var("userInt('mvaFall17V2noIso_WP80')",bool,doc="MVA noIso ID V2 WP80"), - mvaFall17V2noIso_WP90 = Var("userInt('mvaFall17V2noIso_WP90')",bool,doc="MVA noIso ID V2 WP90"), - mvaFall17V2noIso_WPL = Var("userInt('mvaFall17V2noIso_WPL')",bool,doc="MVA noIso ID V2 loose WP"), + mvaIso = Var("userFloat('mvaIso')",float,doc="MVA Iso ID V2 score"), + mvaIso_WP80 = Var("userInt('mvaIso_WP80')",bool,doc="MVA Iso ID V2 WP80"), + mvaIso_WP90 = Var("userInt('mvaIso_WP90')",bool,doc="MVA Iso ID V2 WP90"), + mvaIso_WPL = Var("userInt('mvaIso_WPL')",bool,doc="MVA Iso ID V2 loose WP"), + mvaNoIso = Var("userFloat('mvaNoIso')",float,doc="MVA noIso ID V2 score"), + mvaNoIso_WP80 = Var("userInt('mvaNoIso_WP80')",bool,doc="MVA noIso ID V2 WP80"), + mvaNoIso_WP90 = Var("userInt('mvaNoIso_WP90')",bool,doc="MVA noIso ID V2 WP90"), + mvaNoIso_WPL = Var("userInt('mvaNoIso_WPL')",bool,doc="MVA noIso ID V2 loose WP"), + mvaHZZIso = Var("userFloat('mvaHZZIso')", float,doc="HZZ MVA Iso ID score"), cutBased = Var("userInt('cutbasedID_Fall17_V2_veto')+userInt('cutbasedID_Fall17_V2_loose')+userInt('cutbasedID_Fall17_V2_medium')+userInt('cutbasedID_Fall17_V2_tight')",int,doc="cut-based ID Fall17 V2 (0:fail, 1:veto, 2:loose, 3:medium, 4:tight)"), vidNestedWPBitmap = Var("userInt('VIDNestedWPBitmap')",int,doc=_bitmapVIDForEle_docstring), @@ -536,22 +550,24 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): (run3_nanoAOD_devel).toModify(slimmedElectronsWithUserData.userFloats, mvaFall17V1Iso = None, mvaFall17V1noIso = None, - mvaFall17V2Iso = None, - mvaFall17V2noIso = None, + mvaIso = None, + mvaNoIso = None, + mvaHZZIso = None, ) (run3_nanoAOD_devel).toModify(electronTable.variables, - mvaFall17V2Iso = None, - mvaFall17V2Iso_WP80 = None, - mvaFall17V2Iso_WP90 = None, - mvaFall17V2Iso_WPL = None, - mvaFall17V2noIso = None, - mvaFall17V2noIso_WP80 = None, - mvaFall17V2noIso_WP90 = None, - mvaFall17V2noIso_WPL = None, + mvaIso = None, + mvaIso_WP80 = None, + mvaIso_WP90 = None, + mvaIso_WPL = None, + mvaNoIso = None, + mvaNoIso_WP80 = None, + mvaNoIso_WP90 = None, + mvaNoIso_WPL = None, vidNestedWPBitmapHEEP = None, vidNestedWPBitmap = None, cutBased = None, cutBased_HEEP = None, + mvaHZZIso = None, ) (run3_nanoAOD_devel).toReplaceWith(electronTablesTask, electronTablesTask.copyAndExclude([electronMVATTH])) From 2297d40821786449db3e2937ec2cc9efb37a7cde Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Mon, 13 Jun 2022 10:10:09 +0200 Subject: [PATCH 2/8] Defining preUL indicator --- PhysicsTools/NanoAOD/python/nano_eras_cff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/NanoAOD/python/nano_eras_cff.py b/PhysicsTools/NanoAOD/python/nano_eras_cff.py index 3fdcf78ed0456..3c0e9479104f9 100644 --- a/PhysicsTools/NanoAOD/python/nano_eras_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_eras_cff.py @@ -24,4 +24,7 @@ run2_nanoAOD_ANY = ( run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1 | run2_nanoAOD_106Xv2 -) \ No newline at end of file +) +run2_nanoAOD_preUL = ( + run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 +) From e0f0c1c30d64cc64c3bc0b42c2bcfe6bb56e4f5d Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Mon, 13 Jun 2022 10:41:47 +0200 Subject: [PATCH 3/8] Adding HZZ electron ID to miniAOD_tools.py --- PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index e29c2f0e1824e..8285ff7efce38 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -301,6 +301,9 @@ def _add_deepFlavour(process): 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Summer16_80X_V1_cff', 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_GeneralPurpose_V1_cff', 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_HZZ_V1_cff', + 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer16UL_ID_ISO_cff', + 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer17UL_ID_ISO_cff', + 'RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer18UL_ID_ISO_cff', ] switchOnVIDElectronIdProducer(process,DataFormat.MiniAOD, task) process.egmGsfElectronIDs.physicsObjectSrc = cms.InputTag("reducedEgamma","reducedGedGsfElectrons") From eaee3c54d0d61c2a8ca1e94dc634ca9bac5d7d64 Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:41:03 +0200 Subject: [PATCH 4/8] Update electron_cff.py for cleanup --- PhysicsTools/NanoAOD/python/electrons_cff.py | 80 ++++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 4e62a070d9bcf..db37a751d67d5 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -35,7 +35,7 @@ run2_miniAOD_80XLegacy.toModify( slimmedElectronsUpdated, computeMiniIso = True ) ##modify the past eras for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94X2016,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_102Xv1: - modifier.toModify(slimmedElectronsUpdated, src = cms.InputTag("slimmedElectronsTo106X")) + modifier.toModify(slimmedElectronsUpdated, src = "slimmedElectronsTo106X" ) ############################FOR bitmapVIDForEle main defn############################# electron_id_modules_WorkingPoints_nanoAOD = cms.PSet( modules = cms.vstring( @@ -162,32 +162,32 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): ) (run2_egamma_2016 & tracker_apv_vfp30_2016).toModify(calibratedPatElectronsNano, - correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_preVFP_RunFineEtaR9Gain") + correctionFile = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_preVFP_RunFineEtaR9Gain" ) (run2_egamma_2016 & ~tracker_apv_vfp30_2016).toModify(calibratedPatElectronsNano, - correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_postVFP_RunFineEtaR9Gain") + correctionFile = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_postVFP_RunFineEtaR9Gain" ) run2_egamma_2017.toModify(calibratedPatElectronsNano, - correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_24Feb2020_runEtaR9Gain_v2") + correctionFile = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_24Feb2020_runEtaR9Gain_v2" ) run2_egamma_2018.toModify(calibratedPatElectronsNano, - correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_29Sep2020_RunFineEtaR9Gain") + correctionFile = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_29Sep2020_RunFineEtaR9Gain" ) run2_miniAOD_80XLegacy.toModify(calibratedPatElectronsNano, - correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Legacy2016_07Aug2017_FineEtaR9_v3_ele_unc") + correctionFile = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Legacy2016_07Aug2017_FineEtaR9_v3_ele_unc" ) for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2: modifier.toModify(calibratedPatElectronsNano, - correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc") + correctionFile = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc" ) run2_nanoAOD_102Xv1.toModify(calibratedPatElectronsNano, - correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_Step2Closure_CoarseEtaR9Gain_v2") + correctionFile = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_Step2Closure_CoarseEtaR9Gain_v2" ) ##############################end calibratedPatElectronsNano############################33 #####################Start slimmedElectronsWithUserData###############################3 @@ -268,55 +268,55 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): run2_nanoAOD_94X2016.toModify(slimmedElectronsWithUserData.userIntFromBools, # MVAs and HEEP are already pre-computed. Cut-based too (except V2), but we re-add it for consistency with the nested bitmap - cutbasedID_Sum16_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto"), - cutbasedID_Sum16_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose"), - cutbasedID_Sum16_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium"), - cutbasedID_Sum16_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight"), - cutbasedID_HLT = cms.InputTag("egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1"), - cutbasedID_Spring15_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto"), - cutbasedID_Spring15_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose"), - cutbasedID_Spring15_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium"), - cutbasedID_Spring15_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight"), - cutbasedID_Fall17_V2_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-veto"), - cutbasedID_Fall17_V2_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-loose"), - cutbasedID_Fall17_V2_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-medium"), - cutbasedID_Fall17_V2_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-tight"), + cutbasedID_Sum16_veto = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto", + cutbasedID_Sum16_loose = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose", + cutbasedID_Sum16_medium = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium", + cutbasedID_Sum16_tight = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight", + cutbasedID_HLT = "egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1", + cutbasedID_Spring15_veto = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto", + cutbasedID_Spring15_loose = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose", + cutbasedID_Spring15_medium = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium", + cutbasedID_Spring15_tight = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight", + cutbasedID_Fall17_V2_veto = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-veto", + cutbasedID_Fall17_V2_loose = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-loose", + cutbasedID_Fall17_V2_medium = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-medium", + cutbasedID_Fall17_V2_tight = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-tight", ) run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userFloats, - mvaSpring16GP = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16GeneralPurposeV1Values"), - mvaSpring16HZZ = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16HZZV1Values"), + mvaSpring16GP = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16GeneralPurposeV1Values", + mvaSpring16HZZ = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16HZZV1Values", ) run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userIntFromBools, - mvaSpring16GP_WP90 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp90"), - mvaSpring16GP_WP80 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp80"), - mvaSpring16HZZ_WPL = cms.InputTag("egmGsfElectronIDs:mvaEleID-Spring16-HZZ-V1-wpLoose"), - cutbasedID_Sum16_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto"), - cutbasedID_Sum16_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose"), - cutbasedID_Sum16_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium"), - cutbasedID_Sum16_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight"), - cutbasedID_HLT = cms.InputTag("egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1"), - cutbasedID_Spring15_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto"), - cutbasedID_Spring15_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose"), - cutbasedID_Spring15_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium"), - cutbasedID_Spring15_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight"), + mvaSpring16GP_WP90 = "egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp90", + mvaSpring16GP_WP80 = "egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp80", + mvaSpring16HZZ_WPL = "egmGsfElectronIDs:mvaEleID-Spring16-HZZ-V1-wpLoose", + cutbasedID_Sum16_veto = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto", + cutbasedID_Sum16_loose = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose", + cutbasedID_Sum16_medium = ("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium", + cutbasedID_Sum16_tight = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight", + cutbasedID_HLT = "egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1", + cutbasedID_Spring15_veto = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto", + cutbasedID_Spring15_loose = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose", + cutbasedID_Spring15_medium = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium", + cutbasedID_Spring15_tight = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight", ) for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016: modifier.toModify(slimmedElectronsWithUserData.userInts, - VIDNestedWPBitmapSpring15 = cms.InputTag("bitmapVIDForEleSpring15"), - VIDNestedWPBitmapSum16 = cms.InputTag("bitmapVIDForEleSum16"), + VIDNestedWPBitmapSpring15 = "bitmapVIDForEleSpring15", + VIDNestedWPBitmapSum16 = "bitmapVIDForEleSum16", ) (~run2_nanoAOD_preUL & run2_egamma_2016).toModify(slimmedElectronsWithUserData.userFloats, - mvaHZZIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer16ULIdIsoValues"), + mvaHZZIso = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer16ULIdIsoValues", ) (~run2_nanoAOD_preUL & run2_egamma_2017).toModify(slimmedElectronsWithUserData.userFloats, - mvaHZZIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer17ULIdIsoValues") , + mvaHZZIso = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer17ULIdIsoValues" , ) (~run2_nanoAOD_preUL & run2_egamma_2018).toModify(slimmedElectronsWithUserData.userFloats, - mvaHZZIso = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer18ULIdIsoValues"), + mvaHZZIso = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer18ULIdIsoValues", ) #################################################END slimmedElectrons with user data##################### #################################################finalElectrons##################### From bf6a39792dc23ea86a5c741aca18dbad2960d584 Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:49:03 +0200 Subject: [PATCH 5/8] Update nanoDQM_cfi.py with generic Egamma ID names --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 4eda9a9fb9403..ce4aec22c49ec 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -83,14 +83,14 @@ NoPlot('mass'), Plot1D('miniPFRelIso_all', 'miniPFRelIso_all', 20, 0, 1, 'mini PF relative isolation, total (with scaled rho*EA PU corrections)'), Plot1D('miniPFRelIso_chg', 'miniPFRelIso_chg', 20, 0, 1, 'mini PF relative isolation, charged component'), - Plot1D('mvaFall17V2Iso', 'mvaFall17V2Iso', 20, -1, 1, 'MVA Iso ID V2 score'), - Plot1D('mvaFall17V2Iso_WP80', 'mvaFall17V2Iso_WP80', 2, -0.5, 1.5, 'MVA Iso ID V2 WP80'), - Plot1D('mvaFall17V2Iso_WP90', 'mvaFall17V2Iso_WP90', 2, -0.5, 1.5, 'MVA Iso ID V2 WP90'), - Plot1D('mvaFall17V2Iso_WPL', 'mvaFall17V2Iso_WPL', 2, -0.5, 1.5, 'MVA Iso ID V2 loose WP'), - Plot1D('mvaFall17V2noIso', 'mvaFall17V2noIso', 20, -1, 1, 'MVA noIso ID V2 score'), - Plot1D('mvaFall17V2noIso_WP80', 'mvaFall17V2noIso_WP80', 2, -0.5, 1.5, 'MVA noIso ID V2 WP80'), - Plot1D('mvaFall17V2noIso_WP90', 'mvaFall17V2noIso_WP90', 2, -0.5, 1.5, 'MVA noIso ID V2 WP90'), - Plot1D('mvaFall17V2noIso_WPL', 'mvaFall17V2noIso_WPL', 2, -0.5, 1.5, 'MVA noIso ID V2 loose WP'), + Plot1D('mvaIso', 'mvaIso', 20, -1, 1, 'MVA Iso ID V2 score'), + Plot1D('mvaIso_WP80', 'mvaIso_WP80', 2, -0.5, 1.5, 'MVA Iso ID V2 WP80'), + Plot1D('mvaIso_WP90', 'mvaIso_WP90', 2, -0.5, 1.5, 'MVA Iso ID V2 WP90'), + Plot1D('mvaIso_WPL', 'mvaIso_WPL', 2, -0.5, 1.5, 'MVA Iso ID V2 loose WP'), + Plot1D('mvaNoIso', 'mvaNoIso', 20, -1, 1, 'MVA noIso ID V2 score'), + Plot1D('mvaNoIso_WP80', 'mvaNoIso_WP80', 2, -0.5, 1.5, 'MVA noIso ID V2 WP80'), + Plot1D('mvaNoIso_WP90', 'mvaNoIso_WP90', 2, -0.5, 1.5, 'MVA noIso ID V2 WP90'), + Plot1D('mvaNoIso_WPL', 'mvaNoIso_WPL', 2, -0.5, 1.5, 'MVA noIso ID V2 loose WP'), Plot1D('mvaTTH', 'mvaTTH', 20, -1, 1, 'TTH MVA lepton ID score'), Plot1D('pdgId', 'pdgId', 27, -13.5, 13.5, 'PDG code assigned by the event reconstruction (not by MC truth)'), Plot1D('pfRelIso03_all', 'pfRelIso03_all', 20, 0, 2, 'PF relative isolation dR=0.3, total (with rho*EA PU corrections)'), From 127e286cdd806c161fde8f919ca86f9cbbfeca0b Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Thu, 30 Jun 2022 09:43:57 +0200 Subject: [PATCH 6/8] Update PhysicsTools/NanoAOD/python/electrons_cff.py Co-authored-by: Claudio Caputo --- PhysicsTools/NanoAOD/python/electrons_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index db37a751d67d5..806de85639581 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -295,7 +295,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): mvaSpring16HZZ_WPL = "egmGsfElectronIDs:mvaEleID-Spring16-HZZ-V1-wpLoose", cutbasedID_Sum16_veto = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto", cutbasedID_Sum16_loose = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose", - cutbasedID_Sum16_medium = ("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium", + cutbasedID_Sum16_medium = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium", cutbasedID_Sum16_tight = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight", cutbasedID_HLT = "egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1", cutbasedID_Spring15_veto = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto", From b1fdca123a5becda68f6b2c8d4e49b55eeaff2c6 Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:08:43 +0200 Subject: [PATCH 7/8] Undo part of cleanup in electrons_cff.py Putting back cms.InputTag to avoid error raising --- PhysicsTools/NanoAOD/python/electrons_cff.py | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 806de85639581..80aeaf93d9d85 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -285,29 +285,29 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): ) run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userFloats, - mvaSpring16GP = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16GeneralPurposeV1Values", - mvaSpring16HZZ = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16HZZV1Values", + mvaSpring16GP = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16GeneralPurposeV1Values"), + mvaSpring16HZZ = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16HZZV1Values"), ) run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userIntFromBools, - mvaSpring16GP_WP90 = "egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp90", - mvaSpring16GP_WP80 = "egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp80", - mvaSpring16HZZ_WPL = "egmGsfElectronIDs:mvaEleID-Spring16-HZZ-V1-wpLoose", - cutbasedID_Sum16_veto = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto", - cutbasedID_Sum16_loose = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose", - cutbasedID_Sum16_medium = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium", - cutbasedID_Sum16_tight = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight", - cutbasedID_HLT = "egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1", - cutbasedID_Spring15_veto = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto", - cutbasedID_Spring15_loose = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose", - cutbasedID_Spring15_medium = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium", - cutbasedID_Spring15_tight = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight", + mvaSpring16GP_WP90 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp90"), + mvaSpring16GP_WP80 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp80"), + mvaSpring16HZZ_WPL = cms.InputTag("egmGsfElectronIDs:mvaEleID-Spring16-HZZ-V1-wpLoose"), + cutbasedID_Sum16_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto"), + cutbasedID_Sum16_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose"), + cutbasedID_Sum16_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium"), + cutbasedID_Sum16_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight"), + cutbasedID_HLT = cms.InputTag("egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1"), + cutbasedID_Spring15_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto"), + cutbasedID_Spring15_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose"), + cutbasedID_Spring15_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium"), + cutbasedID_Spring15_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight"), ) for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016: modifier.toModify(slimmedElectronsWithUserData.userInts, - VIDNestedWPBitmapSpring15 = "bitmapVIDForEleSpring15", - VIDNestedWPBitmapSum16 = "bitmapVIDForEleSum16", + VIDNestedWPBitmapSpring15 = cms.InputTag("bitmapVIDForEleSpring15"), + VIDNestedWPBitmapSum16 = cms.InputTag("bitmapVIDForEleSum16"), ) (~run2_nanoAOD_preUL & run2_egamma_2016).toModify(slimmedElectronsWithUserData.userFloats, mvaHZZIso = "electronMVAValueMapProducer:ElectronMVAEstimatorRun2Summer16ULIdIsoValues", From 4999e15c4eea76bf9298308f73a3e351bfd49a05 Mon Sep 17 00:00:00 2001 From: Ana Sculac <73283250+asculac@users.noreply.github.com> Date: Mon, 11 Jul 2022 16:44:43 +0200 Subject: [PATCH 8/8] Undo cleanup for 94X2016 in electrons_cff.py --- PhysicsTools/NanoAOD/python/electrons_cff.py | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 80aeaf93d9d85..77577b9979ede 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -268,19 +268,19 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): run2_nanoAOD_94X2016.toModify(slimmedElectronsWithUserData.userIntFromBools, # MVAs and HEEP are already pre-computed. Cut-based too (except V2), but we re-add it for consistency with the nested bitmap - cutbasedID_Sum16_veto = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto", - cutbasedID_Sum16_loose = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose", - cutbasedID_Sum16_medium = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium", - cutbasedID_Sum16_tight = "egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight", - cutbasedID_HLT = "egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1", - cutbasedID_Spring15_veto = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto", - cutbasedID_Spring15_loose = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose", - cutbasedID_Spring15_medium = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium", - cutbasedID_Spring15_tight = "egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight", - cutbasedID_Fall17_V2_veto = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-veto", - cutbasedID_Fall17_V2_loose = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-loose", - cutbasedID_Fall17_V2_medium = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-medium", - cutbasedID_Fall17_V2_tight = "egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-tight", + cutbasedID_Sum16_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto"), + cutbasedID_Sum16_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose"), + cutbasedID_Sum16_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium"), + cutbasedID_Sum16_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight"), + cutbasedID_HLT = cms.InputTag("egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1"), + cutbasedID_Spring15_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-veto"), + cutbasedID_Spring15_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-loose"), + cutbasedID_Spring15_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-medium"), + cutbasedID_Spring15_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Spring15-25ns-V1-standalone-tight"), + cutbasedID_Fall17_V2_veto = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-veto"), + cutbasedID_Fall17_V2_loose = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-loose"), + cutbasedID_Fall17_V2_medium = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-medium"), + cutbasedID_Fall17_V2_tight = cms.InputTag("egmGsfElectronIDs:cutBasedElectronID-Fall17-94X-V2-tight"), )