CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/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 import RecoTauTag.RecoTau.RecoTauCleanerPlugins as cleaners
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 
00028 
00029 
00030 # PiZeroProducers
00031 
00032 pfJetsLegacyHPSPiZeros = ak5PFJetsLegacyHPSPiZeros.clone()
00033 
00034 pfJetsLegacyHPSPiZeros.jetSrc = cms.InputTag("ak5PFJets")
00035 
00036 pfTauPFJets08Region = recoTauAK5PFJets08Region.clone()
00037 pfTauPFJets08Region.src = cms.InputTag("ak5PFJets")
00038 pfTauPFJets08Region.pfSrc = cms.InputTag("ParticleFlow")
00039 pfJetsLegacyHPSPiZeros.jetRegionSrc = 'pfTauPFJets08Region'
00040 
00041 # Clone tau producer
00042 pfTausProducer = hpsPFTauProducer.clone()
00043 pfTausCombiner = combinatoricRecoTaus.clone()
00044 pfTausCombiner.jetSrc= cms.InputTag("ak5PFJets")
00045 pfTausCombiner.piZeroSrc= "pfJetsLegacyHPSPiZeros"
00046 pfTausSelectionDiscriminator = hpsSelectionDiscriminator.clone()
00047 pfTausSelectionDiscriminator.PFTauProducer = cms.InputTag("pfTausCombiner")
00048 pfTausProducerSansRefs = hpsPFTauProducerSansRefs.clone()
00049 pfTausProducerSansRefs = cms.EDProducer(
00050     "RecoTauCleaner",
00051     src = cms.InputTag("pfTausCombiner"),
00052     cleaners = cms.VPSet(
00053     cleaners.unitCharge,
00054     cms.PSet(
00055     name = cms.string("leadStripPtLt2_5"),
00056     plugin = cms.string("RecoTauStringCleanerPlugin"),
00057     selection = cms.string("signalPiZeroCandidates().size() = 0 | signalPiZeroCandidates()[0].pt > 2.5"),
00058     selectionPassFunction = cms.string("0"),
00059     selectionFailValue = cms.double(1e3)
00060     ),
00061     cms.PSet(
00062     name = cms.string("HPS_Select"),
00063     plugin = cms.string("RecoTauDiscriminantCleanerPlugin"),
00064     src = cms.InputTag("pfTausSelectionDiscriminator"),
00065     ),
00066     cleaners.combinedIsolation
00067     )
00068 )
00069 
00070 
00071 
00072 pfTausProducerSansRefs.src=cms.InputTag("pfTausCombiner")
00073 pfTausProducer.src = cms.InputTag("pfTausProducerSansRefs")
00074 
00075 #cloning discriminants
00076 
00077 pfTausDiscriminationByDecayModeFinding = hpsPFTauDiscriminationByDecayModeFinding.clone()
00078 pfTausDiscriminationByDecayModeFinding.PFTauProducer="pfTausProducer"
00079 
00080 pfTausDiscriminationByIsolation= hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone()
00081 pfTausDiscriminationByIsolation.PFTauProducer="pfTausProducer"
00082 
00083 pfTausrequireDecayMode = cms.PSet(
00084     BooleanOperator = cms.string("and"),
00085     decayMode = cms.PSet(
00086     Producer = cms.InputTag('pfTausDiscriminationByDecayModeFinding'),
00087     cut = cms.double(0.5)
00088     )
00089 )
00090 
00091 pfTausDiscriminationByIsolation.Prediscriminants=pfTausrequireDecayMode.clone()
00092 
00093 # Sequence to reproduce taus and compute our cloned discriminants
00094 pfTausBaseSequence = cms.Sequence(
00095    pfJetsLegacyHPSPiZeros +
00096    pfTausCombiner +
00097    pfTausSelectionDiscriminator +
00098    pfTausProducerSansRefs +
00099    pfTausProducer +
00100    pfTausDiscriminationByDecayModeFinding *
00101    pfTausDiscriminationByIsolation
00102     )
00103 
00104 # Associate track to pfJets
00105 #from RecoJets.JetAssociationProducers.j2tParametersVX_cfi import *
00106 pfJetTracksAssociatorAtVertex = ak5PFJetTracksAssociatorAtVertex.clone()
00107 pfJetTracksAssociatorAtVertex.jets= cms.InputTag("ak5PFJets")
00108 
00109 pfTauPileUpVertices = cms.EDFilter(
00110     "RecoTauPileUpVertexSelector",
00111     src = cms.InputTag("offlinePrimaryVertices"),
00112     minTrackSumPt = cms.double(5),
00113     filter = cms.bool(False),
00114 )
00115 
00116 
00117 pfTauTagInfoProducer = pfRecoTauTagInfoProducer.clone()
00118 pfTauTagInfoProducer.PFCandidateProducer = ak5PFJets.src
00119 pfTauTagInfoProducer.PFJetTracksAssociatorProducer = 'pfJetTracksAssociatorAtVertex'
00120 
00121 
00122 pfTausPreSequence = cms.Sequence(
00123     pfJetTracksAssociatorAtVertex + 
00124     pfTauPFJets08Region +
00125     pfTauPileUpVertices +
00126     pfTauTagInfoProducer
00127 )
00128 
00129 # Select taus from given collection that pass cloned discriminants
00130 pfTaus = pfTauSelector.clone()
00131 pfTaus.src = cms.InputTag("pfTausProducer")
00132 pfTaus.discriminators = cms.VPSet(
00133     cms.PSet( discriminator=cms.InputTag("pfTausDiscriminationByDecayModeFinding"),selectionCut=cms.double(0.5) ),
00134     cms.PSet( discriminator=cms.InputTag("pfTausDiscriminationByIsolation"),selectionCut=cms.double(0.5) )
00135     )
00136 
00137 
00138 pfTausPtrs = cms.EDProducer("PFTauFwdPtrProducer",
00139                             src=cms.InputTag("pfTaus")
00140                             )
00141 
00142 pfTauSequence = cms.Sequence(
00143     pfTausPreSequence +
00144     pfTausBaseSequence + 
00145     pfTaus +
00146     pfTausPtrs 
00147     )
00148 
00149