1 import FWCore.ParameterSet.Config
as cms
4 from RecoTauTag.RecoTau.pfTauSelector_cfi
import pfTauSelector
5 import RecoTauTag.RecoTau.RecoTauCleanerPlugins
as cleaners
12 Specify the prototype/default configuration of 'pfTaus', which is a selected
13 collection of taus that is used as an input to the 'patTaus'. The pf2pat tau
14 selection is constructed by:
15 * Rerunning a tau algorithm (fixedConePFTaus, shrinkingConePFTaus, etc)
16 * Cloning and running a set of discriminants for this algorithm so they are
17 independent of other cfis
18 * Constructing pfTaus via a PFTauSelector using the cloned discriminants
19 * In PhysicsTools.PatAlgos.tools.pfTools the regular discriminants are
20 modified to take the pfTaus as input. The original discriminant
21 labels are kept (i.e. fixedConePFTauDiscriminationByIsolation) but the Tau
22 source is defined as pfTaus
31 pfJetsLegacyHPSPiZeros = ak4PFJetsLegacyHPSPiZeros.clone(
34 pfTauPFJetsRecoTauChargedHadrons = ak4PFJetsRecoTauChargedHadrons.clone()
36 pfTauTagInfoProducer = pfRecoTauTagInfoProducer.clone(
37 PFCandidateProducer = jetConfig.ak4PFJets.src ,
38 PFJetTracksAssociatorProducer =
'pfJetTracksAssociatorAtVertex'
41 pfTausProducer = hpsPFTauProducer.clone(
42 src =
"pfTausProducerSansRefs"
44 pfTausCombiner = combinatoricRecoTaus.clone(
46 piZeroSrc =
"pfJetsLegacyHPSPiZeros",
47 chargedHadronSrc =
"pfTauPFJetsRecoTauChargedHadrons"
49 for mod
in pfTausCombiner.modifiers:
50 if mod.name ==
"TTIworkaround": mod.pfTauTagInfoSrc =
"pfTauTagInfoProducer"
52 pfTausSelectionDiscriminator = hpsSelectionDiscriminator.clone(
53 PFTauProducer =
"pfTausCombiner"
55 pfTausProducerSansRefs = hpsPFTauProducerSansRefs.clone(
56 src =
"pfTausCombiner",
62 name = cms.string(
"leadStripPtLt2_5"),
63 plugin = cms.string(
"RecoTauStringCleanerPlugin"),
64 tolerance = cleaners.tolerance_default,
65 selection = cms.string(
"signalPiZeroCandidates().size() = 0 | signalPiZeroCandidates()[0].pt > 2.5"),
66 selectionPassFunction = cms.string(
"0"),
67 selectionFailValue = cms.double(1e3)
70 name = cms.string(
"HPS_Select"),
71 plugin = cms.string(
"RecoTauDiscriminantCleanerPlugin"),
72 tolerance = cleaners.tolerance_default,
73 src = cms.InputTag(
"pfTausSelectionDiscriminator"),
75 cleaners.combinedIsolation
81 pfTausDiscriminationByDecayModeFinding = hpsPFTauDiscriminationByDecayModeFinding.clone(
82 PFTauProducer =
"pfTausProducer"
85 pfTausrequireDecayMode = cms.PSet(
86 BooleanOperator = cms.string(
"and"),
88 Producer = cms.InputTag(
'pfTausDiscriminationByDecayModeFinding'),
93 pfTausDiscriminationByIsolation= hpsPFTauBasicDiscriminators.clone(
94 PFTauProducer =
"pfTausProducer",
95 Prediscriminants = pfTausrequireDecayMode.clone()
99 pfTausBaseTask = cms.Task(
100 pfJetsLegacyHPSPiZeros ,
101 pfTauPFJetsRecoTauChargedHadrons ,
103 pfTausSelectionDiscriminator ,
104 pfTausProducerSansRefs ,
106 pfTausDiscriminationByDecayModeFinding ,
107 pfTausDiscriminationByIsolation
111 pfJetTracksAssociatorAtVertex = ak4PFJetTracksAssociatorAtVertex.clone(
115 pfTauPileUpVertices = cms.EDFilter(
116 "RecoTauPileUpVertexSelector",
117 src = cms.InputTag(
"offlinePrimaryVertices"),
118 minTrackSumPt = cms.double(5),
119 filter = cms.bool(
False),
123 pfTauTagInfoProducer = pfRecoTauTagInfoProducer.clone(
124 PFCandidateProducer = jetConfig.ak4PFJets.src ,
125 PFJetTracksAssociatorProducer =
'pfJetTracksAssociatorAtVertex'
127 pfTausPreTask = cms.Task(
128 pfJetTracksAssociatorAtVertex ,
129 recoTauAK4PFJets08Region ,
130 pfTauPileUpVertices ,
135 pfTaus = pfTauSelector.clone(
136 src =
"pfTausProducer",
137 discriminators = cms.VPSet(
139 discriminator=cms.InputTag(
"pfTausDiscriminationByDecayModeFinding"),
140 selectionCut=cms.double(0.5)
144 pfTausPtrs = cms.EDProducer(
"PFTauFwdPtrProducer",
145 src=cms.InputTag(
"pfTaus")
148 pfTauTask = cms.Task(
154 pfTauSequence = cms.Sequence(pfTauTask)