155 _rerunMvaIsolationTask = cms.Task()
156 _rerunMvaIsolationSequence = cms.Sequence()
157 tauIDSources = cms.PSet()
160 if "mvaIso" in self.toKeep:
161 _byIsolationOldDMMVAraw =
"rerunDiscriminationByIsolationOldDMMVAraw"+self.postfix
162 setattr(self.process,_byIsolationOldDMMVAraw,patDiscriminationByIsolationMVArun2v1raw.clone(
163 PATTauProducer = self.originalTauName,
164 Prediscriminants = noPrediscriminants,
165 loadMVAfromDB = cms.bool(
True),
166 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT"),
167 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
168 verbosity = cms.int32(0)
171 _byIsolationOldDMMVA =
"rerunDiscriminationByIsolationOldDMMVA"+self.postfix
172 setattr(self.process,_byIsolationOldDMMVA,patDiscriminationByIsolationMVArun2v1.clone(
173 PATTauProducer = self.originalTauName,
174 Prediscriminants = noPrediscriminants,
175 toMultiplex = _byIsolationOldDMMVAraw,
176 loadMVAfromDB = cms.bool(
True),
177 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT_mvaOutput_normalization"),
180 category = cms.uint32(0),
181 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT"),
182 variable = cms.string(
"pt"),
185 workingPoints = cms.vstring(
196 _rerunIsolationOldDMMVATask = cms.Task(
197 getattr(self.process,_byIsolationOldDMMVAraw),
198 getattr(self.process,_byIsolationOldDMMVA)
200 _rerunMvaIsolationTask.add(_rerunIsolationOldDMMVATask)
201 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMMVATask)
203 tauIDSources.byIsolationMVArun2DBoldDMwLTraw = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"raw")
204 tauIDSources.byVVLooseIsolationMVArun2DBoldDMwLT = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"_VVLoose")
205 tauIDSources.byVLooseIsolationMVArun2DBoldDMwLT = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"_VLoose")
206 tauIDSources.byLooseIsolationMVArun2DBoldDMwLT = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"_Loose")
207 tauIDSources.byMediumIsolationMVArun2DBoldDMwLT = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"_Medium")
208 tauIDSources.byTightIsolationMVArun2DBoldDMwLT = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"_Tight")
209 tauIDSources.byVTightIsolationMVArun2DBoldDMwLT = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"_VTight")
210 tauIDSources.byVVTightIsolationMVArun2DBoldDMwLT = self.tauIDMVAinputs(_byIsolationOldDMMVA,
"_VVTight")
212 if "mvaIsoNewDM" in self.toKeep:
213 _byIsolationNewDMMVAraw =
"rerunDiscriminationByIsolationNewDMMVAraw"+self.postfix
214 setattr(self.process,_byIsolationNewDMMVAraw,patDiscriminationByIsolationMVArun2v1raw.clone(
215 PATTauProducer = self.originalTauName,
216 Prediscriminants = noPrediscriminants,
217 loadMVAfromDB = cms.bool(
True),
218 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT"),
219 mvaOpt = cms.string(
"DBnewDMwLTwGJ"),
220 verbosity = cms.int32(0)
223 _byIsolationNewDMMVA =
"rerunDiscriminationByIsolationNewDMMVA"+self.postfix
224 setattr(self.process,_byIsolationNewDMMVA,patDiscriminationByIsolationMVArun2v1.clone(
225 PATTauProducer = self.originalTauName,
226 Prediscriminants = noPrediscriminants,
227 toMultiplex = _byIsolationNewDMMVAraw,
228 loadMVAfromDB = cms.bool(
True),
229 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT_mvaOutput_normalization"),
232 category = cms.uint32(0),
233 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT"),
234 variable = cms.string(
"pt"),
237 workingPoints = cms.vstring(
248 _rerunIsolationNewDMMVATask = cms.Task(
249 getattr(self.process,_byIsolationNewDMMVAraw),
250 getattr(self.process,_byIsolationNewDMMVA)
252 _rerunMvaIsolationTask.add(_rerunIsolationNewDMMVATask)
253 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationNewDMMVATask)
255 tauIDSources.byIsolationMVArun2DBnewDMwLTraw = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"raw")
256 tauIDSources.byVVLooseIsolationMVArun2DBnewDMwLT = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"_VVLoose")
257 tauIDSources.byVLooseIsolationMVArun2DBnewDMwLT = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"_VLoose")
258 tauIDSources.byLooseIsolationMVArun2DBnewDMwLT = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"_Loose")
259 tauIDSources.byMediumIsolationMVArun2DBnewDMwLT = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"_Medium")
260 tauIDSources.byTightIsolationMVArun2DBnewDMwLT = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"_Tight")
261 tauIDSources.byVTightIsolationMVArun2DBnewDMwLT = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"_VTight")
262 tauIDSources.byVVTightIsolationMVArun2DBnewDMwLT = self.tauIDMVAinputs(_byIsolationNewDMMVA,
"_VVTight")
264 if "mvaIsoDR0p3" in self.toKeep:
265 _byIsolationOldDMdR0p3MVAraw =
"rerunDiscriminationByIsolationOldDMdR0p3MVAraw"+self.postfix
266 setattr(self.process,_byIsolationOldDMdR0p3MVAraw,patDiscriminationByIsolationMVArun2v1raw.clone(
267 PATTauProducer = self.originalTauName,
268 Prediscriminants = noPrediscriminants,
269 loadMVAfromDB = cms.bool(
True),
270 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT"),
271 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
272 srcChargedIsoPtSum = cms.string(
'chargedIsoPtSumdR03'),
273 srcFootprintCorrection = cms.string(
'footprintCorrectiondR03'),
274 srcNeutralIsoPtSum = cms.string(
'neutralIsoPtSumdR03'),
275 srcPhotonPtSumOutsideSignalCone = cms.string(
'photonPtSumOutsideSignalConedR03'),
276 verbosity = cms.int32(0)
279 _byIsolationOldDMdR0p3MVA =
"rerunDiscriminationByIsolationOldDMdR0p3MVA"+self.postfix
280 setattr(self.process,_byIsolationOldDMdR0p3MVA,patDiscriminationByIsolationMVArun2v1.clone(
281 PATTauProducer = self.originalTauName,
282 Prediscriminants = noPrediscriminants,
283 toMultiplex = _byIsolationOldDMdR0p3MVAraw,
284 loadMVAfromDB = cms.bool(
True),
285 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT_mvaOutput_normalization"),
288 category = cms.uint32(0),
289 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT"),
290 variable = cms.string(
"pt"),
293 workingPoints = cms.vstring(
304 _rerunIsolationOldDMdR0p3MVATask = cms.Task(
305 getattr(self.process,_byIsolationOldDMdR0p3MVAraw),
306 getattr(self.process,_byIsolationOldDMdR0p3MVA)
308 _rerunMvaIsolationTask.add(_rerunIsolationOldDMdR0p3MVATask)
309 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMdR0p3MVATask)
311 tauIDSources.byIsolationMVArun2DBoldDMdR0p3wLTraw = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"raw")
312 tauIDSources.byVVLooseIsolationMVArun2DBoldDMdR0p3wLT = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"_VVLoose")
313 tauIDSources.byVLooseIsolationMVArun2DBoldDMdR0p3wLT = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"_VLoose")
314 tauIDSources.byLooseIsolationMVArun2DBoldDMdR0p3wLT = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"_Loose")
315 tauIDSources.byMediumIsolationMVArun2DBoldDMdR0p3wLT = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"_Medium")
316 tauIDSources.byTightIsolationMVArun2DBoldDMdR0p3wLT = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"_Tight")
317 tauIDSources.byVTightIsolationMVArun2DBoldDMdR0p3wLT = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"_VTight")
318 tauIDSources.byVVTightIsolationMVArun2DBoldDMdR0p3wLT = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVA,
"_VVTight")
321 if "2017v1" in self.toKeep:
322 self.tauIdDiscrMVA_2017_version =
"v1" 323 self.tauIdDiscrMVA_trainings_run2_2017 = {
324 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017",
326 self.tauIdDiscrMVA_WPs_run2_2017 = {
327 'tauIdMVAIsoDBoldDMwLT2017' : {
328 'Eff95' :
"DBoldDMwLTEff95",
329 'Eff90' :
"DBoldDMwLTEff90",
330 'Eff80' :
"DBoldDMwLTEff80",
331 'Eff70' :
"DBoldDMwLTEff70",
332 'Eff60' :
"DBoldDMwLTEff60",
333 'Eff50' :
"DBoldDMwLTEff50",
334 'Eff40' :
"DBoldDMwLTEff40" 338 if self.debug:
print (
"runTauID: Will update the list of available in DB samples to access 2017v1")
339 self.loadMVA_WPs_run2_2017()
341 _byIsolationOldDMMVArun2017v1raw =
"rerunDiscriminationByIsolationOldDMMVArun2017v1raw"+self.postfix
342 setattr(self.process,_byIsolationOldDMMVArun2017v1raw,patDiscriminationByIsolationMVArun2v1raw.clone(
343 PATTauProducer = self.originalTauName,
344 Prediscriminants = noPrediscriminants,
345 loadMVAfromDB = cms.bool(
True),
346 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1"),
347 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
348 verbosity = cms.int32(0)
351 _byIsolationOldDMMVArun2017v1 =
"rerunDiscriminationByIsolationOldDMMVArun2017v1"+self.postfix
352 setattr(self.process,_byIsolationOldDMMVArun2017v1,patDiscriminationByIsolationMVArun2v1.clone(
353 PATTauProducer = self.originalTauName,
354 Prediscriminants = noPrediscriminants,
355 toMultiplex = _byIsolationOldDMMVArun2017v1raw,
356 loadMVAfromDB = cms.bool(
True),
357 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_mvaOutput_normalization"),
360 category = cms.uint32(0),
361 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1"),
362 variable = cms.string(
"pt"),
365 workingPoints = cms.vstring(
376 _rerunIsolationOldDMMVArun2017v1Task = cms.Task(
377 getattr(self.process,_byIsolationOldDMMVArun2017v1raw),
378 getattr(self.process,_byIsolationOldDMMVArun2017v1)
380 _rerunMvaIsolationTask.add(_rerunIsolationOldDMMVArun2017v1Task)
381 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMMVArun2017v1Task)
383 tauIDSources.byIsolationMVArun2017v1DBoldDMwLTraw2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"raw")
384 tauIDSources.byVVLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff95")
385 tauIDSources.byVLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff90")
386 tauIDSources.byLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff80")
387 tauIDSources.byMediumIsolationMVArun2017v1DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff70")
388 tauIDSources.byTightIsolationMVArun2017v1DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff60")
389 tauIDSources.byVTightIsolationMVArun2017v1DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff50")
390 tauIDSources.byVVTightIsolationMVArun2017v1DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff40")
392 if "2017v2" in self.toKeep:
393 self.tauIdDiscrMVA_2017_version =
"v2" 394 self.tauIdDiscrMVA_trainings_run2_2017 = {
395 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017",
397 self.tauIdDiscrMVA_WPs_run2_2017 = {
398 'tauIdMVAIsoDBoldDMwLT2017' : {
399 'Eff95' :
"DBoldDMwLTEff95",
400 'Eff90' :
"DBoldDMwLTEff90",
401 'Eff80' :
"DBoldDMwLTEff80",
402 'Eff70' :
"DBoldDMwLTEff70",
403 'Eff60' :
"DBoldDMwLTEff60",
404 'Eff50' :
"DBoldDMwLTEff50",
405 'Eff40' :
"DBoldDMwLTEff40" 409 if self.debug:
print (
"runTauID: Will update the list of available in DB samples to access 2017v2")
410 self.loadMVA_WPs_run2_2017()
412 _byIsolationOldDMMVArun2017v2raw =
"rerunDiscriminationByIsolationOldDMMVArun2017v2raw"+self.postfix
413 setattr(self.process,_byIsolationOldDMMVArun2017v2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
414 PATTauProducer = self.originalTauName,
415 Prediscriminants = noPrediscriminants,
416 loadMVAfromDB = cms.bool(
True),
417 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2"),
418 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
419 verbosity = cms.int32(0)
422 _byIsolationOldDMMVArun2017v2 =
"rerunDiscriminationByIsolationOldDMMVArun2017v2"+self.postfix
423 setattr(self.process,_byIsolationOldDMMVArun2017v2,patDiscriminationByIsolationMVArun2v1.clone(
424 PATTauProducer = self.originalTauName,
425 Prediscriminants = noPrediscriminants,
426 toMultiplex = _byIsolationOldDMMVArun2017v2raw,
427 loadMVAfromDB = cms.bool(
True),
428 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_mvaOutput_normalization"),
431 category = cms.uint32(0),
432 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2"),
433 variable = cms.string(
"pt"),
436 workingPoints = cms.vstring(
445 verbosity = cms.int32(0)
448 _rerunIsolationOldDMMVArun2017v2Task = cms.Task(
449 getattr(self.process,_byIsolationOldDMMVArun2017v2raw),
450 getattr(self.process,_byIsolationOldDMMVArun2017v2)
452 _rerunMvaIsolationTask.add(_rerunIsolationOldDMMVArun2017v2Task)
453 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMMVArun2017v2Task)
455 tauIDSources.byIsolationMVArun2017v2DBoldDMwLTraw2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"raw")
456 tauIDSources.byVVLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff95")
457 tauIDSources.byVLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff90")
458 tauIDSources.byLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff80")
459 tauIDSources.byMediumIsolationMVArun2017v2DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff70")
460 tauIDSources.byTightIsolationMVArun2017v2DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff60")
461 tauIDSources.byVTightIsolationMVArun2017v2DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff50")
462 tauIDSources.byVVTightIsolationMVArun2017v2DBoldDMwLT2017 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff40")
464 if "newDM2017v2" in self.toKeep:
465 self.tauIdDiscrMVA_2017_version =
"v2" 466 self.tauIdDiscrMVA_trainings_run2_2017 = {
467 'tauIdMVAIsoDBnewDMwLT2017' :
"tauIdMVAIsoDBnewDMwLT2017",
469 self.tauIdDiscrMVA_WPs_run2_2017 = {
470 'tauIdMVAIsoDBnewDMwLT2017' : {
471 'Eff95' :
"DBnewDMwLTEff95",
472 'Eff90' :
"DBnewDMwLTEff90",
473 'Eff80' :
"DBnewDMwLTEff80",
474 'Eff70' :
"DBnewDMwLTEff70",
475 'Eff60' :
"DBnewDMwLTEff60",
476 'Eff50' :
"DBnewDMwLTEff50",
477 'Eff40' :
"DBnewDMwLTEff40" 481 if self.debug:
print (
"runTauID: Will update the list of available in DB samples to access newDM2017v2")
482 self.loadMVA_WPs_run2_2017()
484 _byIsolationNewDMMVArun2017v2raw =
"rerunDiscriminationByIsolationNewDMMVArun2017v2raw"+self.postfix
485 setattr(self.process,_byIsolationNewDMMVArun2017v2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
486 PATTauProducer = self.originalTauName,
487 Prediscriminants = noPrediscriminants,
488 loadMVAfromDB = cms.bool(
True),
489 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2"),
490 mvaOpt = cms.string(
"DBnewDMwLTwGJ"),
491 verbosity = cms.int32(0)
494 _byIsolationNewDMMVArun2017v2 =
"rerunDiscriminationByIsolationNewDMMVArun2017v2"+self.postfix
495 setattr(self.process,_byIsolationNewDMMVArun2017v2,patDiscriminationByIsolationMVArun2v1.clone(
496 PATTauProducer = self.originalTauName,
497 Prediscriminants = noPrediscriminants,
498 toMultiplex = _byIsolationNewDMMVArun2017v2raw,
499 loadMVAfromDB = cms.bool(
True),
500 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_mvaOutput_normalization"),
503 category = cms.uint32(0),
504 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2"),
505 variable = cms.string(
"pt"),
508 workingPoints = cms.vstring(
517 verbosity = cms.int32(0)
520 _rerunIsolationNewDMMVArun2017v2Task = cms.Task(
521 getattr(self.process,_byIsolationNewDMMVArun2017v2raw),
522 getattr(self.process,_byIsolationNewDMMVArun2017v2)
524 _rerunMvaIsolationTask.add(_rerunIsolationNewDMMVArun2017v2Task)
525 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationNewDMMVArun2017v2Task)
527 tauIDSources.byIsolationMVArun2017v2DBnewDMwLTraw2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"raw")
528 tauIDSources.byVVLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff95")
529 tauIDSources.byVLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff90")
530 tauIDSources.byLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff80")
531 tauIDSources.byMediumIsolationMVArun2017v2DBnewDMwLT2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff70")
532 tauIDSources.byTightIsolationMVArun2017v2DBnewDMwLT2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff60")
533 tauIDSources.byVTightIsolationMVArun2017v2DBnewDMwLT2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff50")
534 tauIDSources.byVVTightIsolationMVArun2017v2DBnewDMwLT2017 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff40")
536 if "dR0p32017v2" in self.toKeep:
537 self.tauIdDiscrMVA_2017_version =
"v2" 538 self.tauIdDiscrMVA_trainings_run2_2017 = {
539 'tauIdMVAIsoDBoldDMdR0p3wLT2017' :
"tauIdMVAIsoDBoldDMdR0p3wLT2017",
541 self.tauIdDiscrMVA_WPs_run2_2017 = {
542 'tauIdMVAIsoDBoldDMdR0p3wLT2017' : {
543 'Eff95' :
"DBoldDMdR0p3wLTEff95",
544 'Eff90' :
"DBoldDMdR0p3wLTEff90",
545 'Eff80' :
"DBoldDMdR0p3wLTEff80",
546 'Eff70' :
"DBoldDMdR0p3wLTEff70",
547 'Eff60' :
"DBoldDMdR0p3wLTEff60",
548 'Eff50' :
"DBoldDMdR0p3wLTEff50",
549 'Eff40' :
"DBoldDMdR0p3wLTEff40" 553 if self.debug:
print (
"runTauID: Will update the list of available in DB samples to access dR0p32017v2")
554 self.loadMVA_WPs_run2_2017()
556 _byIsolationOldDMdR0p3MVArun2017v2raw =
"rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2raw"+self.postfix
557 setattr(self.process,_byIsolationOldDMdR0p3MVArun2017v2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
558 PATTauProducer = self.originalTauName,
559 Prediscriminants = noPrediscriminants,
560 loadMVAfromDB = cms.bool(
True),
561 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2"),
562 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
563 srcChargedIsoPtSum = cms.string(
'chargedIsoPtSumdR03'),
564 srcFootprintCorrection = cms.string(
'footprintCorrectiondR03'),
565 srcNeutralIsoPtSum = cms.string(
'neutralIsoPtSumdR03'),
566 srcPhotonPtSumOutsideSignalCone = cms.string(
'photonPtSumOutsideSignalConedR03'),
567 verbosity = cms.int32(0)
570 _byIsolationOldDMdR0p3MVArun2017v2 =
"rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2"+self.postfix
571 setattr(self.process,_byIsolationOldDMdR0p3MVArun2017v2,patDiscriminationByIsolationMVArun2v1.clone(
572 PATTauProducer = self.originalTauName,
573 Prediscriminants = noPrediscriminants,
574 toMultiplex = _byIsolationOldDMdR0p3MVArun2017v2raw,
575 loadMVAfromDB = cms.bool(
True),
576 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_mvaOutput_normalization"),
579 category = cms.uint32(0),
580 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2"),
581 variable = cms.string(
"pt"),
584 workingPoints = cms.vstring(
593 verbosity = cms.int32(0)
596 _rerunIsolationOldDMdR0p3MVArun2017v2Task = cms.Task(
597 getattr(self.process,_byIsolationOldDMdR0p3MVArun2017v2raw),
598 getattr(self.process,_byIsolationOldDMdR0p3MVArun2017v2)
600 _rerunMvaIsolationTask.add(_rerunIsolationOldDMdR0p3MVArun2017v2Task)
601 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMdR0p3MVArun2017v2Task)
603 tauIDSources.byIsolationMVArun2017v2DBoldDMdR0p3wLTraw2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"raw")
604 tauIDSources.byVVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff95")
605 tauIDSources.byVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff90")
606 tauIDSources.byLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff80")
607 tauIDSources.byMediumIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff70")
608 tauIDSources.byTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff60")
609 tauIDSources.byVTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff50")
610 tauIDSources.byVVTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff40")
639 if "2016v1" in self.toKeep:
640 _byIsolationOldDMMVArun2016v1raw =
"rerunDiscriminationByIsolationOldDMMVArun2v1raw"+self.postfix
641 setattr(self.process,_byIsolationOldDMMVArun2016v1raw,patDiscriminationByIsolationMVArun2v1raw.clone(
642 PATTauProducer = self.originalTauName,
643 Prediscriminants = noPrediscriminants,
644 loadMVAfromDB = cms.bool(
True),
645 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1"),
646 mvaOpt = cms.string(
"DBoldDMwLT"),
647 verbosity = cms.int32(0)
650 _byIsolationOldDMMVArun2016v1 =
"rerunDiscriminationByIsolationOldDMMVArun2v1"+self.postfix
651 setattr(self.process,_byIsolationOldDMMVArun2016v1,patDiscriminationByIsolationMVArun2v1.clone(
652 PATTauProducer = self.originalTauName,
653 Prediscriminants = noPrediscriminants,
654 toMultiplex = _byIsolationOldDMMVArun2016v1raw,
655 loadMVAfromDB = cms.bool(
True),
656 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_mvaOutput_normalization"),
659 category = cms.uint32(0),
660 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1"),
661 variable = cms.string(
"pt"),
664 workingPoints = cms.vstring(
674 self.tauIdDiscrMVA_2017_version =
"v1" 675 self.tauIdDiscrMVA_trainings_run2_2017 = {
676 'tauIdMVAIsoDBoldDMwLT2016' :
"tauIdMVAIsoDBoldDMwLT2016",
678 self.tauIdDiscrMVA_WPs_run2_2017 = {
679 'tauIdMVAIsoDBoldDMwLT2016' : {
680 'Eff90' :
"DBoldDMwLT2016Eff90",
681 'Eff80' :
"DBoldDMwLT2016Eff80",
682 'Eff70' :
"DBoldDMwLT2016Eff70",
683 'Eff60' :
"DBoldDMwLT2016Eff60",
684 'Eff50' :
"DBoldDMwLT2016Eff50",
685 'Eff40' :
"DBoldDMwLT2016Eff40" 688 if self.debug:
print (
"runTauID: Will update the list of available in DB samples to access 2016v1")
689 self.loadMVA_WPs_run2_2017()
691 _rerunIsolationOldDMMVArun2016v1Task = cms.Task(
692 getattr(self.process,_byIsolationOldDMMVArun2016v1raw),
693 getattr(self.process,_byIsolationOldDMMVArun2016v1)
695 _rerunMvaIsolationTask.add(_rerunIsolationOldDMMVArun2016v1Task)
696 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMMVArun2016v1Task)
698 tauIDSources.byIsolationMVArun2v1DBoldDMwLTraw2016 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"raw")
699 tauIDSources.byVLooseIsolationMVArun2v1DBoldDMwLT2016 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff90")
700 tauIDSources.byLooseIsolationMVArun2v1DBoldDMwLT2016 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff80")
701 tauIDSources.byMediumIsolationMVArun2v1DBoldDMwLT2016 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff70")
702 tauIDSources.byTightIsolationMVArun2v1DBoldDMwLT2016 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff60")
703 tauIDSources.byVTightIsolationMVArun2v1DBoldDMwLT2016 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff50")
704 tauIDSources.byVVTightIsolationMVArun2v1DBoldDMwLT2016 = self.tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff40")
707 if "newDM2016v1" in self.toKeep:
708 _byIsolationNewDMMVArun2016v1raw =
"rerunDiscriminationByIsolationNewDMMVArun2v1raw"+self.postfix
709 setattr(self.process,_byIsolationNewDMMVArun2016v1raw,patDiscriminationByIsolationMVArun2v1raw.clone(
710 PATTauProducer = self.originalTauName,
711 Prediscriminants = noPrediscriminants,
712 loadMVAfromDB = cms.bool(
True),
713 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1"),
714 mvaOpt = cms.string(
"DBnewDMwLT"),
715 verbosity = cms.int32(0)
718 _byIsolationNewDMMVArun2016v1 =
"rerunDiscriminationByIsolationNewDMMVArun2v1"+self.postfix
719 setattr(self.process,_byIsolationNewDMMVArun2016v1,patDiscriminationByIsolationMVArun2v1.clone(
720 PATTauProducer = self.originalTauName,
721 Prediscriminants = noPrediscriminants,
722 toMultiplex = _byIsolationNewDMMVArun2016v1raw,
723 loadMVAfromDB = cms.bool(
True),
724 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_mvaOutput_normalization"),
727 category = cms.uint32(0),
728 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1"),
729 variable = cms.string(
"pt"),
732 workingPoints = cms.vstring(
742 self.tauIdDiscrMVA_2017_version =
"v1" 743 self.tauIdDiscrMVA_trainings_run2_2017 = {
744 'tauIdMVAIsoDBnewDMwLT2016' :
"tauIdMVAIsoDBnewDMwLT2016",
746 self.tauIdDiscrMVA_WPs_run2_2017 = {
747 'tauIdMVAIsoDBnewDMwLT2016' : {
748 'Eff90' :
"DBnewDMwLT2016Eff90",
749 'Eff80' :
"DBnewDMwLT2016Eff80",
750 'Eff70' :
"DBnewDMwLT2016Eff70",
751 'Eff60' :
"DBnewDMwLT2016Eff60",
752 'Eff50' :
"DBnewDMwLT2016Eff50",
753 'Eff40' :
"DBnewDMwLT2016Eff40" 756 if self.debug:
print (
"runTauID: Will update the list of available in DB samples to access newDM2016v1")
757 self.loadMVA_WPs_run2_2017()
759 _rerunIsolationNewDMMVArun2016v1Task = cms.Task(
760 getattr(self.process,_byIsolationNewDMMVArun2016v1raw),
761 getattr(self.process,_byIsolationNewDMMVArun2016v1)
763 _rerunMvaIsolationTask.add(_rerunIsolationNewDMMVArun2016v1Task)
764 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationNewDMMVArun2016v1Task)
766 tauIDSources.byIsolationMVArun2v1DBnewDMwLTraw2016 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"raw")
767 tauIDSources.byVLooseIsolationMVArun2v1DBnewDMwLT2016 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff90")
768 tauIDSources.byLooseIsolationMVArun2v1DBnewDMwLT2016 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff80")
769 tauIDSources.byMediumIsolationMVArun2v1DBnewDMwLT2016 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff70")
770 tauIDSources.byTightIsolationMVArun2v1DBnewDMwLT2016 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff60")
771 tauIDSources.byVTightIsolationMVArun2v1DBnewDMwLT2016 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff50")
772 tauIDSources.byVVTightIsolationMVArun2v1DBnewDMwLT2016 = self.tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff40")
774 if "deepTau2017v2" in self.toKeep:
775 if self.debug:
print (
"Adding DeepTau v2 IDs")
777 _deepTauName =
"deepTau2017v2" 778 workingPoints_ = WORKING_POINTS_v2p1
781 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_core.pb',
782 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_inner.pb',
783 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_outer.pb',
785 full_version = self.getDeepTauVersion(file_names[0])
786 setattr(self.process,_deepTauName+self.postfix,DeepTau.clone(
787 Prediscriminants = noPrediscriminants,
788 taus = self.originalTauName,
789 graph_file = file_names,
790 year = full_version[0],
791 version = full_version[1],
795 _deepTauProducer = getattr(self.process,_deepTauName+self.postfix)
797 from Configuration.ProcessModifiers.deepTauSonicTriton_cff
import deepTauSonicTriton
798 deepTauSonicTriton.toReplaceWith(_deepTauProducer, DeepTauIdSonicProducer.clone(
800 mode = cms.string(
'PseudoAsync'),
801 allowedTries = cms.untracked.uint32(0),
802 verbose = cms.untracked.bool(
False),
803 modelName = cms.string(
"deeptau_2017v2p1"),
804 modelVersion = cms.string(
''),
805 modelConfigPath = cms.FileInPath(
"RecoTauTag/TrainingFiles/data/DeepTauIdSONIC/deeptau_2017v2p1/config.pbtxt"),
806 preferredServer = cms.untracked.string(
''),
807 timeout = cms.untracked.uint32(300),
808 useSharedMemory = cms.untracked.bool(
True),
809 compression = cms.untracked.string(
''),
810 outputs = cms.untracked.vstring()
812 Prediscriminants = noPrediscriminants,
813 taus = self.originalTauName,
814 year = full_version[0],
815 version = full_version[1],
819 self.processDeepProducer(_deepTauName, tauIDSources, workingPoints_)
821 _rerunMvaIsolationTask.add(_deepTauProducer)
822 _rerunMvaIsolationSequence += _deepTauProducer
825 if "deepTau2017v2p1" in self.toKeep:
826 if self.debug:
print (
"Adding DeepTau v2p1 IDs")
828 _deepTauName =
"deepTau2017v2p1" 829 workingPoints_ = WORKING_POINTS_v2p1
832 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_core.pb',
833 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_inner.pb',
834 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_outer.pb',
836 full_version = self.getDeepTauVersion(file_names[0])
837 setattr(self.process,_deepTauName+self.postfix,DeepTau.clone(
838 Prediscriminants = noPrediscriminants,
839 taus = self.originalTauName,
840 graph_file = file_names,
841 year = full_version[0],
842 version = full_version[1],
844 disable_dxy_pca =
True 847 _deepTauProducer = getattr(self.process,_deepTauName+self.postfix)
849 from Configuration.ProcessModifiers.deepTauSonicTriton_cff
import deepTauSonicTriton
850 deepTauSonicTriton.toReplaceWith(_deepTauProducer, DeepTauIdSonicProducer.clone(
852 mode = cms.string(
'PseudoAsync'),
853 allowedTries = cms.untracked.uint32(0),
854 verbose = cms.untracked.bool(
False),
855 modelName = cms.string(
"deeptau_2017v2p1"),
856 modelVersion = cms.string(
''),
857 modelConfigPath = cms.FileInPath(
"RecoTauTag/TrainingFiles/data/DeepTauIdSONIC/deeptau_2017v2p1/config.pbtxt"),
858 preferredServer = cms.untracked.string(
''),
859 timeout = cms.untracked.uint32(300),
860 useSharedMemory = cms.untracked.bool(
True),
861 compression = cms.untracked.string(
''),
862 outputs = cms.untracked.vstring()
864 Prediscriminants = noPrediscriminants,
865 taus = self.originalTauName,
866 year = full_version[0],
867 version = full_version[1],
869 disable_dxy_pca =
True 872 self.processDeepProducer(_deepTauName, tauIDSources, workingPoints_)
874 _rerunMvaIsolationTask.add(_deepTauProducer)
875 _rerunMvaIsolationSequence += _deepTauProducer
877 if "deepTau2018v2p5" in self.toKeep:
878 if self.debug:
print (
"Adding DeepTau v2p5 IDs")
880 _deepTauName =
"deepTau2018v2p5" 881 workingPoints_ = WORKING_POINTS_v2p5
884 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2018v2p5_core.pb',
885 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2018v2p5_inner.pb',
886 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2018v2p5_outer.pb',
888 full_version = self.getDeepTauVersion(file_names[0])
889 setattr(self.process,_deepTauName+self.postfix,DeepTau.clone(
890 Prediscriminants = noPrediscriminants,
891 taus = self.originalTauName,
892 graph_file = file_names,
893 year = full_version[0],
894 version = full_version[1],
895 sub_version = full_version[2],
896 disable_dxy_pca =
True,
897 disable_hcalFraction_workaround =
True,
898 disable_CellIndex_workaround =
True 901 _deepTauProducer = getattr(self.process,_deepTauName+self.postfix)
903 from Configuration.ProcessModifiers.deepTauSonicTriton_cff
import deepTauSonicTriton
904 deepTauSonicTriton.toReplaceWith(_deepTauProducer, DeepTauIdSonicProducer.clone(
906 mode = cms.string(
'PseudoAsync'),
907 allowedTries = cms.untracked.uint32(0),
908 verbose = cms.untracked.bool(
False),
909 modelName = cms.string(
"deeptau_2018v2p5"),
910 modelVersion = cms.string(
''),
911 modelConfigPath = cms.FileInPath(
"RecoTauTag/TrainingFiles/data/DeepTauIdSONIC/deeptau_2018v2p5/config.pbtxt"),
912 preferredServer = cms.untracked.string(
''),
913 timeout = cms.untracked.uint32(300),
914 useSharedMemory = cms.untracked.bool(
True),
915 compression = cms.untracked.string(
''),
916 outputs = cms.untracked.vstring(),
918 Prediscriminants = noPrediscriminants,
919 taus = self.originalTauName,
920 year = full_version[0],
921 version = full_version[1],
922 sub_version = full_version[2],
923 disable_dxy_pca =
True,
924 disable_hcalFraction_workaround =
True,
925 disable_CellIndex_workaround =
True 928 self.processDeepProducer(_deepTauName, tauIDSources, workingPoints_)
930 _rerunMvaIsolationTask.add(_deepTauProducer)
931 _rerunMvaIsolationSequence += _deepTauProducer
933 if "deepTau2026v2p5" in self.toKeep:
934 if self.debug:
print (
"Adding Phase2 DeepTau v2p5 IDs")
936 _deepTauName =
"deepTau2026v2p5" 937 workingPoints_ = WORKING_POINTS_PHASEII_v2p5
940 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2026v2p5_core.pb',
941 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2026v2p5_inner.pb',
942 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2026v2p5_outer.pb',
944 full_version = self.getDeepTauVersion(file_names[0])
945 setattr(self.process,_deepTauName+self.postfix,DeepTau.clone(
946 Prediscriminants = noPrediscriminants,
947 taus = self.originalTauName,
948 graph_file = file_names,
949 year = full_version[0],
950 version = full_version[1],
951 sub_version = full_version[2],
952 disable_dxy_pca =
True,
953 disable_hcalFraction_workaround =
True,
954 disable_CellIndex_workaround =
True 957 from RecoTauTag.RecoTau.mergedPhase2SlimmedElectronsForTauId_cff
import mergedSlimmedElectronsForTauId
958 if not hasattr(self.process,
"mergedSlimmedElectronsForTauId"):
959 self.process.mergedSlimmedElectronsForTauId = mergedSlimmedElectronsForTauId
960 setattr(getattr(self.process, _deepTauName+self.postfix),
"electrons", cms.InputTag(
"mergedSlimmedElectronsForTauId"))
961 setattr(getattr(self.process, _deepTauName+self.postfix),
"vertices", cms.InputTag(
"offlineSlimmedPrimaryVertices4D"))
963 self.processDeepProducer(_deepTauName, tauIDSources, workingPoints_)
965 _deepTauProducer = getattr(self.process,_deepTauName+self.postfix)
966 _rerunMvaIsolationTask.add(self.process.mergedSlimmedElectronsForTauId)
967 _rerunMvaIsolationTask.add(_deepTauProducer)
968 _rerunMvaIsolationSequence += self.process.mergedSlimmedElectronsForTauId
969 _rerunMvaIsolationSequence += _deepTauProducer
971 if "againstEle2018" in self.toKeep:
972 self.antiElectronDiscrMVA6_version =
"v3_noeveto" 973 self.antiElectronDiscrMVA6_WPs = [
"eff98",
"eff90",
"eff80",
"eff70",
"eff60" ]
977 _byElectronRejectionMVA62018Raw =
"patTauDiscriminationByElectronRejectionMVA62018Raw"+self.postfix
978 setattr(self.process,_byElectronRejectionMVA62018Raw,patTauDiscriminationAgainstElectronMVA6.clone(
979 PATTauProducer = self.originalTauName,
980 Prediscriminants = noPrediscriminants,
981 srcElectrons = cms.InputTag(
'slimmedElectrons'),
982 vetoEcalCracks = cms.bool(
False),
983 mvaName_NoEleMatch_wGwoGSF_BL =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL',
984 mvaName_NoEleMatch_wGwoGSF_EC =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC',
985 mvaName_NoEleMatch_woGwoGSF_BL =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL',
986 mvaName_NoEleMatch_woGwoGSF_EC =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC',
987 mvaName_wGwGSF_BL =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL',
988 mvaName_wGwGSF_EC =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC',
989 mvaName_woGwGSF_BL =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL',
990 mvaName_woGwGSF_EC =
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC' 994 _byElectronRejectionMVA62018 =
"patTauDiscriminationByElectronRejectionMVA62018"+self.postfix
995 setattr(self.process,
"patTauDiscriminationByElectronRejectionMVA62018"+self.postfix,patTauDiscriminantCutMultiplexer.clone(
996 PATTauProducer = self.originalTauName,
997 Prediscriminants = noPrediscriminants,
998 toMultiplex = _byElectronRejectionMVA62018Raw,
1001 category = cms.uint32(0),
1002 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL'),
1003 variable = cms.string(
'pt')
1006 category = cms.uint32(2),
1007 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL'),
1008 variable = cms.string(
'pt')
1011 category = cms.uint32(5),
1012 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL'),
1013 variable = cms.string(
'pt')
1016 category = cms.uint32(7),
1017 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL'),
1018 variable = cms.string(
'pt')
1021 category = cms.uint32(8),
1022 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC'),
1023 variable = cms.string(
'pt')
1026 category = cms.uint32(10),
1027 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC'),
1028 variable = cms.string(
'pt')
1031 category = cms.uint32(13),
1032 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC'),
1033 variable = cms.string(
'pt')
1036 category = cms.uint32(15),
1037 cut = cms.string(
'RecoTauTag_antiElectronMVA6'+self.antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC'),
1038 variable = cms.string(
'pt')
1041 workingPoints = cms.vstring(
1050 if self.debug:
print (
"runTauID: Will update the list of available in DB samples to access againstEle 2018")
1051 self.load_againstElectronMVA6()
1054 _patTauDiscriminationByElectronRejectionMVA62018Task = cms.Task(
1055 getattr(self.process,_byElectronRejectionMVA62018Raw),
1056 getattr(self.process,_byElectronRejectionMVA62018)
1058 _rerunMvaIsolationTask.add(_patTauDiscriminationByElectronRejectionMVA62018Task)
1059 _rerunMvaIsolationSequence += cms.Sequence(_patTauDiscriminationByElectronRejectionMVA62018Task)
1061 _againstElectronTauIDSources = cms.PSet(
1062 againstElectronMVA6Raw2018 = self.tauIDMVAinputs(_byElectronRejectionMVA62018,
"raw"),
1063 againstElectronMVA6category2018 = self.tauIDMVAinputs(_byElectronRejectionMVA62018,
"category"),
1064 againstElectronVLooseMVA62018 = self.tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff98"),
1065 againstElectronLooseMVA62018 = self.tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff90"),
1066 againstElectronMediumMVA62018 = self.tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff80"),
1067 againstElectronTightMVA62018 = self.tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff70"),
1068 againstElectronVTightMVA62018 = self.tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff60")
1070 _tauIDSourcesWithAgainistEle = cms.PSet(
1071 tauIDSources.clone(),
1072 _againstElectronTauIDSources
1074 tauIDSources =_tauIDSourcesWithAgainistEle.clone()
1076 if "againstEle" in self.toKeep:
1080 _byElectronRejectionMVA6Raw =
"patTauDiscriminationByElectronRejectionMVA6Raw"+self.postfix
1081 setattr(self.process,_byElectronRejectionMVA6Raw,patTauDiscriminationAgainstElectronMVA6.clone(
1082 PATTauProducer = self.originalTauName,
1083 Prediscriminants = noPrediscriminants,
1084 srcElectrons = cms.InputTag(
'slimmedElectrons'),
1085 vetoEcalCracks = cms.bool(
False),
1086 mvaName_NoEleMatch_wGwoGSF_BL =
'RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL',
1087 mvaName_NoEleMatch_wGwoGSF_EC =
'RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC',
1088 mvaName_NoEleMatch_woGwoGSF_BL =
'RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL',
1089 mvaName_NoEleMatch_woGwoGSF_EC =
'RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC',
1090 mvaName_wGwGSF_BL =
'RecoTauTag_antiElectronMVA_wGwGSF_BL',
1091 mvaName_wGwGSF_EC =
'RecoTauTag_antiElectronMVA_wGwGSF_EC',
1092 mvaName_woGwGSF_BL =
'RecoTauTag_antiElectronMVA_woGwGSF_BL',
1093 mvaName_woGwGSF_EC =
'RecoTauTag_antiElectronMVA_woGwGSF_EC' 1097 _byElectronRejectionMVA6 =
"patTauDiscriminationByElectronRejectionMVA6"+self.postfix
1098 setattr(self.process,
"patTauDiscriminationByElectronRejectionMVA6"+self.postfix,patTauDiscriminantCutMultiplexer.clone(
1099 PATTauProducer = self.originalTauName,
1100 Prediscriminants = noPrediscriminants,
1101 toMultiplex = _byElectronRejectionMVA6Raw,
1102 mapping = cms.VPSet(
1104 category = cms.uint32(0),
1105 cut = cms.string(
'RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL'),
1106 variable = cms.string(
'pt')
1109 category = cms.uint32(2),
1110 cut = cms.string(
'RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL'),
1111 variable = cms.string(
'pt')
1114 category = cms.uint32(5),
1115 cut = cms.string(
'RecoTauTag_antiElectronMVA_woGwGSF_BL'),
1116 variable = cms.string(
'pt')
1119 category = cms.uint32(7),
1120 cut = cms.string(
'RecoTauTag_antiElectronMVA_wGwGSF_BL'),
1121 variable = cms.string(
'pt')
1124 category = cms.uint32(8),
1125 cut = cms.string(
'RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC'),
1126 variable = cms.string(
'pt')
1129 category = cms.uint32(10),
1130 cut = cms.string(
'RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC'),
1131 variable = cms.string(
'pt')
1134 category = cms.uint32(13),
1135 cut = cms.string(
'RecoTauTag_antiElectronMVA_woGwGSF_EC'),
1136 variable = cms.string(
'pt')
1139 category = cms.uint32(15),
1140 cut = cms.string(
'RecoTauTag_antiElectronMVA_wGwGSF_EC'),
1141 variable = cms.string(
'pt')
1144 workingPoints = cms.vstring(
1153 _patTauDiscriminationByElectronRejectionMVA6Task = cms.Task(
1154 getattr(self.process,_byElectronRejectionMVA6Raw),
1155 getattr(self.process,_byElectronRejectionMVA6)
1157 _rerunMvaIsolationTask.add(_patTauDiscriminationByElectronRejectionMVA6Task)
1158 _rerunMvaIsolationSequence += cms.Sequence(_patTauDiscriminationByElectronRejectionMVA6Task)
1160 _againstElectronTauIDSources = cms.PSet(
1161 againstElectronMVA6Raw = self.tauIDMVAinputs(_byElectronRejectionMVA6,
"raw"),
1162 againstElectronMVA6category = self.tauIDMVAinputs(_byElectronRejectionMVA6,
"category"),
1163 againstElectronVLooseMVA6 = self.tauIDMVAinputs(_byElectronRejectionMVA6,
"_VLoose"),
1164 againstElectronLooseMVA6 = self.tauIDMVAinputs(_byElectronRejectionMVA6,
"_Loose"),
1165 againstElectronMediumMVA6 = self.tauIDMVAinputs(_byElectronRejectionMVA6,
"_Medium"),
1166 againstElectronTightMVA6 = self.tauIDMVAinputs(_byElectronRejectionMVA6,
"_Tight"),
1167 againstElectronVTightMVA6 = self.tauIDMVAinputs(_byElectronRejectionMVA6,
"_VTight")
1169 _tauIDSourcesWithAgainistEle = cms.PSet(
1170 tauIDSources.clone(),
1171 _againstElectronTauIDSources
1173 tauIDSources =_tauIDSourcesWithAgainistEle.clone()
1175 if "newDMPhase2v1" in self.toKeep:
1176 if self.debug:
print (
"Adding newDMPhase2v1 ID")
1178 return cms.PSet(inputTag = cms.InputTag(module), workingPointIndex = cms.int32(-1
if wp==
"raw" else -2
if wp==
"category" else getattr(self.process, module).workingPoints.index(wp)))
1179 _byIsolationNewDMMVAPhase2raw =
"rerunDiscriminationByIsolationMVADBnewDMwLTPhase2raw"+self.postfix
1180 setattr(self.process,_byIsolationNewDMMVAPhase2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
1181 PATTauProducer = self.originalTauName,
1182 Prediscriminants = noPrediscriminants,
1183 loadMVAfromDB =
True,
1184 mvaName =
'RecoTauTag_tauIdMVAIsoPhase2',
1185 mvaOpt =
'DBnewDMwLTwGJPhase2',
1189 _byIsolationNewDMMVAPhase2 =
"rerunDiscriminationByIsolationMVADBnewDMwLTPhase2"+self.postfix
1190 setattr(self.process,_byIsolationNewDMMVAPhase2,patDiscriminationByIsolationMVArun2v1.clone(
1191 PATTauProducer = self.originalTauName,
1192 Prediscriminants = noPrediscriminants,
1193 toMultiplex = _byIsolationNewDMMVAPhase2raw,
1194 loadMVAfromDB =
True,
1195 mvaOutput_normalization =
'RecoTauTag_tauIdMVAIsoPhase2_mvaOutput_normalization',
1196 mapping = cms.VPSet(
1198 category = cms.uint32(0),
1199 cut = cms.string(
"RecoTauTag_tauIdMVAIsoPhase2"),
1200 variable = cms.string(
"pt"),
1203 workingPoints = cms.vstring(
1213 _rerunIsolationMVADBnewDMwLTPhase2Task = cms.Task(
1214 getattr(self.process,_byIsolationNewDMMVAPhase2raw),
1215 getattr(self.process,_byIsolationNewDMMVAPhase2)
1217 _rerunMvaIsolationTask.add(_rerunIsolationMVADBnewDMwLTPhase2Task)
1218 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationMVADBnewDMwLTPhase2Task)
1220 tauIDSources.byIsolationMVADBnewDMwLTPhase2raw =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"raw")
1221 tauIDSources.byVVLooseIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VVLoose")
1222 tauIDSources.byVLooseIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VLoose")
1223 tauIDSources.byLooseIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_Loose")
1224 tauIDSources.byMediumIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_Medium")
1225 tauIDSources.byTightIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_Tight")
1226 tauIDSources.byVTightIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VTight")
1227 tauIDSources.byVVTightIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VVTight")
1229 if "againstElePhase2v1" in self.toKeep:
1230 if self.debug:
print (
"Adding anti-e Phase2v1 ID")
1233 from RecoTauTag.RecoTau.PATTauDiscriminationAgainstElectronMVA6Phase2_cff
import patTauDiscriminationAgainstElectronMVA6Phase2Raw, patTauDiscriminationAgainstElectronMVA6Phase2, mergedSlimmedElectronsForTauId
1234 _byElectronRejectionMVA6Phase2v1Raw =
"patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw"+self.postfix
1235 setattr(self.process,_byElectronRejectionMVA6Phase2v1Raw,patTauDiscriminationAgainstElectronMVA6Phase2Raw.clone(
1236 PATTauProducer = self.originalTauName,
1237 Prediscriminants = noPrediscriminants
1240 _byElectronRejectionMVA6Phase2v1 =
"patTauDiscriminationByElectronRejectionMVA6Phase2v1"+self.postfix
1241 setattr(self.process,_byElectronRejectionMVA6Phase2v1,patTauDiscriminationAgainstElectronMVA6Phase2.clone(
1242 PATTauProducer = self.originalTauName,
1243 Prediscriminants = noPrediscriminants,
1244 toMultiplex = _byElectronRejectionMVA6Phase2v1Raw
1247 if not hasattr(self.process,
"mergedSlimmedElectronsForTauId"):
1248 self.process.mergedSlimmedElectronsForTauId = mergedSlimmedElectronsForTauId
1249 _patTauDiscriminationByElectronRejectionMVA6Phase2v1Task = cms.Task(
1250 self.process.mergedSlimmedElectronsForTauId,
1251 getattr(self.process,_byElectronRejectionMVA6Phase2v1Raw),
1252 getattr(self.process,_byElectronRejectionMVA6Phase2v1)
1254 _rerunMvaIsolationTask.add(_patTauDiscriminationByElectronRejectionMVA6Phase2v1Task)
1255 _rerunMvaIsolationSequence += cms.Sequence(_patTauDiscriminationByElectronRejectionMVA6Phase2v1Task)
1257 _againstElectronTauIDPhase2v1Sources = cms.PSet(
1258 againstElectronMVA6RawPhase2v1 = self.tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"raw"),
1259 againstElectronMVA6categoryPhase2v1 = self.tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"category"),
1260 againstElectronVLooseMVA6Phase2v1 = self.tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_VLoose"),
1261 againstElectronLooseMVA6Phase2v1 = self.tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_Loose"),
1262 againstElectronMediumMVA6Phase2v1 = self.tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_Medium"),
1263 againstElectronTightMVA6Phase2v1 = self.tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_Tight"),
1264 againstElectronVTightMVA6Phase2v1 = self.tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_VTight")
1266 _tauIDSourcesWithAgainistElePhase2v1 = cms.PSet(
1267 tauIDSources.clone(),
1268 _againstElectronTauIDPhase2v1Sources
1270 tauIDSources =_tauIDSourcesWithAgainistElePhase2v1.clone()
1272 if self.debug:
print(
'Embedding new TauIDs into \"'+self.updatedTauName+
'\"')
1273 if not hasattr(self.process, self.updatedTauName):
1274 embedID = cms.EDProducer(
"PATTauIDEmbedder",
1275 src = cms.InputTag(self.originalTauName),
1276 tauIDSources = tauIDSources
1278 setattr(self.process, self.updatedTauName, embedID)
1280 tauIDSources = cms.PSet(
1281 getattr(self.process, self.updatedTauName).tauIDSources,
1283 getattr(self.process, self.updatedTauName).tauIDSources = tauIDSources
1284 if not hasattr(self.process,
"rerunMvaIsolationTask"+self.postfix):
1285 setattr(self.process,
"rerunMvaIsolationTask"+self.postfix,_rerunMvaIsolationTask)
1287 _updatedRerunMvaIsolationTask = getattr(self.process,
"rerunMvaIsolationTask"+self.postfix)
1288 _updatedRerunMvaIsolationTask.add(_rerunMvaIsolationTask)
1289 setattr(self.process,
"rerunMvaIsolationTask"+self.postfix,_updatedRerunMvaIsolationTask)
1290 if not hasattr(self.process,
"rerunMvaIsolationSequence"+self.postfix):
1291 setattr(self.process,
"rerunMvaIsolationSequence"+self.postfix,_rerunMvaIsolationSequence)
1293 _updatedRerunMvaIsolationSequence = getattr(self.process,
"rerunMvaIsolationSequence"+self.postfix)
1294 _updatedRerunMvaIsolationSequence += _rerunMvaIsolationSequence
1295 setattr(self.process,
"rerunMvaIsolationSequence"+self.postfix,_updatedRerunMvaIsolationSequence)
def tauIDMVAinputs(module, wp)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)