1 import FWCore.ParameterSet.Config
as cms
4 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_GeneralPurpose_V1_cff
as ele_spring16_gp_v1
5 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_HZZ_V1_cff
as ele_spring16_hzz_v1
6 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V1_cff
as ele_fall17_iso_v1
7 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V1_cff
as ele_fall17_noIso_v1
8 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V2_cff
as ele_fall17_iso_v2
9 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V2_cff
as ele_fall17_noIso_v2
10 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Summer18UL_ID_ISO_cff
as ele_summer18UL_hzz
12 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_RunIIIWinter22_iso_V1_cff
as ele_RunIIIWinter22_iso_v1
13 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_RunIIIWinter22_noIso_V1_cff
as ele_RunIIIWinter22_noIso_v1
14 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Winter22_HZZ_V1_cff
as ele_Winter22_HZZ_V1
17 import RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff
as pho_spring16_nt_v1
23 ele_mva_prod_name =
'electronMVAValueMapProducer' 24 pho_mva_prod_name =
'photonMVAValueMapProducer' 26 def setup_mva(val_pset,cat_pset,prod_name,mva_name):
27 value_name =
'%s:%sValues'%(prod_name,mva_name)
28 cat_name =
'%s:%sCategories'%(prod_name,mva_name)
29 setattr( val_pset,
'%sValues'%mva_name, cms.InputTag(value_name) )
30 setattr( cat_pset,
'%sCategories'%mva_name, cms.InputTag(cat_name) )
32 egamma_modifications = cms.VPSet(
33 cms.PSet( modifierName = cms.string(
'EGExtraInfoModifierFromFloatValueMaps'),
34 electron_config = cms.PSet( ),
35 photon_config = cms.PSet( )
37 cms.PSet( modifierName = cms.string(
'EGExtraInfoModifierFromIntValueMaps'),
38 electron_config = cms.PSet( ),
39 photon_config = cms.PSet( )
52 ele_RunIIIWinter22_iso_v1,
53 ele_RunIIIWinter22_noIso_v1,
57 setup_mva(egamma_modifications[0].electron_config,
58 egamma_modifications[1].electron_config,
60 ele_mva_cff.mvaClassName + ele_mva_cff.mvaTag)
69 setup_mva(egamma_modifications[0].photon_config,
70 egamma_modifications[1].photon_config,
72 pho_mva_cff.mvaClassName + pho_mva_cff.mvaTag)
85 reducedEgammaEnergyScaleAndSmearingModifier = cms.PSet(
86 modifierName = cms.string(
'EGExtraInfoModifierFromFloatValueMaps'),
87 electron_config = cms.PSet(),
88 photon_config = cms.PSet()
90 from RecoEgamma.EgammaTools.calibratedEgammas_cff
import prefixName
91 import RecoEgamma.EgammaTools.calibratedElectronProducer_cfi
92 for valueMapName
in RecoEgamma.EgammaTools.calibratedElectronProducer_cfi.calibratedElectronProducer.valueMapsStored:
93 setattr(reducedEgammaEnergyScaleAndSmearingModifier.electron_config,valueMapName,cms.InputTag(
"reducedEgamma",
prefixName(
"calibEle",valueMapName)))
95 import RecoEgamma.EgammaTools.calibratedPhotonProducer_cfi
96 for valueMapName
in RecoEgamma.EgammaTools.calibratedPhotonProducer_cfi.calibratedPhotonProducer.valueMapsStored:
97 setattr(reducedEgammaEnergyScaleAndSmearingModifier.photon_config,valueMapName,cms.InputTag(
"reducedEgamma",
prefixName(
"calibPho",valueMapName)))
102 egamma8XObjectUpdateModifier = cms.PSet(
103 modifierName = cms.string(
'EG8XObjectUpdateModifier'),
104 ecalRecHitsEB = cms.InputTag(
"reducedEgamma",
"reducedEBRecHits"),
105 ecalRecHitsEE = cms.InputTag(
"reducedEgamma",
"reducedEERecHits"),
111 egamma9X105XUpdateModifier = cms.PSet(
112 modifierName = cms.string(
'EG9X105XObjectUpdateModifier'),
113 eleCollVMsAreKeyedTo = cms.InputTag(
"slimmedElectrons",processName=cms.InputTag.skipCurrentProcess()),
114 phoCollVMsAreKeyedTo = cms.InputTag(
"slimmedPhotons",processName=cms.InputTag.skipCurrentProcess()),
115 conversions = cms.InputTag(
"reducedEgamma",
"reducedConversions"),
116 beamspot = cms.InputTag(
"offlineBeamSpot"),
117 ecalRecHitsEB = cms.InputTag(
"reducedEgamma",
"reducedEBRecHits"),
118 ecalRecHitsEE = cms.InputTag(
"reducedEgamma",
"reducedEERecHits"),
119 eleTrkIso = cms.InputTag(
"heepIDVarValueMaps",
"eleTrkPtIso"),
120 eleTrkIso04 = cms.InputTag(
"heepIDVarValueMaps",
"eleTrkPtIso04"),
121 phoPhotonIso = cms.InputTag(
"photonIDValueMapProducer",
"phoPhotonIsolation"),
122 phoNeutralHadIso = cms.InputTag(
"photonIDValueMapProducer",
"phoNeutralHadronIsolation"),
123 phoChargedHadIso = cms.InputTag(
"photonIDValueMapProducer",
"phoChargedIsolation"),
124 phoChargedHadWorstVtxIso = cms.InputTag(
"photonIDValueMapProducer",
"phoWorstChargedIsolation"),
125 phoChargedHadWorstVtxConeVetoIso = cms.InputTag(
"photonIDValueMapProducer",
"phoWorstChargedIsolationConeVeto"),
126 phoChargedHadPFPVIso = cms.InputTag(
"egmPhotonIsolation",
"h+-DR030-"),
127 allowGsfTrackForConvs = cms.bool(
False),
128 updateChargedHadPFPVIso = cms.bool(
True)
136 from RecoEgamma.EgammaTools.calibratedEgammas_cff
import ecalTrkCombinationRegression
137 egamma8XLegacyEtScaleSysModifier = cms.PSet(
138 modifierName = cms.string(
'EGEtScaleSysModifier'),
139 epCombConfig = ecalTrkCombinationRegression,
140 uncertFunc = cms.PSet(
141 name = cms.string(
"UncertFuncV1"),
142 lowEt = cms.double(43.5),
143 highEt = cms.double(46.5),
144 lowEtUncert = cms.double(0.002),
145 highEtUncert = cms.double(-0.002)
150 egammaHIPhotonIsolationModifier = cms.PSet(
151 modifierName = cms.string(
'EGExtraInfoModifierFromHIPhotonIsolationValueMaps'),
152 electron_config = cms.PSet(),
153 photon_config = cms.PSet(
154 photonIsolationHI = cms.InputTag(
"reducedEgamma:photonIsolationHIProducerppGED")
158 photonDRNModifier = cms.PSet(
159 modifierName = cms.string(
"EGRegressionModifierDRN"),
160 patPhotons = cms.PSet(
161 source = cms.InputTag(
"selectedPatPhotons"),
162 correctionsSource = cms.InputTag(
'patPhotonsDRN'),
163 energyFloat = cms.string(
"energyDRN"),
164 resFloat = cms.string(
"resolutionDRN")
169 modifiers.append(reducedEgammaEnergyScaleAndSmearingModifier)
172 modifiers.insert(0,egamma8XObjectUpdateModifier)
175 modifiers.append(reducedEgammaEnergyScaleAndSmearingModifier)
176 modifiers.append(egamma8XLegacyEtScaleSysModifier)
179 modifiers.append(egammaHIPhotonIsolationModifier)
182 modifiers.append(photonDRNModifier)
184 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
185 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff
import run2_miniAOD_UL
186 (run2_miniAOD_94XFall17 | run2_miniAOD_UL).toModify(egamma_modifications,appendReducedEgammaEnergyScaleAndSmearingModifier)
188 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
190 run2_miniAOD_80XLegacy.toModify(egamma9X105XUpdateModifier,allowGsfTrackForConvs =
True)
191 run2_miniAOD_80XLegacy.toModify(egamma_modifications,appendEgamma8XLegacyAppendableModifiers)
192 run2_miniAOD_80XLegacy.toModify(egamma_modifications,prependEgamma8XObjectUpdateModifier)
194 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
195 pp_on_AA.toModify(egamma_modifications, appendEgammaHIPhotonIsolationModifier)
197 from Configuration.ProcessModifiers.photonDRN_cff
import _photonDRN
198 _photonDRN.toModify(egamma_modifications, appendPhotonDRNModifier)
def prependEgamma8XObjectUpdateModifier(modifiers)
def appendEgamma8XLegacyAppendableModifiers(modifiers)
def appendReducedEgammaEnergyScaleAndSmearingModifier(modifiers)
def prefixName(prefix, name)
def setup_mva(val_pset, cat_pset, prod_name, mva_name)
def appendEgammaHIPhotonIsolationModifier(modifiers)
def appendPhotonDRNModifier(modifiers)