Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77557
b: "refs/heads/CMSSW_7_1_X"
c: d21ddf3
h: "refs/heads/CMSSW_7_1_X"
i:
  77555: 4eae78c
v: v3
  • Loading branch information
Colin Bernet committed Nov 10, 2009
1 parent e11bc0f commit 0820138
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": 11c7551f5413449c426735028ea04bb0fdf9af76
"refs/heads/CMSSW_7_1_X": d21ddf35d85de040b726865341ce5e976671b732
33 changes: 24 additions & 9 deletions trunk/PhysicsTools/PatAlgos/python/tools/pfTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ def adaptPFElectrons(process,module):
def adaptPFPhotons(process,module):
raise RuntimeError, "Photons are not supported yet"

def adaptPFJets(process,module):
module.embedCaloTowers = False

from RecoTauTag.RecoTau.TauDiscriminatorTools import adaptTauDiscriminator, producerIsTauTypeMapper

def reconfigureLayer0Taus(process,
Expand Down Expand Up @@ -196,17 +193,35 @@ def switchToPFMET(process,input=cms.InputTag('pfMET')):
process.patDefaultSequence.remove(getattr(process, 'makeLayer1METs'))


def switchToPFJets(process,input=cms.InputTag('pfNoTau')):
print 'Jets: using ', input
def switchToPFJets(process,input=cms.InputTag('pfNoTau'), algo='IC5'):

print "Switching to PFJets, ", algo
print "************************ "

if( algo == 'IC5' ):
genJetCollectionName = 'iterativeCone5GenJetsNoNu'
elif algo == 'AK5':
genJetCollectionName = 'ak5GenJetsNoNu'
else:
print 'bad jet algorithm:', algo, '! for now, only IC5 and AK5 are allowed. If you need other algorithms, please contact Colin'
sys.exit(1)

# changing the jet collection in PF2PAT:
from PhysicsTools.PFCandProducer.Tools.jetTools import jetAlgo
process.allPfJets = jetAlgo( algo );

switchJetCollection(process,
input,
doJTA=True,
doBTagging=True,
jetCorrLabel=('IC5','PF'),
jetCorrLabel=( algo, 'PF' ),
genJetCollection = genJetCollectionName,
doType1MET=False)
adaptPFJets(process, process.allLayer1Jets)

def usePF2PAT(process,runPF2PAT=True):
process.allLayer1Jets.embedCaloTowers = False


def usePF2PAT(process,runPF2PAT=True, jetAlgo='IC5'):

# PLEASE DO NOT CLOBBER THIS FUNCTION WITH CODE SPECIFIC TO A GIVEN PHYSICS OBJECT.
# CREATE ADDITIONAL FUNCTIONS IF NEEDED.
Expand Down Expand Up @@ -240,7 +255,7 @@ def usePF2PAT(process,runPF2PAT=True):
process.patDefaultSequence.remove(process.patPhotonIsolation)

# Jets
switchToPFJets( process, cms.InputTag('pfNoTau') )
switchToPFJets( process, cms.InputTag('pfNoTau'), jetAlgo )

# Taus
#adaptPFTaus( process ) #default (i.e. shrinkingConePFTau)
Expand Down

0 comments on commit 0820138

Please sign in to comment.