Beispiel #1
0
def adaptSelectedPFJetForHPSTau(process, jetSelection="", postfix=""):
    print "Preselecting the jets used to make taus : " + jetSelection
    process.pfJetsForHPSTau = selectedPfJets.clone()
    process.pfJetsForHPSTau.src = "pfJets" + postfix
    process.pfJetsForHPSTau.cut = cms.string(jetSelection)
    setattr(process, "pfJetsForHPSTau" + postfix, process.pfJetsForHPSTau)
    getattr(process, "pfTausPreSequence" + postfix).insert(
        0, getattr(process, "pfJetsForHPSTau" + postfix))
    applyPostfix(process, "pfTausBase",
                 postfix).jetSrc = "pfJetsForHPSTau" + postfix
    # need to fix the tau presequence because it depends on the new jet collection
    applyPostfix(process, "pfJetTracksAssociatorAtVertex",
                 postfix).jets = "pfJetsForHPSTau" + postfix
    applyPostfix(process, "pfTauPFJets08Region",
                 postfix).src = "pfJetsForHPSTau" + postfix
    applyPostfix(process, "pfJetsPiZeros",
                 postfix).jetSrc = "pfJetsForHPSTau" + postfix
    applyPostfix(process, "pfJetsLegacyTaNCPiZeros",
                 postfix).jetSrc = "pfJetsForHPSTau" + postfix
    applyPostfix(process, "pfJetsLegacyHPSPiZeros",
                 postfix).jetSrc = "pfJetsForHPSTau" + postfix
    # fix because the TopProjection in pfNoTau does not work because the taus come from the selected jets
    applyPostfix(process, "pfNoTau",
                 postfix).bottomCollection = "pfJetsForHPSTau" + postfix
    # must use the pfJets for the patJets otherwise we will have the above selection on the pfJetsForHPSTau ( pfNoTau is a jet collection)
    print 'Warning!!!!!!!!!!!!!: switching patJet.jetSource from pfNoTau to pfJets because Tau cleaning on the jets cannot be applied currently'
    applyPostfix(process, "patJets", postfix).jetSource = "pfJets" + postfix
Beispiel #2
0
def adaptSelectedPFJetForHPSTau(process,
                                jetSelection = "",
                                postfix = ""):
    print "Preselecting the jets used to make taus : "+jetSelection
    process.pfJetsForHPSTau = selectedPfJets.clone()
    process.pfJetsForHPSTau.src = "pfJets"+postfix
    process.pfJetsForHPSTau.cut = cms.string(jetSelection)
    setattr(process,"pfJetsForHPSTau"+postfix, process.pfJetsForHPSTau)
    getattr(process,"pfTausPreSequence"+postfix).insert(0,getattr(process,"pfJetsForHPSTau"+postfix))
    applyPostfix(process,"pfTausBase",postfix).jetSrc = "pfJetsForHPSTau"+postfix
    # need to fix the tau presequence because it depends on the new jet collection
    applyPostfix(process,"pfJetTracksAssociatorAtVertex",postfix).jets = "pfJetsForHPSTau"+postfix
    applyPostfix(process,"pfTauPFJets08Region",postfix).src = "pfJetsForHPSTau"+postfix
    applyPostfix(process,"pfJetsPiZeros",postfix).jetSrc = "pfJetsForHPSTau"+postfix
    applyPostfix(process,"pfJetsLegacyTaNCPiZeros",postfix).jetSrc = "pfJetsForHPSTau"+postfix
    applyPostfix(process,"pfJetsLegacyHPSPiZeros",postfix).jetSrc = "pfJetsForHPSTau"+postfix
    # fix because the TopProjection in pfNoTau does not work because the taus come from the selected jets
    applyPostfix(process,"pfNoTau",postfix).bottomCollection = "pfJetsForHPSTau"+postfix
    # must use the pfJets for the patJets otherwise we will have the above selection on the pfJetsForHPSTau ( pfNoTau is a jet collection)
    print 'Warning!!!!!!!!!!!!!: switching patJet.jetSource from pfNoTau to pfJets because Tau cleaning on the jets cannot be applied currently'
    applyPostfix(process,"patJets",postfix).jetSource = "pfJets"+postfix
