diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 1db916625e345..b6ab3cce41a25 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -6,6 +6,8 @@ from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 from Configuration.Eras.Modifier_run2_nanoAOD_106Xv1_cff import run2_nanoAOD_106Xv1 +from Configuration.Eras.Modifier_run2_egamma_2017_cff import run2_egamma_2017 +from Configuration.Eras.Modifier_run2_egamma_2018_cff import run2_egamma_2018 from PhysicsTools.NanoAOD.common_cff import * import PhysicsTools.PatAlgos.producersLayer1.electronProducer_cfi @@ -41,7 +43,12 @@ run2_miniAOD_80XLegacy.toModify( slimmedElectronsUpdated, computeMiniIso = True ) # bypass the update to 106X in 106X to only pick up the IP sign fix +run2_egamma_2017.toModify(slimmedElectronsUpdated, src = cms.InputTag("slimmedElectrons")) +run2_egamma_2018.toModify(slimmedElectronsUpdated, src = cms.InputTag("slimmedElectrons")) run2_nanoAOD_106Xv1.toModify(slimmedElectronsUpdated, src = cms.InputTag("slimmedElectrons")) +####because run2_egamma_2017 and run2_egamma_2018 can modify things further, need the following line to resort back +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")) electron_id_modules_WorkingPoints_nanoAOD = cms.PSet( @@ -129,7 +136,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _bitmapVIDForEleHEEP_docstring = _get_bitmapVIDForEle_docstring(electron_id_modules_WorkingPoints_nanoAOD.modules,bitmapVIDForEleHEEP.WorkingPoints) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: +for modifier in run2_egamma_2017,run2_egamma_2018,run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(bitmapVIDForEle, src = "slimmedElectronsUpdated") modifier.toModify(bitmapVIDForEleSpring15, src = "slimmedElectronsUpdated") modifier.toModify(bitmapVIDForEleSum16, src = "slimmedElectronsUpdated") @@ -150,7 +157,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): run2_nanoAOD_94X2016.toModify(isoForEle, EAFile_MiniIso = "RecoEgamma/ElectronIdentification/data/Spring15/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_25ns.txt", EAFile_PFIso = "RecoEgamma/ElectronIdentification/data/Summer16/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_80X.txt") -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: +for modifier in run2_egamma_2017,run2_egamma_2018,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(isoForEle, src = "slimmedElectronsUpdated") ptRatioRelForEle = cms.EDProducer("ElectronJetVarProducer", @@ -158,15 +165,27 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): srcLep = cms.InputTag("slimmedElectrons"), srcVtx = cms.InputTag("offlineSlimmedPrimaryVertices"), ) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: +for modifier in run2_egamma_2017,run2_egamma_2018,run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(ptRatioRelForEle, srcLep = "slimmedElectronsUpdated") seedGainEle = cms.EDProducer("ElectronSeedGainProducer", src = cms.InputTag("slimmedElectrons")) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: +for modifier in run2_egamma_2017,run2_egamma_2018,run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(seedGainEle, src = "slimmedElectronsUpdated") import RecoEgamma.EgammaTools.calibratedEgammas_cff +calibratedPatElectronsUL17 = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatElectrons.clone( + produceCalibratedObjs = False, + correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_24Feb2020_runEtaR9Gain_v2"), +) +run2_egamma_2017.toModify(calibratedPatElectronsUL17, src = "slimmedElectronsUpdated") + +calibratedPatElectronsUL18 = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatElectrons.clone( + produceCalibratedObjs = False, + correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_29Sep2020_RunFineEtaR9Gain"), +) +run2_egamma_2018.toModify(calibratedPatElectronsUL18, src = "slimmedElectronsUpdated") + calibratedPatElectrons80XLegacy = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatElectrons.clone( produceCalibratedObjs = False, correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Legacy2016_07Aug2017_FineEtaR9_v3_ele_unc"), @@ -237,9 +256,21 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): jetForLepJetVar = cms.InputTag("ptRatioRelForEle:jetForLepJetVar") # warning: Ptr is null if no match is found ), ) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: +for modifier in run2_egamma_2017,run2_egamma_2018,run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(slimmedElectronsWithUserData, src = "slimmedElectronsUpdated") +run2_egamma_2017.toModify(slimmedElectronsWithUserData.userFloats, + ecalTrkEnergyErrPostCorrNew = cms.InputTag("calibratedPatElectronsUL17","ecalTrkEnergyErrPostCorr"), + ecalTrkEnergyPreCorrNew = cms.InputTag("calibratedPatElectronsUL17","ecalTrkEnergyPreCorr"), + ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectronsUL17","ecalTrkEnergyPostCorr"), +) + +run2_egamma_2018.toModify(slimmedElectronsWithUserData.userFloats, + ecalTrkEnergyErrPostCorrNew = cms.InputTag("calibratedPatElectronsUL18","ecalTrkEnergyErrPostCorr"), + ecalTrkEnergyPreCorrNew = cms.InputTag("calibratedPatElectronsUL18","ecalTrkEnergyPreCorr"), + ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectronsUL18","ecalTrkEnergyPostCorr"), +) + run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userFloats, mvaSpring16GP = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16GeneralPurposeV1Values"), mvaSpring16HZZ = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16HZZV1Values"), @@ -406,19 +437,11 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): mvaTTH = ExtVar(cms.InputTag("electronMVATTH"),float, doc="TTH MVA lepton ID score",precision=14), ), ) -# scale and smearing only when available -for modifier in run2_nanoAOD_94X2016,: - modifier.toModify(electronTable.variables, - pt = Var("pt*userFloat('ecalTrkEnergyPostCorr')/userFloat('ecalTrkEnergyPreCorr')", float, precision=-1, doc="p_{T}"), - energyErr = Var("userFloat('ecalTrkEnergyErrPostCorr')", float, precision=6, doc="energy error of the cluster-track combination"), - eCorr = Var("userFloat('ecalTrkEnergyPostCorr')/userFloat('ecalTrkEnergyPreCorr')", float, doc="ratio of the calibrated energy/miniaod energy"), - scEtOverPt = Var("(superCluster().energy()/(pt*userFloat('ecalTrkEnergyPostCorr')/userFloat('ecalTrkEnergyPreCorr')*cosh(superCluster().eta())))-1",float,doc="(supercluster transverse energy)/pt-1",precision=8), - ) #the94X miniAOD V2 had a bug in the scale and smearing for electrons in the E/p comb #therefore we redo it but but we need use a new name for the userFloat as we cant override existing userfloats #for technical reasons -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_miniAOD_80XLegacy,run2_nanoAOD_102Xv1: +for modifier in run2_egamma_2017,run2_egamma_2018,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_miniAOD_80XLegacy,run2_nanoAOD_102Xv1: modifier.toModify(electronTable.variables, pt = Var("pt*userFloat('ecalTrkEnergyPostCorrNew')/userFloat('ecalTrkEnergyPreCorrNew')", float, precision=-1, doc="p_{T}"), energyErr = Var("userFloat('ecalTrkEnergyErrPostCorrNew')", float, precision=6, doc="energy error of the cluster-track combination"), @@ -426,6 +449,15 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): scEtOverPt = Var("(superCluster().energy()/(pt*userFloat('ecalTrkEnergyPostCorrNew')/userFloat('ecalTrkEnergyPreCorrNew')*cosh(superCluster().eta())))-1",float,doc="(supercluster transverse energy)/pt-1",precision=8), ) +# scale and smearing only when available +for modifier in run2_nanoAOD_94X2016,: + modifier.toModify(electronTable.variables, + pt = Var("pt*userFloat('ecalTrkEnergyPostCorr')/userFloat('ecalTrkEnergyPreCorr')", float, precision=-1, doc="p_{T}"), + energyErr = Var("userFloat('ecalTrkEnergyErrPostCorr')", float, precision=6, doc="energy error of the cluster-track combination"), + eCorr = Var("userFloat('ecalTrkEnergyPostCorr')/userFloat('ecalTrkEnergyPreCorr')", float, doc="ratio of the calibrated energy/miniaod energy"), + scEtOverPt = Var("(superCluster().energy()/(pt*userFloat('ecalTrkEnergyPostCorr')/userFloat('ecalTrkEnergyPreCorr')*cosh(superCluster().eta())))-1",float,doc="(supercluster transverse energy)/pt-1",precision=8), + ) + run2_nanoAOD_94X2016.toModify(electronTable.variables, cutBased_Sum16 = Var("userInt('cutbasedID_Sum16_veto')+userInt('cutbasedID_Sum16_loose')+userInt('cutbasedID_Sum16_medium')+userInt('cutbasedID_Sum16_tight')",int,doc="cut-based Summer16 ID (0:fail, 1:veto, 2:loose, 3:medium, 4:tight)"), cutBased_Fall17_V1 = Var("electronID('cutBasedElectronID-Fall17-94X-V1-veto')+electronID('cutBasedElectronID-Fall17-94X-V1-loose')+electronID('cutBasedElectronID-Fall17-94X-V1-medium')+electronID('cutBasedElectronID-Fall17-94X-V1-tight')",int,doc="cut-based Fall17 ID (0:fail, 1:veto, 2:loose, 3:medium, 4:tight)"), @@ -496,6 +528,16 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _withTo106XAndUpdate_sequence = cms.Sequence(_updateTo106X_sequence + slimmedElectronsUpdated + electronSequence.copy()) +_withULAndUpdate_sequence = cms.Sequence(slimmedElectronsUpdated + electronSequence.copy()) + +_withUL17AndUpdateScale_sequence = _withULAndUpdate_sequence.copy() +_withUL17AndUpdateScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectronsUL17 + slimmedElectronsWithUserData) +run2_egamma_2017.toReplaceWith(electronSequence, _withUL17AndUpdateScale_sequence) + +_withUL18AndUpdateScale_sequence = _withULAndUpdate_sequence.copy() +_withUL18AndUpdateScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectronsUL18 + slimmedElectronsWithUserData) +run2_egamma_2018.toReplaceWith(electronSequence, _withUL18AndUpdateScale_sequence) + _withTo106XAndUpdateAnd80XLegacyScale_sequence = _withTo106XAndUpdate_sequence.copy() _withTo106XAndUpdateAnd80XLegacyScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons80XLegacy + bitmapVIDForEleSpring15 +bitmapVIDForEleSum16 + slimmedElectronsWithUserData) run2_miniAOD_80XLegacy.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd80XLegacyScale_sequence) diff --git a/PhysicsTools/NanoAOD/python/nano_cff.py b/PhysicsTools/NanoAOD/python/nano_cff.py index 70aa5a9d4a4ed..7f0f047492c6a 100644 --- a/PhysicsTools/NanoAOD/python/nano_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_cff.py @@ -26,6 +26,8 @@ from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel from Configuration.Eras.Modifier_run2_tau_ul_2016_cff import run2_tau_ul_2016 from Configuration.Eras.Modifier_run2_tau_ul_2018_cff import run2_tau_ul_2018 +from Configuration.Eras.Modifier_run2_egamma_2017_cff import run2_egamma_2017 +from Configuration.Eras.Modifier_run2_egamma_2018_cff import run2_egamma_2018 nanoMetadata = cms.EDProducer("UniqueStringProducer", strings = cms.PSet( @@ -239,7 +241,7 @@ def nanoAOD_activateVID(process): for modname in electron_id_modules_WorkingPoints_nanoAOD.modules: setupAllVIDIdsInModule(process,modname,setupVIDElectronSelection) process.electronSequence.insert(process.electronSequence.index(process.bitmapVIDForEle),process.egmGsfElectronIDSequence) - for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: + for modifier in run2_egamma_2017,run2_egamma_2018,run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(process.electronMVAValueMapProducer, srcMiniAOD = "slimmedElectronsUpdated") modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc = "slimmedElectronsUpdated") diff --git a/PhysicsTools/NanoAOD/python/photons_cff.py b/PhysicsTools/NanoAOD/python/photons_cff.py index 4b9f4a7b22cc5..709d2f7e72489 100644 --- a/PhysicsTools/NanoAOD/python/photons_cff.py +++ b/PhysicsTools/NanoAOD/python/photons_cff.py @@ -8,6 +8,8 @@ from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 +from Configuration.Eras.Modifier_run2_egamma_2017_cff import run2_egamma_2017 +from Configuration.Eras.Modifier_run2_egamma_2018_cff import run2_egamma_2018 photon_id_modules_WorkingPoints_nanoAOD = cms.PSet( modules = cms.vstring( @@ -78,6 +80,17 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): seedGainPho = cms.EDProducer("PhotonSeedGainProducer", src = cms.InputTag("slimmedPhotons")) import RecoEgamma.EgammaTools.calibratedEgammas_cff + +calibratedPatPhotonsUL17 = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatPhotons.clone( + produceCalibratedObjs = False, + correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_24Feb2020_runEtaR9Gain_v2") +) + +calibratedPatPhotonsUL18 = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatPhotons.clone( + produceCalibratedObjs = False, + correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_29Sep2020_RunFineEtaR9Gain") +) + calibratedPatPhotons102Xv1 = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatPhotons.clone( produceCalibratedObjs = False, correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_Step2Closure_CoarseEtaR9Gain_v2") @@ -88,6 +101,11 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc") ) +calibratedPatPhotons94Xv2 = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatPhotons.clone( + produceCalibratedObjs = False, + correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc") +) + calibratedPatPhotons80XLegacy = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatPhotons.clone( produceCalibratedObjs = False, correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Legacy2016_07Aug2017_FineEtaR9_v3_ele_unc"), @@ -124,6 +142,18 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): ), ) +run2_egamma_2017.toModify(slimmedPhotonsWithUserData.userFloats, + ecalEnergyErrPostCorrNew = cms.InputTag("calibratedPatPhotonsUL17","ecalEnergyErrPostCorr"), + ecalEnergyPreCorrNew = cms.InputTag("calibratedPatPhotonsUL17","ecalEnergyPreCorr"), + ecalEnergyPostCorrNew = cms.InputTag("calibratedPatPhotonsUL17","ecalEnergyPostCorr"), +) + +run2_egamma_2018.toModify(slimmedPhotonsWithUserData.userFloats, + ecalEnergyErrPostCorrNew = cms.InputTag("calibratedPatPhotonsUL18","ecalEnergyErrPostCorr"), + ecalEnergyPreCorrNew = cms.InputTag("calibratedPatPhotonsUL18","ecalEnergyPreCorr"), + ecalEnergyPostCorrNew = cms.InputTag("calibratedPatPhotonsUL18","ecalEnergyPostCorr"), +) + run2_miniAOD_80XLegacy.toModify(slimmedPhotonsWithUserData.userFloats, ecalEnergyErrPostCorrNew = cms.InputTag("calibratedPatPhotons80XLegacy","ecalEnergyErrPostCorr"), ecalEnergyPreCorrNew = cms.InputTag("calibratedPatPhotons80XLegacy","ecalEnergyPreCorr"), @@ -134,6 +164,11 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): ecalEnergyPreCorrNew = cms.InputTag("calibratedPatPhotons94Xv1","ecalEnergyPreCorr"), ecalEnergyPostCorrNew = cms.InputTag("calibratedPatPhotons94Xv1","ecalEnergyPostCorr"), ) +run2_nanoAOD_94XMiniAODv2.toModify(slimmedPhotonsWithUserData.userFloats, + ecalEnergyErrPostCorrNew = cms.InputTag("calibratedPatPhotons94Xv2","ecalEnergyErrPostCorr"), + ecalEnergyPreCorrNew = cms.InputTag("calibratedPatPhotons94Xv2","ecalEnergyPreCorr"), + ecalEnergyPostCorrNew = cms.InputTag("calibratedPatPhotons94Xv2","ecalEnergyPostCorr"), +) run2_nanoAOD_102Xv1.toModify(slimmedPhotonsWithUserData.userFloats, ecalEnergyErrPostCorrNew = cms.InputTag("calibratedPatPhotons102Xv1","ecalEnergyErrPostCorr"), ecalEnergyPreCorrNew = cms.InputTag("calibratedPatPhotons102Xv1","ecalEnergyPreCorr"), @@ -213,7 +248,7 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): ) #these eras need to make the energy correction, hence the "New" -for modifier in run2_nanoAOD_94XMiniAODv1, run2_miniAOD_80XLegacy, run2_nanoAOD_102Xv1: +for modifier in run2_egamma_2017,run2_egamma_2018,run2_nanoAOD_94XMiniAODv1, run2_miniAOD_80XLegacy, run2_nanoAOD_102Xv1,run2_nanoAOD_94XMiniAODv2: modifier.toModify(photonTable.variables, pt = Var("pt*userFloat('ecalEnergyPostCorrNew')/userFloat('ecalEnergyPreCorrNew')", float, precision=-1, doc="p_{T}"), energyErr = Var("userFloat('ecalEnergyErrPostCorrNew')",float,doc="energy error of the cluster from regression",precision=6), @@ -264,6 +299,7 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): modifier.toModify(isoForPho, src = "slimmedPhotonsTo106X") modifier.toModify(calibratedPatPhotons102Xv1, src = "slimmedPhotonsTo106X") modifier.toModify(calibratedPatPhotons94Xv1, src = "slimmedPhotonsTo106X") + modifier.toModify(calibratedPatPhotons94Xv2, src = "slimmedPhotonsTo106X") modifier.toModify(calibratedPatPhotons80XLegacy, src = "slimmedPhotonsTo106X") modifier.toModify(slimmedPhotonsWithUserData, src = "slimmedPhotonsTo106X") modifier.toModify(seedGainPho, src = "slimmedPhotonsTo106X") @@ -283,10 +319,20 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): from RecoEgamma.EgammaIsolationAlgos.egmPhotonIsolationMiniAOD_cff import egmPhotonIsolation from RecoEgamma.PhotonIdentification.photonIDValueMapProducer_cff import photonIDValueMapProducer +###UL to be done first +_withUL17Scale_sequence = photonSequence.copy() +_withUL17Scale_sequence.replace(slimmedPhotonsWithUserData, calibratedPatPhotonsUL17 + slimmedPhotonsWithUserData) +run2_egamma_2017.toReplaceWith(photonSequence, _withUL17Scale_sequence) + +_withUL18Scale_sequence = photonSequence.copy() +_withUL18Scale_sequence.replace(slimmedPhotonsWithUserData, calibratedPatPhotonsUL18 + slimmedPhotonsWithUserData) +run2_egamma_2018.toReplaceWith(photonSequence, _withUL18Scale_sequence) + + _updatePhoTo106X_sequence =cms.Sequence(egmPhotonIsolation + photonIDValueMapProducer + slimmedPhotonsTo106X) _withUpdatePho_sequence = photonSequence.copy() _withUpdatePho_sequence.insert(0,_updatePhoTo106X_sequence) -for modifier in run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: +for modifier in run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1,run2_nanoAOD_94XMiniAODv1: modifier.toReplaceWith(photonSequence, _withUpdatePho_sequence) _with80XScale_sequence = _withUpdatePho_sequence.copy() @@ -297,6 +343,10 @@ def make_bitmapVID_docstring(id_modules_working_points_pset): _with94Xv1Scale_sequence.replace(slimmedPhotonsWithUserData, calibratedPatPhotons94Xv1 + slimmedPhotonsWithUserData) run2_nanoAOD_94XMiniAODv1.toReplaceWith(photonSequence, _with94Xv1Scale_sequence) +_with94Xv2Scale_sequence = _withUpdatePho_sequence.copy() +_with94Xv2Scale_sequence.replace(slimmedPhotonsWithUserData, calibratedPatPhotons94Xv2 + slimmedPhotonsWithUserData) +run2_nanoAOD_94XMiniAODv2.toReplaceWith(photonSequence, _with94Xv2Scale_sequence) + _with102Xv1Scale_sequence = photonSequence.copy() _with102Xv1Scale_sequence.replace(slimmedPhotonsWithUserData, calibratedPatPhotons102Xv1 + slimmedPhotonsWithUserData) run2_nanoAOD_102Xv1.toReplaceWith(photonSequence, _with102Xv1Scale_sequence)