CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CommonTools/ParticleFlow/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 CommonTools.ParticleFlow.pfJets_cff import pfJets
00007 from RecoJets.JetProducers.ak5PFJets_cfi import ak5PFJets
00008 
00009 ''' 
00010 
00011 pfTaus_cff
00012 
00013 Specify the prototype/default Configuration of 'pfTaus', which is a selected
00014 collection of taus that is used as an input to the 'patTaus'. The pf2pat tau
00015 selection is constructed by:
00016     * Rerunning a tau algorithm (fixedConePFTaus, shrinkingConePFTaus, etc)
00017     * Cloning and running a set of discriminants for this algorithm so they are
00018       independent of other cfis
00019     * Constructing pfTaus via a PFTauSelector using the cloned discriminants
00020     * In PhysicsTools.PatAlgos.tools.pfTools the regular discriminants are
00021       modified to take the pfTaus as input.  The original discriminant
00022       labels are kept (i.e. fixedConePFTauDiscriminationByIsolation) but the Tau
00023       source is defined as pfTaus
00024 
00025 '''
00026 
00027 # Clone tau producer
00028 pfTausProducerSansRefs = shrinkingConePFTauProducerSansRefs.clone()
00029 pfTausProducer = shrinkingConePFTauProducer.clone()
00030 pfTausProducer.src = "pfTausProducerSansRefs"
00031 
00032 # The isolation discriminator requires this as prediscriminant, 
00033 # as all sensical taus must have at least one track
00034 pfTausDiscriminationByLeadingTrackFinding = \
00035     shrinkingConePFTauDiscriminationByLeadingTrackFinding.clone()
00036 pfTausDiscriminationByLeadingTrackFinding.PFTauProducer = "pfTausProducer"
00037 
00038 # The actual selections on pfTaus
00039 pfTausDiscriminationByLeadingPionPtCut = \
00040     shrinkingConePFTauDiscriminationByLeadingPionPtCut.clone()
00041 pfTausDiscriminationByLeadingPionPtCut.PFTauProducer = "pfTausProducer"
00042 
00043 pfTausDiscriminationByIsolation = \
00044     shrinkingConePFTauDiscriminationByIsolation.clone()
00045 pfTausDiscriminationByIsolation.Prediscriminants.leadTrack.Producer = \
00046     "pfTausDiscriminationByLeadingTrackFinding"
00047 pfTausDiscriminationByIsolation.PFTauProducer = "pfTausProducer"
00048 
00049 # Sequence to reproduce taus and compute our cloned discriminants
00050 pfTausBaseSequence = cms.Sequence(
00051     pfTausProducerSansRefs +
00052     pfTausProducer +
00053     pfTausDiscriminationByLeadingTrackFinding +
00054     pfTausDiscriminationByLeadingPionPtCut +
00055     pfTausDiscriminationByIsolation
00056     )
00057 
00058 # Associate track to pfJets
00059 from RecoJets.JetAssociationProducers.j2tParametersVX_cfi import *
00060 pfJetTracksAssociatorAtVertex = cms.EDProducer(
00061     "JetTracksAssociatorAtVertex",
00062     j2tParametersVX,
00063     #jets = cms.InputTag("pfJets")
00064     jets = cms.InputTag("ak5PFJets")
00065     )
00066 pfTausProducerSansRefs.jetSrc = pfJetTracksAssociatorAtVertex.jets
00067 pfTausProducer.jetSrc = pfTausProducerSansRefs.jetSrc
00068 # is it correct collection w/o good leptons
00069 pfTausProducerSansRefs.builders[0].pfCandSrc = ak5PFJets.src
00070 pfTausProducer.builders[0].pfCandSrc = pfTausProducerSansRefs.builders[0].pfCandSrc
00071 
00072 pfTauPileUpVertices = cms.EDFilter(
00073     "RecoTauPileUpVertexSelector",
00074     src = cms.InputTag("offlinePrimaryVertices"),
00075     minTrackSumPt = cms.double(5),
00076     filter = cms.bool(False),
00077 )
00078 
00079 # PiZeroProducers
00080 pfJetsPiZeros = ak5PFJetsRecoTauPiZeros.clone()
00081 pfJetsLegacyTaNCPiZeros = ak5PFJetsLegacyTaNCPiZeros.clone()
00082 pfJetsLegacyHPSPiZeros = ak5PFJetsLegacyHPSPiZeros.clone()
00083 
00084 pfJetsPiZeros.jetSrc = pfJetTracksAssociatorAtVertex.jets
00085 pfJetsLegacyTaNCPiZeros.jetSrc = pfJetTracksAssociatorAtVertex.jets
00086 pfJetsLegacyHPSPiZeros.jetSrc = pfJetTracksAssociatorAtVertex.jets
00087 
00088 pfTauPFJets08Region = recoTauAK5PFJets08Region.clone()
00089 pfTauPFJets08Region.src = pfJetTracksAssociatorAtVertex.jets
00090 pfTauPFJets08Region.pfSrc = ak5PFJets.src
00091 pfJetsPiZeros.jetRegionSrc = 'pfTauPFJets08Region'
00092 pfJetsLegacyTaNCPiZeros.jetRegionSrc = 'pfTauPFJets08Region'
00093 pfJetsLegacyHPSPiZeros.jetRegionSrc = 'pfTauPFJets08Region'
00094 pfTausProducerSansRefs.piZeroSrc = "pfJetsLegacyTaNCPiZeros"
00095 pfTausProducerSansRefs.jetRegionSrc = pfJetsLegacyTaNCPiZeros.jetRegionSrc
00096 pfTausProducer.piZeroSrc = pfTausProducerSansRefs.piZeroSrc
00097 pfTausProducer.jetRegionSrc = pfTausProducerSansRefs.jetRegionSrc
00098 
00099 pfTauTagInfoProducer = pfRecoTauTagInfoProducer.clone()
00100 pfTauTagInfoProducer.PFCandidateProducer = ak5PFJets.src
00101 pfTauTagInfoProducer.PFJetTracksAssociatorProducer = 'pfJetTracksAssociatorAtVertex'
00102 
00103 pfTausProducerSansRefs.modifiers[1] = cms.PSet(
00104     name = cms.string("pfTauTTIworkaround"),
00105     plugin = cms.string("RecoTauTagInfoWorkaroundModifer"),
00106     pfTauTagInfoSrc = cms.InputTag("pfTauTagInfoProducer"),
00107 )
00108 pfTausProducer.modifiers[1] = pfTausProducerSansRefs.modifiers[1]
00109 
00110 pfTausPreSequence = cms.Sequence(
00111     pfJetTracksAssociatorAtVertex + 
00112     pfTauPFJets08Region +
00113     pfTauPileUpVertices +
00114     pfTauTagInfoProducer +
00115     pfJetsPiZeros +
00116     pfJetsLegacyTaNCPiZeros +
00117     pfJetsLegacyHPSPiZeros
00118 )
00119 
00120 # Select taus from given collection that pass cloned discriminants
00121 pfTaus = pfTauSelector.clone()
00122 pfTaus.src = cms.InputTag("pfTausProducer")
00123 pfTaus.discriminators = cms.VPSet(
00124     cms.PSet( discriminator=cms.InputTag("pfTausDiscriminationByLeadingPionPtCut"),selectionCut=cms.double(0.5) ),
00125     cms.PSet( discriminator=cms.InputTag("pfTausDiscriminationByIsolation"),selectionCut=cms.double(0.5) )
00126     )
00127 
00128 
00129 pfTausPtrs = cms.EDProducer("PFTauFwdPtrProducer",
00130                             src=cms.InputTag("pfTaus")
00131                             )
00132 
00133 pfTauSequence = cms.Sequence(
00134     pfTausPreSequence +
00135     pfTausBaseSequence + 
00136     pfTaus +
00137     pfTausPtrs 
00138     )
00139 
00140