1 import FWCore.ParameterSet.Config
as cms
3 _correctionFile2016Legacy =
"EgammaAnalysis/ElectronTools/data/ScalesSmearings/Legacy2016_07Aug2017_FineEtaR9_v3_ele_unc"
4 _correctionFile2017Nov17 =
"EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc"
5 _correctionFile2016ULpreVFP =
"EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_preVFP_RunFineEtaR9Gain"
6 _correctionFile2016ULpostVFP =
"EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_postVFP_RunFineEtaR9Gain"
7 _correctionFile2017UL =
"EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_24Feb2020_runEtaR9Gain_v2"
8 _correctionFile2018UL =
"EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_29Sep2020_RunFineEtaR9Gain"
10 calibratedEgammaSettings = cms.PSet(minEtToCalibrate = cms.double(5.0),
11 semiDeterministic = cms.bool(
True),
12 correctionFile = cms.string(_correctionFile2017UL),
13 recHitCollectionEB = cms.InputTag(
'reducedEcalRecHitsEB'),
14 recHitCollectionEE = cms.InputTag(
'reducedEcalRecHitsEE'),
15 produceCalibratedObjs = cms.bool(
True)
17 from Configuration.Eras.Modifier_run2_egamma_2016_cff
import run2_egamma_2016
18 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff
import tracker_apv_vfp30_2016
19 (run2_egamma_2016 & tracker_apv_vfp30_2016).toModify(calibratedEgammaSettings,correctionFile = _correctionFile2016ULpreVFP)
20 (run2_egamma_2016 & ~tracker_apv_vfp30_2016).toModify(calibratedEgammaSettings,correctionFile = _correctionFile2016ULpostVFP)
23 from Configuration.Eras.Modifier_run2_egamma_2017_cff
import run2_egamma_2017
24 run2_egamma_2017.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2017UL)
26 from Configuration.Eras.Modifier_run2_egamma_2018_cff
import run2_egamma_2018
27 run2_egamma_2018.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2018UL)
29 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff
import run2_miniAOD_80XLegacy
30 run2_miniAOD_80XLegacy.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2016Legacy)
32 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff
import run2_miniAOD_94XFall17
33 run2_miniAOD_94XFall17.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2017Nov17)
35 calibratedEgammaPatSettings = calibratedEgammaSettings.clone(
36 recHitCollectionEB =
'reducedEgamma:reducedEBRecHits',
37 recHitCollectionEE =
'reducedEgamma:reducedEERecHits'
40 ecalTrkCombinationRegression = cms.PSet(
41 ecalTrkRegressionConfig = cms.PSet(
42 rangeMinLowEt = cms.double(-1.),
43 rangeMaxLowEt = cms.double(3.0),
44 rangeMinHighEt = cms.double(-1.),
45 rangeMaxHighEt = cms.double(3.0),
46 lowEtHighEtBoundary = cms.double(50.),
47 forceHighEnergyTrainingIfSaturated = cms.bool(
False),
48 ebLowEtForestName = cms.ESInputTag(
'',
'electron_eb_ECALTRK_lowpt'),
49 ebHighEtForestName = cms.ESInputTag(
'',
'electron_eb_ECALTRK'),
50 eeLowEtForestName = cms.ESInputTag(
'',
'electron_ee_ECALTRK_lowpt'),
51 eeHighEtForestName = cms.ESInputTag(
'',
'electron_ee_ECALTRK')
53 ecalTrkRegressionUncertConfig = cms.PSet(
54 rangeMinLowEt = cms.double(0.0002),
55 rangeMaxLowEt = cms.double(0.5),
56 rangeMinHighEt = cms.double(0.0002),
57 rangeMaxHighEt = cms.double(0.5),
58 lowEtHighEtBoundary = cms.double(50.),
59 forceHighEnergyTrainingIfSaturated = cms.bool(
False),
60 ebLowEtForestName = cms.ESInputTag(
'',
'electron_eb_ECALTRK_lowpt_var'),
61 ebHighEtForestName = cms.ESInputTag(
'',
'electron_eb_ECALTRK_var'),
62 eeLowEtForestName = cms.ESInputTag(
'',
'electron_ee_ECALTRK_lowpt_var'),
63 eeHighEtForestName = cms.ESInputTag(
'',
'electron_ee_ECALTRK_var')
65 maxEcalEnergyForComb=cms.double(200.),
66 minEOverPForComb=cms.double(0.025),
67 maxEPDiffInSigmaForComb=cms.double(15.),
68 maxRelTrkMomErrForComb=cms.double(10.),
72 calibratedElectrons = cms.EDProducer(
"CalibratedElectronProducer",
73 calibratedEgammaSettings,
74 epCombConfig = ecalTrkCombinationRegression,
75 src = cms.InputTag(
'gedGsfElectrons'),
78 calibratedPatElectrons = cms.EDProducer(
"CalibratedPatElectronProducer",
79 calibratedEgammaPatSettings,
80 epCombConfig = ecalTrkCombinationRegression,
81 src = cms.InputTag(
'slimmedElectrons'),
84 calibratedPhotons = cms.EDProducer(
"CalibratedPhotonProducer",
85 calibratedEgammaSettings,
86 src = cms.InputTag(
'gedPhotons'),
88 calibratedPatPhotons = cms.EDProducer(
"CalibratedPatPhotonProducer",
89 calibratedEgammaPatSettings,
90 src = cms.InputTag(
'slimmedPhotons'),
94 return prefix+name[0].
upper()+name[1:]