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()
32 pfJetsLegacyHPSPiZeros.jetSrc = cms.InputTag(
"ak4PFJets")
34 pfTauPFJetsRecoTauChargedHadrons = ak4PFJetsRecoTauChargedHadrons.clone()
36 pfTauTagInfoProducer = pfRecoTauTagInfoProducer.clone()
37 pfTauTagInfoProducer.PFCandidateProducer = jetConfig.ak4PFJets.src
38 pfTauTagInfoProducer.PFJetTracksAssociatorProducer =
'pfJetTracksAssociatorAtVertex'
41 pfTausProducer = hpsPFTauProducer.clone()
42 pfTausCombiner = combinatoricRecoTaus.clone(
44 piZeroSrc =
"pfJetsLegacyHPSPiZeros",
45 chargedHadronSrc =
"pfTauPFJetsRecoTauChargedHadrons"
47 for mod
in pfTausCombiner.modifiers:
48 if mod.name ==
"TTIworkaround": mod.pfTauTagInfoSrc =
"pfTauTagInfoProducer"
50 pfTausSelectionDiscriminator = hpsSelectionDiscriminator.clone()
51 pfTausSelectionDiscriminator.PFTauProducer = cms.InputTag(
"pfTausCombiner")
52 pfTausProducerSansRefs = hpsPFTauProducerSansRefs.clone()
53 pfTausProducerSansRefs = cms.EDProducer(
55 src = cms.InputTag(
"pfTausCombiner"),
56 outputSelection = cms.string(
""),
57 verbosity = cms.int32(0),
61 name = cms.string(
"leadStripPtLt2_5"),
62 plugin = cms.string(
"RecoTauStringCleanerPlugin"),
63 tolerance = cleaners.tolerance_default,
64 selection = cms.string(
"signalPiZeroCandidates().size() = 0 | signalPiZeroCandidates()[0].pt > 2.5"),
65 selectionPassFunction = cms.string(
"0"),
66 selectionFailValue = cms.double(1e3)
69 name = cms.string(
"HPS_Select"),
70 plugin = cms.string(
"RecoTauDiscriminantCleanerPlugin"),
71 tolerance = cleaners.tolerance_default,
72 src = cms.InputTag(
"pfTausSelectionDiscriminator"),
74 cleaners.combinedIsolation
80 pfTausProducerSansRefs.src=cms.InputTag(
"pfTausCombiner")
81 pfTausProducer.src = cms.InputTag(
"pfTausProducerSansRefs")
85 pfTausDiscriminationByDecayModeFinding = hpsPFTauDiscriminationByDecayModeFinding.clone()
86 pfTausDiscriminationByDecayModeFinding.PFTauProducer=
"pfTausProducer"
88 pfTausDiscriminationByIsolation= hpsPFTauBasicDiscriminators.clone()
89 pfTausDiscriminationByIsolation.PFTauProducer=
"pfTausProducer"
91 pfTausrequireDecayMode = cms.PSet(
92 BooleanOperator = cms.string(
"and"),
94 Producer = cms.InputTag(
'pfTausDiscriminationByDecayModeFinding'),
99 pfTausDiscriminationByIsolation.Prediscriminants=pfTausrequireDecayMode.clone()
102 pfTausBaseSequence = cms.Sequence(
103 pfJetsLegacyHPSPiZeros +
104 pfTauPFJetsRecoTauChargedHadrons +
106 pfTausSelectionDiscriminator +
107 pfTausProducerSansRefs +
109 pfTausDiscriminationByDecayModeFinding *
110 pfTausDiscriminationByIsolation
114 pfJetTracksAssociatorAtVertex = ak4PFJetTracksAssociatorAtVertex.clone()
115 pfJetTracksAssociatorAtVertex.jets= cms.InputTag(
"ak4PFJets")
117 pfTauPileUpVertices = cms.EDFilter(
118 "RecoTauPileUpVertexSelector",
119 src = cms.InputTag(
"offlinePrimaryVertices"),
120 minTrackSumPt = cms.double(5),
121 filter = cms.bool(
False),
125 pfTauTagInfoProducer = pfRecoTauTagInfoProducer.clone()
126 pfTauTagInfoProducer.PFCandidateProducer = jetConfig.ak4PFJets.src
127 pfTauTagInfoProducer.PFJetTracksAssociatorProducer =
'pfJetTracksAssociatorAtVertex'
129 pfTausPreSequence = cms.Sequence(
130 pfJetTracksAssociatorAtVertex +
131 recoTauAK4PFJets08Region +
132 pfTauPileUpVertices +
137 pfTaus = pfTauSelector.clone()
138 pfTaus.src = cms.InputTag(
"pfTausProducer")
139 pfTaus.discriminators = cms.VPSet(
140 cms.PSet( discriminator=cms.InputTag(
"pfTausDiscriminationByDecayModeFinding"),selectionCut=cms.double(0.5) ),
143 pfTausPtrs = cms.EDProducer(
"PFTauFwdPtrProducer",
144 src=cms.InputTag(
"pfTaus")
147 pfTauSequence = cms.Sequence(