CMS 3D CMS Logo

calibratedEgammas_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 _correctionFile2016Legacy = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Legacy2016_07Aug2017_FineEtaR9_v3_ele_unc"
4 _correctionFile2017Nov17 = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc"
5 
6 calibratedEgammaSettings = cms.PSet(minEtToCalibrate = cms.double(5.0),
7  semiDeterministic = cms.bool(True),
8  correctionFile = cms.string(_correctionFile2017Nov17),
9  recHitCollectionEB = cms.InputTag('reducedEcalRecHitsEB'),
10  recHitCollectionEE = cms.InputTag('reducedEcalRecHitsEE'),
11  produceCalibratedObjs = cms.bool(True)
12  )
13 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
14 run2_miniAOD_80XLegacy.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2016Legacy)
15 
16 calibratedEgammaPatSettings = calibratedEgammaSettings.clone(
17  recHitCollectionEB = cms.InputTag('reducedEgamma','reducedEBRecHits'),
18  recHitCollectionEE = cms.InputTag('reducedEgamma','reducedEERecHits')
19  )
20 
21 ecalTrkCombinationRegression = cms.PSet(
22  ecalTrkRegressionConfig = cms.PSet(
23  rangeMin = cms.double(-1.),
24  rangeMax = cms.double(3.0),
25  lowEtHighEtBoundary = cms.double(50.),
26  forceHighEnergyTrainingIfSaturated = cms.bool(False),
27  ebLowEtForestName = cms.string('electron_eb_ECALTRK_lowpt'),
28  ebHighEtForestName = cms.string('electron_eb_ECALTRK'),
29  eeLowEtForestName = cms.string('electron_ee_ECALTRK_lowpt'),
30  eeHighEtForestName = cms.string('electron_ee_ECALTRK')
31  ),
32  ecalTrkRegressionUncertConfig = cms.PSet(
33  rangeMin = cms.double(0.0002),
34  rangeMax = cms.double(0.5),
35  lowEtHighEtBoundary = cms.double(50.),
36  forceHighEnergyTrainingIfSaturated = cms.bool(False),
37  ebLowEtForestName = cms.string('electron_eb_ECALTRK_lowpt_var'),
38  ebHighEtForestName = cms.string('electron_eb_ECALTRK_var'),
39  eeLowEtForestName = cms.string('electron_ee_ECALTRK_lowpt_var'),
40  eeHighEtForestName = cms.string('electron_ee_ECALTRK_var')
41  ),
42  maxEcalEnergyForComb=cms.double(200.),
43  minEOverPForComb=cms.double(0.025),
44  maxEPDiffInSigmaForComb=cms.double(15.),
45  maxRelTrkMomErrForComb=cms.double(10.),
46 
47 )
48 
49 #a bug was found, the smear corrected ecal energy err was used in the E/p combination
50 #as the campaign has already started, we can not change the default nor the behaviour for the 94X Fall17 reminiAOD
51 #therefore we set useSmearCorrEcalEnergyErrInComb = cms.bool(True) when it should be set to false
52 #make no mistake, this is an incorrect configuration which will cause a scale shift at Et = 50 GeV
53 calibratedElectrons = cms.EDProducer("CalibratedElectronProducer",
54  calibratedEgammaSettings,
55  useSmearCorrEcalEnergyErrInComb = cms.bool(True),
56  epCombConfig = ecalTrkCombinationRegression,
57  src = cms.InputTag('gedGsfElectrons'),
58  )
59 
60 calibratedPatElectrons = cms.EDProducer("CalibratedPatElectronProducer",
61  calibratedEgammaPatSettings,
62  useSmearCorrEcalEnergyErrInComb = cms.bool(True),
63  epCombConfig = ecalTrkCombinationRegression,
64  src = cms.InputTag('slimmedElectrons'),
65  )
66 #the 80XLegacy miniAOD had not started, hence we can fix it for that
67 run2_miniAOD_80XLegacy.toModify(calibratedElectrons,useSmearCorrEcalEnergyErrInComb = False)
68 run2_miniAOD_80XLegacy.toModify(calibratedPatElectrons,useSmearCorrEcalEnergyErrInComb = False)
69 
70 
71 
72 calibratedPhotons = cms.EDProducer("CalibratedPhotonProducer",
73  calibratedEgammaSettings,
74  src = cms.InputTag('gedPhotons'),
75  )
76 calibratedPatPhotons = cms.EDProducer("CalibratedPatPhotonProducer",
77  calibratedEgammaPatSettings,
78  src = cms.InputTag('slimmedPhotons'),
79  )
80 
81 def prefixName(prefix,name):
82  return prefix+name[0].upper()+name[1:]
83 
84 
85 
def prefixName(prefix, name)