CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/PhysicsTools/PFCandProducer/python/pfTaus_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 from RecoTauTag.Configuration.RecoPFTauTag_cff import *
00004 from RecoTauTag.TauTagTools.PFTauSelector_cfi  import pfTauSelector
00005 
00006 from PhysicsTools.PFCandProducer.pfJets_cff import pfJets
00007 
00008 ''' 
00009 
00010 pfTaus_cff
00011 
00012 Specify the prototype/default Configuration of 'pfTaus', which is a selected
00013 collection of taus that is used as an input to the 'patTaus'. The pf2pat tau
00014 selection is constructed by:
00015     * Rerunning a tau algorithm (fixedConePFTaus, shrinkingConePFTaus, etc)
00016     * Cloning and running a set of discriminants for this algorithm so they are
00017       independent of other cfis
00018     * Constructing pfTaus via a PFTauSelector using the cloned discriminants
00019     * In PhysicsTools.PatAlgos.tools.pfTools the regular discriminants are
00020       modified to take the pfTaus as input.  The original discriminant
00021       labels are kept (i.e. fixedConePFTauDiscriminationByIsolation) but the Tau
00022       source is defined as pfTaus
00023 
00024 '''
00025 
00026 # Clone tau producer
00027 pfTausProducer = shrinkingConePFTauProducer.clone()
00028 
00029 # The isolation discriminator requires this as prediscriminant, 
00030 # as all sensical taus must have at least one track
00031 pfTausDiscriminationByLeadingTrackFinding = \
00032     shrinkingConePFTauDiscriminationByLeadingTrackFinding.clone()
00033 pfTausDiscriminationByLeadingTrackFinding.PFTauProducer = "pfTausProducer"
00034 
00035 # The actual selections on pfTaus
00036 pfTausDiscriminationByLeadingPionPtCut = \
00037     shrinkingConePFTauDiscriminationByLeadingPionPtCut.clone()
00038 pfTausDiscriminationByLeadingPionPtCut.PFTauProducer = "pfTausProducer"
00039 
00040 pfTausDiscriminationByIsolation = \
00041     shrinkingConePFTauDiscriminationByIsolation.clone()
00042 pfTausDiscriminationByIsolation.Prediscriminants.leadTrack.Producer = \
00043     "pfTausDiscriminationByLeadingTrackFinding"
00044 pfTausDiscriminationByIsolation.PFTauProducer = "pfTausProducer"
00045 
00046 # Sequence to reproduce taus and compute our cloned discriminants
00047 pfTausBaseSequence = cms.Sequence(
00048     pfTausProducer +
00049     pfTausDiscriminationByLeadingTrackFinding +
00050     pfTausDiscriminationByLeadingPionPtCut +
00051     pfTausDiscriminationByIsolation
00052     )
00053 
00054 # Associate track to pfJets
00055 from RecoJets.JetAssociationProducers.j2tParametersVX_cfi import *
00056 pfJetTracksAssociatorAtVertex = cms.EDProducer(
00057     "JetTracksAssociatorAtVertex",
00058     j2tParametersVX,
00059     jets = cms.InputTag("pfJets")
00060     )
00061 pfTausProducer.jetSrc = pfJetTracksAssociatorAtVertex.jets
00062 # is it correct collection w/o good leptons
00063 pfTausProducer.builders[0].pfCandSrc = pfJets.src
00064 
00065 # PiZeroProducers
00066 pfJetsPiZeros = ak5PFJetsRecoTauPiZeros.clone()
00067 pfJetsLegacyTaNCPiZeros = ak5PFJetsLegacyTaNCPiZeros.clone()
00068 pfJetsLegacyHPSPiZeros = ak5PFJetsLegacyHPSPiZeros.clone()
00069 
00070 pfJetsPiZeros.src = pfJetTracksAssociatorAtVertex.jets
00071 pfJetsLegacyTaNCPiZeros.src = pfJetTracksAssociatorAtVertex.jets
00072 pfJetsLegacyHPSPiZeros.src = pfJetTracksAssociatorAtVertex.jets
00073 
00074 
00075 pfTauTagInfoProducer = pfRecoTauTagInfoProducer.clone()
00076 pfTauTagInfoProducer.PFCandidateProducer = pfJets.src
00077 pfTauTagInfoProducer.PFJetTracksAssociatorProducer = 'pfJetTracksAssociatorAtVertex'
00078 
00079 pfTausProducer.modifiers[1] = cms.PSet(
00080     name = cms.string("pfTauTTIworkaround"),
00081     plugin = cms.string("RecoTauTagInfoWorkaroundModifer"),
00082     pfTauTagInfoSrc = cms.InputTag("pfTauTagInfoProducer"),
00083 )
00084 
00085 pfTausPreSequence = cms.Sequence(
00086     pfJetTracksAssociatorAtVertex + 
00087     pfTauTagInfoProducer +
00088     pfJetsPiZeros +
00089     pfJetsLegacyTaNCPiZeros +
00090     pfJetsLegacyHPSPiZeros
00091 )
00092 
00093 # Select taus from given collection that pass cloned discriminants
00094 pfTaus = pfTauSelector.clone()
00095 pfTaus.src = cms.InputTag("pfTausProducer")
00096 pfTaus.discriminators = cms.VPSet(
00097     cms.PSet( discriminator=cms.InputTag("pfTausDiscriminationByLeadingPionPtCut"),selectionCut=cms.double(0.5) ),
00098     cms.PSet( discriminator=cms.InputTag("pfTausDiscriminationByIsolation"),selectionCut=cms.double(0.5) )
00099     )
00100 
00101 pfTauSequence = cms.Sequence(
00102     pfTausPreSequence +
00103     pfTausBaseSequence + 
00104     pfTaus 
00105     )
00106 
00107