1 import FWCore.ParameterSet.Config
as cms
9 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_GeneralPurpose_V1_cff
as ele_spring16_gp_v1
10 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Spring16_HZZ_V1_cff
as ele_spring16_hzz_v1
11 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_iso_V1_cff
as ele_fall17_iso_v1
12 import RecoEgamma.ElectronIdentification.Identification.mvaElectronID_Fall17_noIso_V1_cff
as ele_fall17_noIso_v1
17 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( phoChargedIsolation = cms.InputTag(
'photonIDValueMapProducer:phoChargedIsolation'),
35 phoNeutralHadronIsolation = cms.InputTag(
'photonIDValueMapProducer:phoNeutralHadronIsolation'),
36 phoPhotonIsolation = cms.InputTag(
'photonIDValueMapProducer:phoPhotonIsolation'),
37 phoWorstChargedIsolation = cms.InputTag(
'photonIDValueMapProducer:phoWorstChargedIsolation')
40 cms.PSet( modifierName = cms.string(
'EGExtraInfoModifierFromIntValueMaps'),
41 electron_config = cms.PSet( ),
42 photon_config = cms.PSet( )
47 setup_mva(egamma_modifications[0].electron_config,
48 egamma_modifications[1].electron_config,
50 ele_spring15_nt.mvaSpring15NonTrigClassName+ele_spring15_nt.mvaTag)
52 setup_mva(egamma_modifications[0].electron_config,
53 egamma_modifications[1].electron_config,
55 ele_spring15_50_t.mvaSpring15TrigClassName+ele_spring15_50_t.mvaTag)
57 setup_mva(egamma_modifications[0].electron_config,
58 egamma_modifications[1].electron_config,
60 ele_spring15_25_t.mvaSpring15TrigClassName+ele_spring15_25_t.mvaTag)
62 setup_mva(egamma_modifications[0].electron_config,
63 egamma_modifications[1].electron_config,
65 ele_spring16_gp_v1.mvaSpring16ClassName+ele_spring16_gp_v1.mvaTag)
67 setup_mva(egamma_modifications[0].electron_config,
68 egamma_modifications[1].electron_config,
70 ele_spring16_hzz_v1.mvaSpring16ClassName+ele_spring16_hzz_v1.mvaTag)
72 setup_mva(egamma_modifications[0].electron_config,
73 egamma_modifications[1].electron_config,
75 ele_fall17_iso_v1.mvaFall17ClassName+ele_fall17_iso_v1.mvaTag)
77 setup_mva(egamma_modifications[0].electron_config,
78 egamma_modifications[1].electron_config,
80 ele_fall17_noIso_v1.mvaFall17ClassName+ele_fall17_noIso_v1.mvaTag)
82 setup_mva(egamma_modifications[0].photon_config,
83 egamma_modifications[1].photon_config,
85 pho_spring15_25_nt.mvaSpring15NonTrigClassName+pho_spring15_25_nt.mvaTag)
87 setup_mva(egamma_modifications[0].photon_config,
88 egamma_modifications[1].photon_config,
90 pho_spring15_50_nt.mvaSpring15NonTrigClassName+pho_spring15_50_nt.mvaTag)
92 setup_mva(egamma_modifications[0].photon_config,
93 egamma_modifications[1].photon_config,
95 pho_spring16_nt_v1.mvaSpring16NonTrigClassName+pho_spring16_nt_v1.mvaTag)
97 setup_mva(egamma_modifications[0].photon_config,
98 egamma_modifications[1].photon_config,
100 pho_fall17_94X_v1.mvaFall17v1ClassName+pho_fall17_94X_v1.mvaTag)
102 setup_mva(egamma_modifications[0].photon_config,
103 egamma_modifications[1].photon_config,
105 pho_fall17_94X_v1p1.mvaFall17v1p1ClassName+pho_fall17_94X_v1p1.mvaTag)
118 reducedEgammaEnergyScaleAndSmearingModifier = cms.PSet(
119 modifierName = cms.string(
'EGExtraInfoModifierFromFloatValueMaps'),
120 electron_config = cms.PSet(),
121 photon_config = cms.PSet()
123 from RecoEgamma.EgammaTools.calibratedEgammas_cff
import prefixName
124 import RecoEgamma.EgammaTools.calibratedElectronProducerTRecoGsfElectron_cfi
125 for valueMapName
in RecoEgamma.EgammaTools.calibratedElectronProducerTRecoGsfElectron_cfi.calibratedElectronProducerTRecoGsfElectron.valueMapsStored:
126 setattr(reducedEgammaEnergyScaleAndSmearingModifier.electron_config,valueMapName,cms.InputTag(
"reducedEgamma",
prefixName(
"calibEle",valueMapName)))
128 import RecoEgamma.EgammaTools.calibratedPhotonProducerTRecoPhoton_cfi
129 for valueMapName
in RecoEgamma.EgammaTools.calibratedPhotonProducerTRecoPhoton_cfi.calibratedPhotonProducerTRecoPhoton.valueMapsStored:
130 setattr(reducedEgammaEnergyScaleAndSmearingModifier.photon_config,valueMapName,cms.InputTag(
"reducedEgamma",
prefixName(
"calibPho",valueMapName)))
135 egamma8XObjectUpdateModifier = cms.PSet(
136 modifierName = cms.string(
'EG8XObjectUpdateModifier'),
137 ecalRecHitsEB = cms.InputTag(
"reducedEgamma",
"reducedEBRecHits"),
138 ecalRecHitsEE = cms.InputTag(
"reducedEgamma",
"reducedEERecHits"),
146 from RecoEgamma.EgammaTools.calibratedEgammas_cff
import ecalTrkCombinationRegression
147 egamma8XLegacyEtScaleSysModifier = cms.PSet(
148 modifierName = cms.string(
'EGEtScaleSysModifier'),
149 epCombConfig = ecalTrkCombinationRegression,
150 uncertFunc = cms.PSet(
151 name = cms.string(
"UncertFuncV1"),
152 lowEt = cms.double(43.5),
153 highEt = cms.double(46.5),
154 lowEtUncert = cms.double(0.002),
155 highEtUncert = cms.double(-0.002)
160 modifiers.append(reducedEgammaEnergyScaleAndSmearingModifier)
163 modifiers.insert(0,egamma8XObjectUpdateModifier)
166 modifiers.append(reducedEgammaEnergyScaleAndSmearingModifier)
167 modifiers.append(egamma8XLegacyEtScaleSysModifier)
169 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
170 run2_miniAOD_94XFall17.toModify(egamma_modifications,appendReducedEgammaEnergyScaleAndSmearingModifier)
172 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
173 run2_miniAOD_80XLegacy.toModify(egamma_modifications,appendEgamma8XLegacyAppendableModifiers)
174 run2_miniAOD_80XLegacy.toModify(egamma_modifications,prependEgamma8XObjectUpdateModifier)
def prependEgamma8XObjectUpdateModifier(modifiers)
def appendEgamma8XLegacyAppendableModifiers(modifiers)
def appendReducedEgammaEnergyScaleAndSmearingModifier(modifiers)
def prefixName(prefix, name)
def setup_mva(val_pset, cat_pset, prod_name, mva_name)