Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:07

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 def enablePileUpCorrectionInPF2PAT( process, postfix, sequence='PF2PAT'):
0004     """
0005     Modifies the PF2PAT sequence according to the recipe of JetMET:
0006     """
0007 
0008     # pile up subtraction
0009     getattr(process,"pfNoPileUp"+postfix).enable = True 
0010     getattr(process,"pfPileUp"+postfix).enable = True 
0011     getattr(process,"pfPileUp"+postfix).checkClosestZVertex = False 
0012     getattr(process,"pfPileUp"+postfix).Vertices = 'goodOfflinePrimaryVertices'
0013 
0014     getattr(process,"pfJets"+postfix).doAreaFastjet = True
0015     getattr(process,"pfJets"+postfix).doRhoFastjet = False
0016         
0017     # adding goodOfflinePrimaryVertices before pfPileUp
0018     process.load('CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi')   
0019     getattr(process, 'pfNoPileUpSequence'+postfix).replace( getattr(process,"pfPileUp"+postfix),
0020                                                             process.goodOfflinePrimaryVertices +
0021                                                             getattr(process,"pfPileUp"+postfix) )
0022     
0023 def enablePileUpCorrectionInPAT( process, postfix, sequence ):
0024     # PAT specific stuff:
0025 
0026     jetCorrFactors = getattr(process,"patJetCorrFactors"+postfix)
0027     # using non-pileup-charged-hadron-substracted kt6PFJets consistently with JetMET recommendation
0028     jetCorrFactors.rho = cms.InputTag("fixedGridRhoFastjetAll")
0029 
0030 
0031 def enablePileUpCorrection( process, postfix, sequence='patPF2PATSequence'):
0032     """
0033     Enables the pile-up correction for jets in a PF2PAT+PAT sequence
0034     to be called after the usePF2PAT function.
0035     """
0036 
0037     enablePileUpCorrectionInPF2PAT( process, postfix, sequence)
0038     enablePileUpCorrectionInPAT( process, postfix, sequence)
0039 
0040