Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions python/EgammaPostRecoTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _isULDataformat():
print "EgammaPostRecoTools: Fall17V2 cut based Photons ID modules not found, running ID without them. If you want Fall17V2 CutBased Photon IDs, please merge the approprate PR\n 94X: git cms-merge-topic cms-egamma/EgammaID_949\n 102X: git cms-merge-topic cms-egamma/EgammaID_1023"

def _check_valid_era(era):
valid_eras = ['2017-Nov17ReReco','2016-Legacy','2016-Feb17ReMiniAOD','2018-Prompt','2017-UL']
valid_eras = ['2017-Nov17ReReco','2016-Legacy','2016-Feb17ReMiniAOD','2018-Prompt','2016-UL', '2017-UL', '2018-UL']
if era not in valid_eras:
raise RuntimeError('error, era {} not in list of allowed eras {}'.format(value,str(valid_eras)))
return True
Expand All @@ -95,9 +95,15 @@ def _getEnergyCorrectionFile(era):
if era=="2018-Prompt":
return "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_Step2Closure_CoarseEtaR9Gain_v2"
if era=="2017-UL":
raise RuntimeError('Error in postRecoEgammaTools, era 2017-UL does not yet have energy corrections, please contact the e/gamma pog for more information')
return "EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_24Feb2020_runEtaR9Gain_v2"

if era=="2016-UL" or era=="2018-UL":
raise RuntimeError('Error in postRecoEgammaTools, eras 2016-UL and 2018-UL are not yet have energy corrections, please contact the e/gamma pog for more information')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super minor but theres a typo here "do not" rather than "are not"


raise LogicError('Error in postRecoEgammaTools, era '+era+' not added to energy corrections function, please update this function')



def _isInputFrom80X(era):
_check_valid_era(era)
if era=="2016-Legacy" or era=="2016-Feb17ReMiniAOD": return True
Expand Down Expand Up @@ -309,6 +315,7 @@ def _setupEgammaEnergyCorrections(eleSrc,phoSrc,cfg):
eleCalibProd.correctionFile = energyCorrectionFile
phoCalibProd.correctionFile = energyCorrectionFile


if cfg.applyEPCombBug and hasattr(eleCalibProd,'useSmearCorrEcalEnergyErrInComb'):
eleCalibProd.useSmearCorrEcalEnergyErrInComb=True
elif hasattr(eleCalibProd,'useSmearCorrEcalEnergyErrInComb'):
Expand Down Expand Up @@ -533,8 +540,8 @@ def setupEgammaPostRecoSeq(process,
setupAllVIDIdsInModule(process,idmod,setupVIDPhotonSelection)

if autoAdjustParams:
if era=="2017-UL" and runEnergyCorrections:
print "EgammaPostRecoTools:INFO auto adjusting runEnergyCorrections to False as they are not yet availible for 2017-UL, set autoAdjustParams = False to force them to run"
if ((era=="2016-UL" or era=="2018-UL") and runEnergyCorrections):
print "EgammaPostRecoTools:INFO auto adjusting runEnergyCorrections to False as they are not yet availible for 2016-UL and 2018-UL, set autoAdjustParams = False to force them to run"
runEnergyCorrections = False


Expand Down