Beispiel #3
0
import FWCore.ParameterSet.Config as cms

# from PhysicsTools.PatAlgos.patSequences_cff import *
from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff import *
from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets

from CommonTools.ParticleFlow.ParticleSelectors.genericPFJetSelector_cfi import selectedPfJets

#FIXME: is this cut really necessary? does it play well with Phil's stuff?
# NOTE cutting on uncorrected jets, but no bias for corrected jet pT>7
ak5PFJetsSel = selectedPfJets.clone( src = 'ak5PFJets',
                                     cut = 'pt()>0 && abs(eta())<5.0' )

jetSource = 'ak5PFJetsSel'

# corrections 
from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import *
patJetCorrFactors.src = jetSource
# will need to add L2L3 corrections in the cfg
patJetCorrFactors.levels = ['L1FastJet', 'L2Relative', 'L3Absolute']
patJetCorrFactors.payload = 'AK5PF'
patJetCorrFactors.useRho = True

patJets.jetSource = jetSource
patJets.addJetCharge = False
patJets.embedCaloTowers = False
patJets.embedPFCandidates = False
patJets.addAssociatedTracks = False

# b tagging 
from RecoJets.JetAssociationProducers.ak5JTA_cff import *
Beispiel #4
0
# from PhysicsTools.PatAlgos.patSequences_cff import *
from CMGTools.Common.Tools.cmsswRelease import isNewerThan

from PhysicsTools.PatAlgos.producersLayer1.tauProducer_cff import *
from PhysicsTools.PatAlgos.selectionLayer1.tauSelector_cfi import selectedPatTaus

from RecoTauTag.Configuration.RecoPFTauTag_cff import *
PFTau.remove(recoTauClassicShrinkingConeSequence)
PFTau.remove(recoTauClassicShrinkingConeMVASequence)
PFTau.remove(recoTauHPSTancSequence)

# will insert a jet selector before tau ID to speed up processing
from CommonTools.ParticleFlow.ParticleSelectors.genericPFJetSelector_cfi import selectedPfJets
jetSelectionForTaus = 'pt()>15.0 && abs(eta())<3.0'
pfJetsForHPSTau = selectedPfJets.clone(src='ak5PFJets',
                                       cut=jetSelectionForTaus)
# from CMGTools.Common.Tools.visitorUtils import replaceSrc
# replaceSrc( PFTau, 'ak5PFJets', 'pfJetsForHPSTau')
tauSource = 'pfJetsForHPSTau'
recoTauAK5PFJets08Region.src = tauSource  #NOTE this guy has a pfSrc
ak5PFJetTracksAssociatorAtVertex.jets = tauSource
ak5PFJetsLegacyHPSPiZeros.jetSrc = tauSource
combinatoricRecoTaus.jetSrc = tauSource
tauMatch.src = 'hpsPFTauProducer'
tauGenJetMatch.src = 'hpsPFTauProducer'

tauIsoDepositPFCandidates.ExtractorPSet.tauSource = 'hpsPFTauProducer'
tauIsoDepositPFCandidates.src = 'hpsPFTauProducer'
tauIsoDepositPFChargedHadrons.ExtractorPSet.tauSource = 'hpsPFTauProducer'
tauIsoDepositPFChargedHadrons.src = 'hpsPFTauProducer'
tauIsoDepositPFNeutralHadrons.ExtractorPSet.tauSource = 'hpsPFTauProducer'
Beispiel #5
0
import FWCore.ParameterSet.Config as cms

# from PhysicsTools.PatAlgos.patSequences_cff import *
from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff import *
from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets

from CommonTools.ParticleFlow.ParticleSelectors.genericPFJetSelector_cfi import selectedPfJets

#FIXME: is this cut really necessary? does it play well with Phil's stuff?
# NOTE cutting on uncorrected jets, but no bias for corrected jet pT>7
ak5PFJetsSel = selectedPfJets.clone( src = 'ak5PFJets',
                                     cut = 'pt()>0 && abs(eta())<5.0' )

jetSource = 'ak5PFJetsSel'

