Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-18 23:27:10

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 _correctionFile2016Legacy    = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Legacy2016_07Aug2017_FineEtaR9_v3_ele_unc"
0004 _correctionFile2017Nov17     = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc"
0005 _correctionFile2016ULpreVFP  = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_preVFP_RunFineEtaR9Gain"
0006 _correctionFile2016ULpostVFP = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2016_UltraLegacy_postVFP_RunFineEtaR9Gain"
0007 _correctionFile2017UL        = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_24Feb2020_runEtaR9Gain_v2"
0008 _correctionFile2018UL        = "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_29Sep2020_RunFineEtaR9Gain"
0009 
0010 calibratedEgammaSettings = cms.PSet(minEtToCalibrate = cms.double(5.0),
0011                                     semiDeterministic = cms.bool(True),
0012                                     correctionFile = cms.string(_correctionFile2017UL),
0013                                     recHitCollectionEB = cms.InputTag('reducedEcalRecHitsEB'),
0014                                     recHitCollectionEE = cms.InputTag('reducedEcalRecHitsEE'),
0015                                     produceCalibratedObjs = cms.bool(True)
0016                                    )
0017 from Configuration.Eras.Modifier_run2_egamma_2016_cff import run2_egamma_2016
0018 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016
0019 (run2_egamma_2016 & tracker_apv_vfp30_2016).toModify(calibratedEgammaSettings,correctionFile = _correctionFile2016ULpreVFP)
0020 (run2_egamma_2016 & ~tracker_apv_vfp30_2016).toModify(calibratedEgammaSettings,correctionFile = _correctionFile2016ULpostVFP)
0021 
0022 
0023 from Configuration.Eras.Modifier_run2_egamma_2017_cff import run2_egamma_2017
0024 run2_egamma_2017.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2017UL)
0025 
0026 from Configuration.Eras.Modifier_run2_egamma_2018_cff import run2_egamma_2018
0027 run2_egamma_2018.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2018UL)
0028 
0029 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
0030 run2_miniAOD_80XLegacy.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2016Legacy)
0031 
0032 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff import run2_miniAOD_94XFall17
0033 run2_miniAOD_94XFall17.toModify(calibratedEgammaSettings,correctionFile = _correctionFile2017Nov17)
0034 
0035 calibratedEgammaPatSettings = calibratedEgammaSettings.clone(
0036     recHitCollectionEB = 'reducedEgamma:reducedEBRecHits',
0037     recHitCollectionEE = 'reducedEgamma:reducedEERecHits'
0038     )
0039 
0040 ecalTrkCombinationRegression = cms.PSet(
0041     ecalTrkRegressionConfig = cms.PSet(
0042         rangeMinLowEt = cms.double(-1.),
0043         rangeMaxLowEt = cms.double(3.0),
0044         rangeMinHighEt = cms.double(-1.),
0045         rangeMaxHighEt = cms.double(3.0),
0046         lowEtHighEtBoundary = cms.double(50.),
0047         forceHighEnergyTrainingIfSaturated = cms.bool(False),
0048         ebLowEtForestName = cms.ESInputTag('', 'electron_eb_ECALTRK_lowpt'),
0049         ebHighEtForestName = cms.ESInputTag('', 'electron_eb_ECALTRK'),
0050         eeLowEtForestName = cms.ESInputTag('', 'electron_ee_ECALTRK_lowpt'),
0051         eeHighEtForestName = cms.ESInputTag('', 'electron_ee_ECALTRK')
0052         ),
0053     ecalTrkRegressionUncertConfig = cms.PSet(
0054         rangeMinLowEt = cms.double(0.0002),
0055         rangeMaxLowEt = cms.double(0.5),
0056         rangeMinHighEt = cms.double(0.0002),
0057         rangeMaxHighEt = cms.double(0.5),
0058         lowEtHighEtBoundary = cms.double(50.),  
0059         forceHighEnergyTrainingIfSaturated = cms.bool(False),
0060         ebLowEtForestName = cms.ESInputTag('', 'electron_eb_ECALTRK_lowpt_var'),
0061         ebHighEtForestName = cms.ESInputTag('', 'electron_eb_ECALTRK_var'),
0062         eeLowEtForestName = cms.ESInputTag('', 'electron_ee_ECALTRK_lowpt_var'),
0063         eeHighEtForestName = cms.ESInputTag('', 'electron_ee_ECALTRK_var')
0064         ),
0065     maxEcalEnergyForComb=cms.double(200.),
0066     minEOverPForComb=cms.double(0.025),
0067     maxEPDiffInSigmaForComb=cms.double(15.),
0068     maxRelTrkMomErrForComb=cms.double(10.),
0069     
0070 )
0071 
0072 import RecoEgamma.EgammaTools.calibratedElectronProducer_cfi as _mod_ele
0073 import RecoEgamma.EgammaTools.calibratedPatElectronProducer_cfi as _mod_patele
0074 import RecoEgamma.EgammaTools.calibratedPhotonProducer_cfi as _mod_pho
0075 import RecoEgamma.EgammaTools.calibratedPatPhotonProducer_cfi as _mod_patpho
0076 
0077 calibratedElectrons = _mod_ele.calibratedElectronProducer.clone(
0078                                   calibratedEgammaSettings,                                   
0079                                   epCombConfig = ecalTrkCombinationRegression,
0080                                   src = 'gedGsfElectrons',
0081                                   )
0082 
0083 calibratedPatElectrons = _mod_patele.calibratedPatElectronProducer.clone(
0084                                   calibratedEgammaPatSettings,
0085                                   epCombConfig = ecalTrkCombinationRegression,
0086                                   src = 'slimmedElectrons', 
0087                                   )
0088 
0089 calibratedPhotons = _mod_pho.calibratedPhotonProducer.clone( 
0090                                    calibratedEgammaSettings,
0091                                    src = 'gedPhotons',    
0092                                   )
0093 
0094 calibratedPatPhotons = _mod_patpho.calibratedPatPhotonProducer.clone(
0095                                   calibratedEgammaPatSettings,
0096                                   src = 'slimmedPhotons',
0097                                   )
0098 
0099 def prefixName(prefix,name):
0100     return prefix+name[0].upper()+name[1:]
0101 
0102 
0103