CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoPFTauTag_cff.py
Go to the documentation of this file.
2 
3 #-------------------------------------------------------------------------------
4 #------------------ Jet Production and Preselection-----------------------------
5 #-------------------------------------------------------------------------------
6 # Apply a base selection to the jets. The acceptance selection takes only jets
7 # with pt > 5 and abs(eta) < 2.5. The preselection selects jets that have at
8 # least one constituent with pt > 5. This cut should be 100% efficient w.r.t a
9 # lead pion selection.
10 #
11 # After the basic preselection has been applied to the jets, the pizeros inside
12 # the jet are reconstructed.
13 #-------------------------------------------------------------------------------
14 
15 # Produce the jets that form the base of PFTaus
16 #from RecoJets.JetProducers.ak5PFJets_cfi import ak5PFJets
17 
18 # Reconstruct the pi zeros in our pre-selected jets.
19 from RecoTauTag.RecoTau.RecoTauPiZeroProducer_cfi import \
20  ak5PFJetsRecoTauPiZeros
21 
22 # Collection PFCandidates from a DR=0.8 cone about the jet axis and make new
23 # faux jets with this collection
24 recoTauAK5PFJets08Region = cms.EDProducer(
25  "RecoTauJetRegionProducer",
26  deltaR = cms.double(0.8),
27  src = cms.InputTag("ak5PFJets"),
28  pfSrc = cms.InputTag("particleFlow"),
29 )
30 
31 # The computation of the lead track signed transverse impact parameter depends
32 # on the transient tracks
34  TransientTrackBuilderESProducer
35 
36 # Only reconstruct the preselected jets
37 ak5PFJetsRecoTauPiZeros.jetSrc = cms.InputTag("ak5PFJets")
38 
39 #-------------------------------------------------------------------------------
40 #------------------ Fixed Cone Taus --------------------------------------------
41 #-------------------------------------------------------------------------------
43 
44 #-------------------------------------------------------------------------------
45 #------------------ Shrinking Cone Taus ----------------------------------------
46 #-------------------------------------------------------------------------------
48 # Use the legacy PiZero reconstruction for shrinking cone taus
49 from RecoTauTag.RecoTau.RecoTauPiZeroProducer_cfi import \
50  ak5PFJetsLegacyTaNCPiZeros, ak5PFJetsLegacyHPSPiZeros
51 
52 ak5PFJetsLegacyTaNCPiZeros.jetSrc = cms.InputTag("ak5PFJets")
53 
54 shrinkingConePFTauProducer.piZeroSrc = cms.InputTag(
55  "ak5PFJetsLegacyTaNCPiZeros")
56 
57 #-------------------------------------------------------------------------------
58 #------------------ Produce combinatoric base taus------------------------------
59 #-------------------------------------------------------------------------------
60 # These jets form the basis of the HPS & TaNC taus. There are many taus
61 # produced for each jet, which are cleaned by the respective algorithms.
62 # We split it into different collections for each different decay mode.
63 
64 from RecoTauTag.RecoTau.RecoTauCombinatoricProducer_cfi import \
65  combinatoricRecoTaus
66 
67 combinatoricRecoTaus.jetSrc = cms.InputTag("ak5PFJets")
68 combinatoricRecoTaus.piZeroSrc = cms.InputTag("ak5PFJetsRecoTauPiZeros")
69 
71  pfRecoTauDiscriminationByLeadingPionPtCut
72 # Common discrimination by lead pion
73 combinatoricRecoTausDiscriminationByLeadingPionPtCut = \
74  pfRecoTauDiscriminationByLeadingPionPtCut.clone(
75  PFTauProducer = cms.InputTag("combinatoricRecoTaus")
76  )
77 
78 #-------------------------------------------------------------------------------
79 #------------------ HPS Taus ---------------------------------------------------
80 #-------------------------------------------------------------------------------
81 
84 ak5PFJetsLegacyHPSPiZeros.jetSrc = cms.InputTag("ak5PFJets")
85 
86 # FIXME remove this once final pi zero reco is decided
87 combinatoricRecoTaus.piZeroSrc = cms.InputTag("ak5PFJetsLegacyHPSPiZeros")
88 
89 #-------------------------------------------------------------------------------
90 #------------------ PFTauTagInfo workaround ------------------------------------
91 #-------------------------------------------------------------------------------
92 # Build the PFTauTagInfos separately, then relink them into the taus.
93 from RecoTauTag.RecoTau.PFRecoTauTagInfoProducer_cfi import \
94  pfRecoTauTagInfoProducer
96  import ic5PFJetTracksAssociatorAtVertex
97 ak5PFJetTracksAssociatorAtVertex = ic5PFJetTracksAssociatorAtVertex.clone()
98 ak5PFJetTracksAssociatorAtVertex.jets = cms.InputTag("ak5PFJets")
99 tautagInfoModifer = cms.PSet(
100  name = cms.string("TTIworkaround"),
101  plugin = cms.string("RecoTauTagInfoWorkaroundModifer"),
102  pfTauTagInfoSrc = cms.InputTag("pfRecoTauTagInfoProducer"),
103 )
104 
105 # Add the modifier to our tau producers
106 shrinkingConePFTauProducerSansRefs.modifiers.append(tautagInfoModifer)
107 combinatoricRecoTaus.modifiers.append(tautagInfoModifer)
108 
109 recoTauPileUpVertices = cms.EDFilter(
110  "RecoTauPileUpVertexSelector",
111  src = cms.InputTag("offlinePrimaryVertices"),
112  minTrackSumPt = cms.double(5),
113  filter = cms.bool(False),
114 )
115 
116 
117 recoTauCommonSequence = cms.Sequence(
118  ak5PFJetTracksAssociatorAtVertex *
119  recoTauAK5PFJets08Region*
120  recoTauPileUpVertices*
121  pfRecoTauTagInfoProducer
122 )
123 
124 
125 # Not run in RECO, but included for the benefit of PAT
126 recoTauClassicFixedConeSequence = cms.Sequence(
127  recoTauCommonSequence *
128  ak5PFJetsRecoTauPiZeros *
129  produceAndDiscriminateFixedConePFTaus
130 )
131 
132 # Produce only classic HPS taus
133 recoTauClassicHPSSequence = cms.Sequence(
134  recoTauCommonSequence *
135  ak5PFJetsLegacyHPSPiZeros *
136  combinatoricRecoTaus *
137  produceAndDiscriminateHPSPFTaus
138 )
139 
140 # Produce only classic shrinking cone taus (+ TaNC)
141 recoTauClassicShrinkingConeSequence = cms.Sequence(
142  recoTauCommonSequence *
143  ak5PFJetsRecoTauPiZeros *
144  produceAndDiscriminateShrinkingConePFTaus
145 )
146 
147 recoTauClassicShrinkingConeMVASequence = cms.Sequence(
148  produceShrinkingConeDiscriminationByTauNeuralClassifier
149 )
150 
151 # Produce hybrid algorithm taus
152 recoTauHPSTancSequence = cms.Sequence(
153  recoTauCommonSequence *
154  ak5PFJetsLegacyHPSPiZeros *
155  combinatoricRecoTaus *
156  hpsTancTauInitialSequence *
157  hpsTancTauDiscriminantSequence
158 )
159 
160 PFTau = cms.Sequence(
161  # Jet production
162  recoTauCommonSequence *
163  # Make shrinking cone taus
164 # recoTauClassicShrinkingConeSequence *
165  # Make classic HPS taus
166  recoTauClassicHPSSequence
167 )
168 
169 # Check if we want to run the MVA dependent stuff. This is disabled in some
170 # versions of 3_11_1 due to a TMVA issue.
171 #from RecoTauTag.Configuration.RecoTauMVAConfiguration_cfi \
172 # import recoTauEnableMVA
173 #
174 #if recoTauEnableMVA:
175 # # Enable shrinking cone tanc discriminators
176 # PFTau += recoTauClassicShrinkingConeMVASequence
177 # # Make hybrid algo taus
178 # PFTau += recoTauHPSTancSequence