# corrections 
from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import *
patJetCorrFactors.src = jetSource
# will need to add L2L3 corrections in the cfg
patJetCorrFactors.levels = ['L1FastJet', 'L2Relative', 'L3Absolute']
patJetCorrFactors.payload = 'AK5PF'
patJetCorrFactors.useRho = True

patJets.jetSource = jetSource
patJets.addJetCharge = False
patJets.embedCaloTowers = False
patJets.embedPFCandidates = False
patJets.addAssociatedTracks = False

# b tagging 
from RecoJets.JetAssociationProducers.ak5JTA_cff import *
Beispiel #6
0
import FWCore.ParameterSet.Config as cms

from CommonTools.ParticleFlow.ParticleSelectors.genericPFJetSelector_cfi import selectedPfJets 

pfJetSource = 'ak5PFJets'

# selects jets with pt>30 and a neutral hadron fraction
# larger than 90% (fake deposit in HCAL)
pfJetNeutralHadFracGT90 = selectedPfJets.clone( src = pfJetSource,
                                          cut='pt()>30 && neutralHadronEnergyFraction()>0.90' )

# selects jets with pt>30 and a neutral hadron fraction
# larger than 90% (fake deposit in ECAL, or photon)
pfJetPhotonFracGT95 = selectedPfJets.clone( src = pfJetSource,
                                      cut='pt()>30 && photonEnergyFraction()>0.95' )

# select the bad jets
PBNRJetIdSequence = cms.Sequence(
    pfJetNeutralHadFracGT90 +
    pfJetPhotonFracGT95
    )

pfJetNeutralHadFracGT90Count = cms.EDFilter(
    "CandViewCountFilter",
    src = cms.InputTag("pfJetNeutralHadFracGT90"),
    minNumber = cms.uint32(1)
    )

pfJetPhotonFracGT95Count = cms.EDFilter(
    "CandViewCountFilter",
    src = cms.InputTag("pfJetPhotonFracGT95"),
# from PhysicsTools.PatAlgos.patSequences_cff import *
from CMGTools.Common.Tools.cmsswRelease import isNewerThan

from PhysicsTools.PatAlgos.producersLayer1.tauProducer_cff import *
from PhysicsTools.PatAlgos.selectionLayer1.tauSelector_cfi import selectedPatTaus

from RecoTauTag.Configuration.RecoPFTauTag_cff import *
PFTau.remove( recoTauClassicShrinkingConeSequence )
PFTau.remove( recoTauClassicShrinkingConeMVASequence )
PFTau.remove( recoTauHPSTancSequence )

# will insert a jet selector before tau ID to speed up processing
from CommonTools.ParticleFlow.ParticleSelectors.genericPFJetSelector_cfi import selectedPfJets
jetSelectionForTaus = 'pt()>15.0 && abs(eta())<3.0'
pfJetsForHPSTau = selectedPfJets.clone( src = 'ak5PFJets',
                                        cut = jetSelectionForTaus )
# from CMGTools.Common.Tools.visitorUtils import replaceSrc
# replaceSrc( PFTau, 'ak5PFJets', 'pfJetsForHPSTau')
tauSource =  'pfJetsForHPSTau'
recoTauAK5PFJets08Region.src = tauSource #NOTE this guy has a pfSrc
ak5PFJetTracksAssociatorAtVertex.jets = tauSource
ak5PFJetsLegacyHPSPiZeros.jetSrc = tauSource
combinatoricRecoTaus.jetSrc = tauSource
tauMatch.src = 'hpsPFTauProducer'
tauGenJetMatch.src = 'hpsPFTauProducer'

tauIsoDepositPFCandidates.ExtractorPSet.tauSource = 'hpsPFTauProducer'
tauIsoDepositPFCandidates.src = 'hpsPFTauProducer'
tauIsoDepositPFChargedHadrons.ExtractorPSet.tauSource = 'hpsPFTauProducer'
tauIsoDepositPFChargedHadrons.src = 'hpsPFTauProducer'
tauIsoDepositPFNeutralHadrons.ExtractorPSet.tauSource = 'hpsPFTauProducer'