CMS 3D CMS Logo

taus_updatedMVAIds_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 ##################### Updated tau collection with MVA-based tau-Ids rerun #######
4 # Used only in some eras
5 from Configuration.StandardSequences.Eras import eras
8 
9 ### MVAIso 2017v2
10 ## DBoldDM
11 # Raw
12 patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw = patDiscriminationByIsolationMVArun2v1raw.clone(
13  PATTauProducer = cms.InputTag('slimmedTaus'),
14  Prediscriminants = noPrediscriminants,
15  loadMVAfromDB = cms.bool(True),
16  mvaName = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2"), # name of the training you want to use
17  mvaOpt = cms.string("DBoldDMwLTwGJ"), # option you want to use for your training (i.e., which variables are used to compute the BDT score)
18  requireDecayMode = cms.bool(True),
19  verbosity = cms.int32(0)
20 )
21 # VVLoose WP
22 patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT = patDiscriminationByIsolationMVArun2v1VLoose.clone(
23  PATTauProducer = cms.InputTag('slimmedTaus'),
24  Prediscriminants = noPrediscriminants,
25  toMultiplex = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw'),
26  key = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw','category'),
27  loadMVAfromDB = cms.bool(True),
28  mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_mvaOutput_normalization"), # normalization fo the training you want to use
29  mapping = cms.VPSet(
30  cms.PSet(
31  category = cms.uint32(0),
32  cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff95"), # this is the name of the working point you want to use
33  variable = cms.string("pt"),
34  )
35  )
36 )
37 # VLoose WP
38 patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT.clone()
39 patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff90")
40 # Loose WP
41 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT.clone()
42 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff80")
43 # Medium WP
44 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT.clone()
45 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff70")
46 # Tight WP
47 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT.clone()
48 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff60")
49 # VTight WP
50 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT.clone()
51 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff50")
52 # VVTights WP
53 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT.clone()
54 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff40")
55 # MVAIso DBoldDM Seqeunce
56 patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTSeq = cms.Sequence(
57  patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw
58  + patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT
59  + patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT
60  + patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT
61  + patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT
62  + patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT
63  + patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT
64  + patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT
65 )
66 ## DBnewDM
67 # Raw
68 patTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw = patDiscriminationByIsolationMVArun2v1raw.clone(
69  PATTauProducer = cms.InputTag('slimmedTaus'),
70  Prediscriminants = noPrediscriminants,
71  loadMVAfromDB = cms.bool(True),
72  mvaName = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2"), # name of the training you want to use
73  mvaOpt = cms.string("DBnewDMwLTwGJ"), # option you want to use for your training (i.e., which variables are used to compute the BDT score)
74  requireDecayMode = cms.bool(True),
75  verbosity = cms.int32(0)
76 )
77 # VVLoose WP
78 patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT = patDiscriminationByIsolationMVArun2v1VLoose.clone(
79  PATTauProducer = cms.InputTag('slimmedTaus'),
80  Prediscriminants = noPrediscriminants,
81  toMultiplex = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw'),
82  key = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw','category'),
83  loadMVAfromDB = cms.bool(True),
84  mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_mvaOutput_normalization"), # normalization fo the training you want to use
85  mapping = cms.VPSet(
86  cms.PSet(
87  category = cms.uint32(0),
88  cut = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff95"), # this is the name of the working point you want to use
89  variable = cms.string("pt"),
90  )
91  )
92 )
93 # VLoose WP
94 patTauDiscriminationByVLooseIsolationMVArun2v1DBnewDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT.clone()
95 patTauDiscriminationByVLooseIsolationMVArun2v1DBnewDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff90")
96 # Loose WP
97 patTauDiscriminationByLooseIsolationMVArun2v1DBnewDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT.clone()
98 patTauDiscriminationByLooseIsolationMVArun2v1DBnewDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff80")
99 # Medium WP
100 patTauDiscriminationByMediumIsolationMVArun2v1DBnewDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT.clone()
101 patTauDiscriminationByMediumIsolationMVArun2v1DBnewDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff70")
102 # Tight WP
103 patTauDiscriminationByTightIsolationMVArun2v1DBnewDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT.clone()
104 patTauDiscriminationByTightIsolationMVArun2v1DBnewDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff60")
105 # VTight WP
106 patTauDiscriminationByVTightIsolationMVArun2v1DBnewDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT.clone()
107 patTauDiscriminationByVTightIsolationMVArun2v1DBnewDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff50")
108 # VVTights WP
109 patTauDiscriminationByVVTightIsolationMVArun2v1DBnewDMwLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT.clone()
110 patTauDiscriminationByVVTightIsolationMVArun2v1DBnewDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff40")
111 # MVAIso DBnewDM Seqeunce
112 patTauDiscriminationByIsolationMVArun2v1DBnewDMwLTSeq = cms.Sequence(
113  patTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw
114  + patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT
115  + patTauDiscriminationByVLooseIsolationMVArun2v1DBnewDMwLT
116  + patTauDiscriminationByLooseIsolationMVArun2v1DBnewDMwLT
117  + patTauDiscriminationByMediumIsolationMVArun2v1DBnewDMwLT
118  + patTauDiscriminationByTightIsolationMVArun2v1DBnewDMwLT
119  + patTauDiscriminationByVTightIsolationMVArun2v1DBnewDMwLT
120  + patTauDiscriminationByVVTightIsolationMVArun2v1DBnewDMwLT
121 )
122 ## DBoldDMdR0p3
123 # Raw
124 patTauDiscriminationByIsolationMVArun2v1DBoldDMdR0p3wLTraw = patDiscriminationByIsolationMVArun2v1raw.clone(
125  PATTauProducer = cms.InputTag('slimmedTaus'),
126  Prediscriminants = noPrediscriminants,
127  loadMVAfromDB = cms.bool(True),
128  mvaName = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2"), # name of the training you want to use
129  mvaOpt = cms.string("DBoldDMwLTwGJ"), # option you want to use for your training (i.e., which variables are used to compute the BDT score)
130  requireDecayMode = cms.bool(True),
131  srcChargedIsoPtSum = cms.string('chargedIsoPtSumdR03'),
132  srcFootprintCorrection = cms.string('footprintCorrectiondR03'),
133  srcNeutralIsoPtSum = cms.string('neutralIsoPtSumdR03'),
134  srcPUcorrPtSum = cms.string('puCorrPtSum'),
135  srcPhotonPtSumOutsideSignalCone = cms.string('photonPtSumOutsideSignalConedR03'),
136  verbosity = cms.int32(0)
137 )
138 # VVLoose WP
139 patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT = patDiscriminationByIsolationMVArun2v1VLoose.clone(
140  PATTauProducer = cms.InputTag('slimmedTaus'),
141  Prediscriminants = noPrediscriminants,
142  toMultiplex = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMdR0p3wLTraw'),
143  key = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMdR0p3wLTraw','category'),
144  loadMVAfromDB = cms.bool(True),
145  mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_mvaOutput_normalization"), # normalization fo the training you want to use
146  mapping = cms.VPSet(
147  cms.PSet(
148  category = cms.uint32(0),
149  cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff95"), # this is the name of the working point you want to use
150  variable = cms.string("pt"),
151  )
152  )
153 )
154 # VLoose WP
155 patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMdR0p3wLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT.clone()
156 patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMdR0p3wLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff90")
157 # Loose WP
158 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMdR0p3wLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT.clone()
159 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMdR0p3wLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff80")
160 # Medium WP
161 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMdR0p3wLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT.clone()
162 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMdR0p3wLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff70")
163 # Tight WP
164 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMdR0p3wLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT.clone()
165 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMdR0p3wLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff60")
166 # VTight WP
167 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMdR0p3wLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT.clone()
168 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMdR0p3wLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff50")
169 # VVTights WP
170 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMdR0p3wLT = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT.clone()
171 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMdR0p3wLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff40")
172 # MVAIso DBoldDMdR0p3 Seqeunce
173 patTauDiscriminationByIsolationMVArun2v1DBoldDMdR0p3wLTSeq = cms.Sequence(
174  patTauDiscriminationByIsolationMVArun2v1DBoldDMdR0p3wLTraw
175  + patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT
176  + patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMdR0p3wLT
177  + patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMdR0p3wLT
178  + patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMdR0p3wLT
179  + patTauDiscriminationByTightIsolationMVArun2v1DBoldDMdR0p3wLT
180  + patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMdR0p3wLT
181  + patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMdR0p3wLT
182 )
183 ### MVAIso 2017v1 for Nano on top of MiniAODv1
184 ## DBoldDM
185 # Raw
186 patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2017v1 = patDiscriminationByIsolationMVArun2v1raw.clone(
187  PATTauProducer = cms.InputTag('slimmedTaus'),
188  Prediscriminants = noPrediscriminants,
189  loadMVAfromDB = cms.bool(True),
190  mvaName = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1"), # name of the training you want to use
191  mvaOpt = cms.string("DBoldDMwLTwGJ"), # option you want to use for your training (i.e., which variables are used to compute the BDT score)
192  requireDecayMode = cms.bool(True),
193  verbosity = cms.int32(0)
194 )
195 # VVLoose WP
196 patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1 = patDiscriminationByIsolationMVArun2v1VLoose.clone(
197  PATTauProducer = cms.InputTag('slimmedTaus'),
198  Prediscriminants = noPrediscriminants,
199  toMultiplex = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2017v1'),
200  key = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2017v1','category'),
201  loadMVAfromDB = cms.bool(True),
202  mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_mvaOutput_normalization"), # normalization fo the training you want to use
203  mapping = cms.VPSet(
204  cms.PSet(
205  category = cms.uint32(0),
206  cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff95"), # this is the name of the working point you want to use
207  variable = cms.string("pt"),
208  )
209  )
210 )
211 # VLoose WP
212 patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2017v1 = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1.clone()
213 patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2017v1.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff90")
214 # Loose WP
215 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2017v1 = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1.clone()
216 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2017v1.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff80")
217 # Medium WP
218 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2017v1 = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1.clone()
219 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2017v1.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff70")
220 # Tight WP
221 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2017v1 = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1.clone()
222 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2017v1.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff60")
223 # VTight WP
224 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2017v1 = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1.clone()
225 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2017v1.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff50")
226 # VVTights WP
227 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2017v1 = patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1.clone()
228 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2017v1.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff40")
229 # MVAIso DBoldDM Seqeunce
230 patTauDiscriminationByIsolationMVArun2v1DBoldDMwLT2017v1Seq = cms.Sequence(
231  patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2017v1
232  + patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1
233  + patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2017v1
234  + patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2017v1
235  + patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2017v1
236  + patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2017v1
237  + patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2017v1
238  + patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2017v1
239 )
240 ### MVAIso 2015 for Nano on top of MiniAODv2
241 ## DBoldDM
242 # Raw
243 patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2015 = patDiscriminationByIsolationMVArun2v1raw.clone(
244  PATTauProducer = cms.InputTag('slimmedTaus'),
245  Prediscriminants = noPrediscriminants,
246  loadMVAfromDB = cms.bool(True),
247  mvaName = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1"), # name of the training you want to use
248  mvaOpt = cms.string("DBoldDMwLT"), # option you want to use for your training (i.e., which variables are used to compute the BDT score)
249  requireDecayMode = cms.bool(True),
250  verbosity = cms.int32(0)
251 )
252 # VLoose WP
253 patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015 = patDiscriminationByIsolationMVArun2v1VLoose.clone(
254  PATTauProducer = cms.InputTag('slimmedTaus'),
255  Prediscriminants = noPrediscriminants,
256  toMultiplex = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2015'),
257  key = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2015','category'),
258  loadMVAfromDB = cms.bool(True),
259  mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1_mvaOutput_normalization"), # normalization fo the training you want to use
260  mapping = cms.VPSet(
261  cms.PSet(
262  category = cms.uint32(0),
263  cut = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff90"), # this is the name of the working point you want to use
264  variable = cms.string("pt"),
265  )
266  )
267 )
268 # Loose WP
269 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2015 = patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015.clone()
270 patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2015.mapping[0].cut = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff80")
271 # Medium WP
272 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2015 = patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015.clone()
273 patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2015.mapping[0].cut = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff70")
274 # Tight WP
275 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2015 = patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015.clone()
276 patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2015.mapping[0].cut = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff60")
277 # VTight WP
278 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2015 = patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015.clone()
279 patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2015.mapping[0].cut = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff50")
280 # VVTights WP
281 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2015 = patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015.clone()
282 patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2015.mapping[0].cut = cms.string("RecoTauTag_tauIdMVADBoldDMwLTv1_WPEff40")
283 # MVAIso DBoldDM Seqeunce
284 patTauDiscriminationByIsolationMVArun2v1DBoldDMwLT2015Seq = cms.Sequence(
285  patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2015
286  + patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015
287  + patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2015
288  + patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2015
289  + patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2015
290  + patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2015
291  + patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2015
292 )
293 
294 
295 ### FIXME: add other tau-Ids when ready
296 
297 ### put all new MVA tau-Id stuff to one Sequence
298 _patTauMVAIDsSeq2017v2 = cms.Sequence(
299  patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTSeq
300  +patTauDiscriminationByIsolationMVArun2v1DBnewDMwLTSeq
301  +patTauDiscriminationByIsolationMVArun2v1DBoldDMdR0p3wLTSeq
302 )
303 patTauMVAIDsSeq = _patTauMVAIDsSeq2017v2.copy()
304 patTauMVAIDsSeq += patTauDiscriminationByIsolationMVArun2v1DBoldDMwLT2015Seq
305 
306 _patTauMVAIDsSeqWith2017v1 = _patTauMVAIDsSeq2017v2.copy()
307 _patTauMVAIDsSeqWith2017v1 += patTauDiscriminationByIsolationMVArun2v1DBoldDMwLT2017v1Seq
308 for era in [eras.run2_nanoAOD_94XMiniAODv1,eras.run2_nanoAOD_92X]:
309  era.toReplaceWith(patTauMVAIDsSeq,_patTauMVAIDsSeqWith2017v1)
310 
311 # embed new MVA tau-Ids into new tau collection
312 slimmedTausUpdated = cms.EDProducer("PATTauIDEmbedder",
313  src = cms.InputTag('slimmedTaus'),
314  tauIDSources = cms.PSet() # PSet defined below in era dependent way
315 )
316 _tauIDSources2017v2 = cms.PSet(
317  #oldDM
318  byIsolationMVArun2v1DBoldDMwLTraw2017v2 = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw'),
319  byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT'),
320  byVLooseIsolationMVArun2v1DBoldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT'),
321  byLooseIsolationMVArun2v1DBoldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT'),
322  byMediumIsolationMVArun2v1DBoldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT'),
323  byTightIsolationMVArun2v1DBoldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT'),
324  byVTightIsolationMVArun2v1DBoldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT'),
325  byVVTightIsolationMVArun2v1DBoldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT'),
326  #newDM
327  byIsolationMVArun2v1DBnewDMwLTraw2017v2 = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw'),
328  byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVVLooseIsolationMVArun2v1DBnewDMwLT'),
329  byVLooseIsolationMVArun2v1DBnewDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVLooseIsolationMVArun2v1DBnewDMwLT'),
330  byLooseIsolationMVArun2v1DBnewDMwLT2017v2 = cms.InputTag('patTauDiscriminationByLooseIsolationMVArun2v1DBnewDMwLT'),
331  byMediumIsolationMVArun2v1DBnewDMwLT2017v2 = cms.InputTag('patTauDiscriminationByMediumIsolationMVArun2v1DBnewDMwLT'),
332  byTightIsolationMVArun2v1DBnewDMwLT2017v2 = cms.InputTag('patTauDiscriminationByTightIsolationMVArun2v1DBnewDMwLT'),
333  byVTightIsolationMVArun2v1DBnewDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVTightIsolationMVArun2v1DBnewDMwLT'),
334  byVVTightIsolationMVArun2v1DBnewDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVVTightIsolationMVArun2v1DBnewDMwLT'),
335  #oldDMdR0p3
336  byIsolationMVArun2v1DBdR03oldDMwLTraw2017v2 = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMdR0p3wLTraw'),
337  byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMdR0p3wLT'),
338  byVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMdR0p3wLT'),
339  byLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMdR0p3wLT'),
340  byMediumIsolationMVArun2v1DBdR03oldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMdR0p3wLT'),
341  byTightIsolationMVArun2v1DBdR03oldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByTightIsolationMVArun2v1DBoldDMdR0p3wLT'),
342  byVTightIsolationMVArun2v1DBdR03oldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMdR0p3wLT'),
343  byVVTightIsolationMVArun2v1DBdR03oldDMwLT2017v2 = cms.InputTag('patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMdR0p3wLT'),
344 )
345 _tauIDSources2017v1 = cms.PSet(
346  byIsolationMVArun2v1DBoldDMwLTraw2017v1 = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2017v1'),
347  byVVLooseIsolationMVArun2v1DBoldDMwLT2017v1 = cms.InputTag('patTauDiscriminationByVVLooseIsolationMVArun2v1DBoldDMwLT2017v1'),
348  byVLooseIsolationMVArun2v1DBoldDMwLT2017v1 = cms.InputTag('patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2017v1'),
349  byLooseIsolationMVArun2v1DBoldDMwLT2017v1 = cms.InputTag('patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2017v1'),
350  byMediumIsolationMVArun2v1DBoldDMwLT2017v1 = cms.InputTag('patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2017v1'),
351  byTightIsolationMVArun2v1DBoldDMwLT2017v1 = cms.InputTag('patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2017v1'),
352  byVTightIsolationMVArun2v1DBoldDMwLT2017v1 = cms.InputTag('patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2017v1'),
353  byVVTightIsolationMVArun2v1DBoldDMwLT2017v1 = cms.InputTag('patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2017v1')
354 )
355 _tauIDSourcesWith2017v1 = cms.PSet(
356  _tauIDSources2017v2.clone(),
357  _tauIDSources2017v1
358 )
359 _tauIDSources2015 = cms.PSet(
360  byIsolationMVArun2v1DBoldDMwLTraw2015 = cms.InputTag('patTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw2015'),
361  byVLooseIsolationMVArun2v1DBoldDMwLT2015 = cms.InputTag('patTauDiscriminationByVLooseIsolationMVArun2v1DBoldDMwLT2015'),
362  byLooseIsolationMVArun2v1DBoldDMwLT2015 = cms.InputTag('patTauDiscriminationByLooseIsolationMVArun2v1DBoldDMwLT2015'),
363  byMediumIsolationMVArun2v1DBoldDMwLT2015 = cms.InputTag('patTauDiscriminationByMediumIsolationMVArun2v1DBoldDMwLT2015'),
364  byTightIsolationMVArun2v1DBoldDMwLT2015 = cms.InputTag('patTauDiscriminationByTightIsolationMVArun2v1DBoldDMwLT2015'),
365  byVTightIsolationMVArun2v1DBoldDMwLT2015 = cms.InputTag('patTauDiscriminationByVTightIsolationMVArun2v1DBoldDMwLT2015'),
366  byVVTightIsolationMVArun2v1DBoldDMwLT2015 = cms.InputTag('patTauDiscriminationByVVTightIsolationMVArun2v1DBoldDMwLT2015')
367 )
368 _tauIDSourcesWith2015 = cms.PSet(
369  _tauIDSources2017v2.clone(),
370  _tauIDSources2015
371 )
372 slimmedTausUpdated.tauIDSources=_tauIDSourcesWith2015
373 
374 for era in [eras.run2_nanoAOD_94XMiniAODv1,eras.run2_nanoAOD_92X]:
375  era.toModify(slimmedTausUpdated,
376  tauIDSources = _tauIDSourcesWith2017v1
377  )
378 
379 
380 
381 patTauMVAIDsSeq += slimmedTausUpdated
382