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
16 import RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Spring16_nonTrig_V1_cff
as pho_spring16_nt_v1
22 ele_mva_prod_name =
'electronMVAValueMapProducer' 23 pho_mva_prod_name =
'photonMVAValueMapProducer' 25 def setup_mva(val_pset,cat_pset,prod_name,mva_name):
26 value_name =
'%s:%sValues'%(prod_name,mva_name)
27 cat_name =
'%s:%sCategories'%(prod_name,mva_name)
28 setattr( val_pset,
'%sValues'%mva_name, cms.InputTag(value_name) )
29 setattr( cat_pset,
'%sCategories'%mva_name, cms.InputTag(cat_name) )
31 egamma_modifications = cms.VPSet(
32 cms.PSet( modifierName = cms.string(
'EGExtraInfoModifierFromFloatValueMaps'),
33 electron_config = cms.PSet( ),
34 photon_config = cms.PSet( )
36 cms.PSet( modifierName = cms.string(
'EGExtraInfoModifierFromIntValueMaps'),
37 electron_config = cms.PSet( ),
38 photon_config = cms.PSet( )
51 ele_RunIIIWinter22_iso_v1,
52 ele_RunIIIWinter22_noIso_v1
55 setup_mva(egamma_modifications[0].electron_config,
56 egamma_modifications[1].electron_config,
58 ele_mva_cff.mvaClassName + ele_mva_cff.mvaTag)
67 setup_mva(egamma_modifications[0].photon_config,
68 egamma_modifications[1].photon_config,
70 pho_mva_cff.mvaClassName + pho_mva_cff.mvaTag)
83 reducedEgammaEnergyScaleAndSmearingModifier = cms.PSet(
84 modifierName = cms.string(
'EGExtraInfoModifierFromFloatValueMaps'),
85 electron_config = cms.PSet(),
86 photon_config = cms.PSet()
88 from RecoEgamma.EgammaTools.calibratedEgammas_cff
import prefixName
89 import RecoEgamma.EgammaTools.calibratedElectronProducer_cfi
90 for valueMapName
in RecoEgamma.EgammaTools.calibratedElectronProducer_cfi.calibratedElectronProducer.valueMapsStored:
91 setattr(reducedEgammaEnergyScaleAndSmearingModifier.electron_config,valueMapName,cms.InputTag(
"reducedEgamma",
prefixName(
"calibEle",valueMapName)))
93 import RecoEgamma.EgammaTools.calibratedPhotonProducer_cfi
94 for valueMapName
in RecoEgamma.EgammaTools.calibratedPhotonProducer_cfi.calibratedPhotonProducer.valueMapsStored:
95 setattr(reducedEgammaEnergyScaleAndSmearingModifier.photon_config,valueMapName,cms.InputTag(
"reducedEgamma",
prefixName(
"calibPho",valueMapName)))
100 egamma8XObjectUpdateModifier = cms.PSet(
101 modifierName = cms.string(
'EG8XObjectUpdateModifier'),
102 ecalRecHitsEB = cms.InputTag(
"reducedEgamma",
"reducedEBRecHits"),
103 ecalRecHitsEE = cms.InputTag(
"reducedEgamma",
"reducedEERecHits"),
109 egamma9X105XUpdateModifier = cms.PSet(
110 modifierName = cms.string(
'EG9X105XObjectUpdateModifier'),
111 eleCollVMsAreKeyedTo = cms.InputTag(
"slimmedElectrons",processName=cms.InputTag.skipCurrentProcess()),
112 phoCollVMsAreKeyedTo = cms.InputTag(
"slimmedPhotons",processName=cms.InputTag.skipCurrentProcess()),
113 conversions = cms.InputTag(
"reducedEgamma",
"reducedConversions"),
114 beamspot = cms.InputTag(
"offlineBeamSpot"),
115 ecalRecHitsEB = cms.InputTag(
"reducedEgamma",
"reducedEBRecHits"),
116 ecalRecHitsEE = cms.InputTag(
"reducedEgamma",
"reducedEERecHits"),
117 eleTrkIso = cms.InputTag(
"heepIDVarValueMaps",
"eleTrkPtIso"),
118 eleTrkIso04 = cms.InputTag(
"heepIDVarValueMaps",
"eleTrkPtIso04"),
119 phoPhotonIso = cms.InputTag(
"photonIDValueMapProducer",
"phoPhotonIsolation"),
120 phoNeutralHadIso = cms.InputTag(
"photonIDValueMapProducer",
"phoNeutralHadronIsolation"),
121 phoChargedHadIso = cms.InputTag(
"photonIDValueMapProducer",
"phoChargedIsolation"),
122 phoChargedHadWorstVtxIso = cms.InputTag(
"photonIDValueMapProducer",
"phoWorstChargedIsolation"),
123 phoChargedHadWorstVtxConeVetoIso = cms.InputTag(
"photonIDValueMapProducer",
"phoWorstChargedIsolationConeVeto"),
124 phoChargedHadPFPVIso = cms.InputTag(
"egmPhotonIsolation",
"h+-DR030-"),
125 allowGsfTrackForConvs = cms.bool(
False),
126 updateChargedHadPFPVIso = cms.bool(
True)
134 from RecoEgamma.EgammaTools.calibratedEgammas_cff
import ecalTrkCombinationRegression
135 egamma8XLegacyEtScaleSysModifier = cms.PSet(
136 modifierName = cms.string(
'EGEtScaleSysModifier'),
137 epCombConfig = ecalTrkCombinationRegression,
138 uncertFunc = cms.PSet(
139 name = cms.string(
"UncertFuncV1"),
140 lowEt = cms.double(43.5),
141 highEt = cms.double(46.5),
142 lowEtUncert = cms.double(0.002),
143 highEtUncert = cms.double(-0.002)
148 egammaHIPhotonIsolationModifier = cms.PSet(
149 modifierName = cms.string(
'EGExtraInfoModifierFromHIPhotonIsolationValueMaps'),
150 electron_config = cms.PSet(),
151 photon_config = cms.PSet(
152 photonIsolationHI = cms.InputTag(
"reducedEgamma:photonIsolationHIProducerppGED")
156 photonDRNModifier = cms.PSet(
157 modifierName = cms.string(
"EGRegressionModifierDRN"),
158 patPhotons = cms.PSet(
159 source = cms.InputTag(
"selectedPatPhotons"),
160 correctionsSource = cms.InputTag(
'patPhotonsDRN'),
161 energyFloat = cms.string(
"energyDRN"),
162 resFloat = cms.string(
"resolutionDRN")
167 modifiers.append(reducedEgammaEnergyScaleAndSmearingModifier)
170 modifiers.insert(0,egamma8XObjectUpdateModifier)
173 modifiers.append(reducedEgammaEnergyScaleAndSmearingModifier)
174 modifiers.append(egamma8XLegacyEtScaleSysModifier)
177 modifiers.append(egammaHIPhotonIsolationModifier)
180 modifiers.append(photonDRNModifier)
182 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
183 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff
import run2_miniAOD_UL
184 (run2_miniAOD_94XFall17 | run2_miniAOD_UL).toModify(egamma_modifications,appendReducedEgammaEnergyScaleAndSmearingModifier)
186 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
188 run2_miniAOD_80XLegacy.toModify(egamma9X105XUpdateModifier,allowGsfTrackForConvs =
True)
189 run2_miniAOD_80XLegacy.toModify(egamma_modifications,appendEgamma8XLegacyAppendableModifiers)
190 run2_miniAOD_80XLegacy.toModify(egamma_modifications,prependEgamma8XObjectUpdateModifier)
192 from Configuration.ProcessModifiers.pp_on_AA_cff
import pp_on_AA
193 pp_on_AA.toModify(egamma_modifications, appendEgammaHIPhotonIsolationModifier)
195 from Configuration.ProcessModifiers.photonDRN_cff
import _photonDRN
196 _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)