Skip to content

Commit

Permalink
fix Puppi JEC/JER MET uncertainties
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu committed Aug 23, 2016
1 parent 22078f9 commit 6b2c1be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 0 additions & 1 deletion CommonTools/PileupAlgos/plugins/PuppiPhoton.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ void PuppiPhoton::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
if(pupCol->refAt(iPF).key() != *itPho) continue;
pWeight = weight_;
if(!useValueMap_ && itPF->pt() != 0) pWeight = pWeight*(phoCands[iPho]->pt()/itPF->pt());
//if(!useValueMap_ && itPF->pt() == 0) pVec.SetPxPyPzE(phoCands[iPho]->px()*pWeight,phoCands[iPho]->py()*pWeight,phoCands[iPho]->pz()*pWeight,phoCands[iPho]->energy()*pWeight);
foundPhoIndex.push_back(iPho); }
}

Expand Down
2 changes: 1 addition & 1 deletion CommonTools/PileupAlgos/python/Puppi_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
etaMin = cms.vdouble( 2.5, 3.0),
etaMax = cms.vdouble( 3.0, 10.0),
ptMin = cms.vdouble( 0.0, 0.0),
MinNeutralPt = cms.vdouble( 1.7, 2.0),
MinNeutralPt = cms.vdouble( 0.2, 2.0),
MinNeutralPtSlope = cms.vdouble(0.08, 0.07),
RMSEtaSF = cms.vdouble(1.20, 0.95),
MedEtaSF = cms.vdouble(0.90, 0.75),
Expand Down
4 changes: 2 additions & 2 deletions PhysicsTools/PatAlgos/test/corMETFromMiniAOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
### =====================================================================================================
# Define the input source
if runOnData:
fname = 'root://eoscms.cern.ch//store/relval/CMSSW_8_1_0_pre9/DoubleEG/MINIAOD/81X_dataRun2_relval_v2_RelVal_doubEG2015D-v1/10000/029C887F-2D53-E611-92EE-0CC47A74525A.root'
fname = 'root://eoscms.cern.ch//store/relval/CMSSW_8_1_0_pre10/DoubleEG/MINIAOD/81X_dataRun2_relval_v4_RelVal_doubEG2015D-v1/00000/88859857-6168-E611-9E79-0025905A60AA.root'
else:
fname = 'root://eoscms.cern.ch//store/relval/CMSSW_8_1_0_pre9/RelValTTbar_13/MINIAODSIM/PU25ns_81X_mcRun2_asymptotic_v2-v1/10000/8C46B127-3253-E611-BEBF-0025905A605E.root'
fname = 'root://eoscms.cern.ch//store/relval/CMSSW_8_1_0_pre10/RelValTTbar_13/MINIAODSIM/81X_mcRun2_asymptotic_v5_recycle-v1/00000/B49E8325-6E67-E611-BFE7-0025905A60D0.root'

# Define the input source
process.source = cms.Source("PoolSource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,11 @@ def createSmearedJetModule(self, process, jetCollection, smear, varyByNsigmas, v
enabled = cms.bool(smear),
variation = cms.int32( int(varyByNsigmas) ),
)


if self._parameters["Puppi"].value:
smearedJetModule.algo = cms.string('AK4PFPuppi')
smearedJetModule.algopt = cms.string('AK4PFPuppi_pt')

#MM: FIXME MVA
#if "MVA" == self._parameters["metType"].value:
# from RecoMET.METProducers.METSigParams_cfi import *
Expand Down Expand Up @@ -1403,13 +1407,17 @@ def ak4JetReclustering(self,process, pfCandCollection, patMetModuleSequence, pos
jetCorrections = ('AK4PF'+CHSname, corLevels , ''),
postfix=postfix
)

getattr(process,"patJets"+postfix).addGenJetMatch = False
getattr(process,"patJets"+postfix).addGenPartonMatch = False
getattr(process,"patJets"+postfix).addPartonJetMatch = False
getattr(process,"patJets"+postfix).embedGenPartonMatch = False
getattr(process,"patJets"+postfix).embedGenJetMatch = False
if self._parameters['onMiniAOD'].value:
del getattr(process,"patJets"+postfix).JetFlavourInfoSource
del getattr(process,"patJets"+postfix).JetPartonMapSource
del getattr(process,"patJets"+postfix).genPartonMatch
del getattr(process,"patJets"+postfix).genJetMatch
getattr(process,"patJets"+postfix).getJetMCFlavour = False

getattr(process,"patJetCorrFactors"+postfix).src=cms.InputTag(jetColName)
Expand Down Expand Up @@ -1507,6 +1515,8 @@ def jetConfiguration(self):
jetCorLabelL3ResName += "CHS"
elif "Puppi" in jetFlavor:
self.setParameter("CHS",False)
jetCorLabelUpToL3Name += "Puppi"
jetCorLabelL3ResName += "Puppi"

else:
self.setParameter("CHS",False)
Expand Down

0 comments on commit 6b2c1be

Please sign in to comment.