1 from __future__
import print_function
2 import FWCore.ParameterSet.Config
as cms
6 from RecoTauTag.RecoTau.DeepTauIdSonicProducer_cfi
import DeepTauIdSonicProducer
7 from RecoTauTag.RecoTau.tauIdWPsDefs
import WORKING_POINTS_v2p1, WORKING_POINTS_v2p5, WORKING_POINTS_PHASEII_v2p5
13 """class to rerun the tau seq and acces trainings from the database""" 14 availableDiscriminators = [
15 "2017v1",
"2017v2",
"newDM2017v2",
"dR0p32017v2",
"2016v1",
"newDM2016v1",
16 "deepTau2017v2",
"deepTau2017v2p1",
"deepTau2018v2p5",
"deepTau2026v2p5",
22 def __init__(self, process, debug = False,
23 originalTauName = "slimmedTaus",
24 updatedTauName = "slimmedTausNewID",
26 toKeep = ["deepTau2017v2p1", "deepTau2018v2p5", "deepTau2026v2p5"],
27 tauIdDiscrMVA_trainings_run2_2017 = { 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017", },
28 tauIdDiscrMVA_WPs_run2_2017 = {
29 'tauIdMVAIsoDBoldDMwLT2017' : {
30 'Eff95' :
"DBoldDMwLTEff95",
31 'Eff90' :
"DBoldDMwLTEff90",
32 'Eff80' :
"DBoldDMwLTEff80",
33 'Eff70' :
"DBoldDMwLTEff70",
34 'Eff60' :
"DBoldDMwLTEff60",
35 'Eff50' :
"DBoldDMwLTEff50",
36 'Eff40' :
"DBoldDMwLTEff40" 39 tauIdDiscrMVA_2017_version =
"v1",
42 super(TauIDEmbedder, self).
__init__()
48 self.
process.
load(
'RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi')
49 if len(conditionDB) != 0:
50 self.
process.CondDBTauConnection.connect = cms.string(conditionDB)
51 self.
process.loadRecoTauTagMVAsFromPrepDB.connect = cms.string(conditionDB)
61 if discr
not in TauIDEmbedder.availableDiscriminators:
62 raise RuntimeError(
'TauIDEmbedder: discriminator "{}" is not supported'.
format(discr))
67 """returns 'CMSSW_X_Y_Z'""" 68 cmssw_version = os.environ[
"CMSSW_VERSION"]
69 if debug:
print (
"get_cmssw_version:", cmssw_version)
74 """returns '(release, subversion, patch)' (without 'CMSSW_')""" 75 v = klass.get_cmssw_version().
split(
"CMSSW_")[1].
split(
"_")[0:3]
76 if debug:
print (
"get_cmssw_version_number:", v)
81 return int(v[0]),
int(v[1]), patch
85 version = release * 10000 + subversion * 100 + patch + 1
86 if debug:
print (
"versionToInt:", version)
92 split_cmssw_version = klass.get_cmssw_version_number()
93 if klass.versionToInt(release, subversion, patch) > klass.versionToInt(split_cmssw_version[0], split_cmssw_version[1], split_cmssw_version[2]):
94 if debug:
print (
"is_above_cmssw_version:",
False)
97 if debug:
print (
"is_above_cmssw_version:",
True)
101 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)))
104 if self.
debug:
print (
"loadMVA_WPs_run2_2017: performed")
108 self.
process.loadRecoTauTagMVAsFromPrepDB.toGet.append(
110 record = cms.string(
'GBRWrapperRcd'),
117 self.
process.loadRecoTauTagMVAsFromPrepDB.toGet.append(
119 record = cms.string(
'PhysicsTGraphPayloadRcd'),
125 self.
process.loadRecoTauTagMVAsFromPrepDB.toGet.append(
127 record = cms.string(
'PhysicsTFormulaPayloadRcd'),
134 _rerunMvaIsolationTask = cms.Task()
135 _rerunMvaIsolationSequence = cms.Sequence()
136 tauIDSources = cms.PSet()
139 if "2017v1" in self.
toKeep:
142 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017",
145 'tauIdMVAIsoDBoldDMwLT2017' : {
146 'Eff95' :
"DBoldDMwLTEff95",
147 'Eff90' :
"DBoldDMwLTEff90",
148 'Eff80' :
"DBoldDMwLTEff80",
149 'Eff70' :
"DBoldDMwLTEff70",
150 'Eff60' :
"DBoldDMwLTEff60",
151 'Eff50' :
"DBoldDMwLTEff50",
152 'Eff40' :
"DBoldDMwLTEff40" 157 if self.
debug:
print (
"runTauID: not is_above_cmssw_version(9, 4, 4). Will update the list of available in DB samples to access 2017v1")
160 _byIsolationOldDMMVArun2017v1raw =
"rerunDiscriminationByIsolationOldDMMVArun2017v1raw"+self.
postfix 161 setattr(self.
process,_byIsolationOldDMMVArun2017v1raw,patDiscriminationByIsolationMVArun2v1raw.clone(
163 Prediscriminants = noPrediscriminants,
164 loadMVAfromDB = cms.bool(
True),
165 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1"),
166 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
167 verbosity = cms.int32(0)
170 _byIsolationOldDMMVArun2017v1 =
"rerunDiscriminationByIsolationOldDMMVArun2017v1"+self.
postfix 171 setattr(self.
process,_byIsolationOldDMMVArun2017v1,patDiscriminationByIsolationMVArun2v1.clone(
173 Prediscriminants = noPrediscriminants,
174 toMultiplex = _byIsolationOldDMMVArun2017v1raw,
175 loadMVAfromDB = cms.bool(
True),
176 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_mvaOutput_normalization"),
179 category = cms.uint32(0),
180 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1"),
181 variable = cms.string(
"pt"),
184 workingPoints = cms.vstring(
195 _rerunIsolationOldDMMVArun2017v1Task = cms.Task(
196 getattr(self.
process,_byIsolationOldDMMVArun2017v1raw),
197 getattr(self.
process,_byIsolationOldDMMVArun2017v1)
199 _rerunMvaIsolationTask.add(_rerunIsolationOldDMMVArun2017v1Task)
200 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMMVArun2017v1Task)
202 tauIDSources.byIsolationMVArun2017v1DBoldDMwLTraw2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"raw")
203 tauIDSources.byVVLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff95")
204 tauIDSources.byVLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff90")
205 tauIDSources.byLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff80")
206 tauIDSources.byMediumIsolationMVArun2017v1DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff70")
207 tauIDSources.byTightIsolationMVArun2017v1DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff60")
208 tauIDSources.byVTightIsolationMVArun2017v1DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff50")
209 tauIDSources.byVVTightIsolationMVArun2017v1DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v1,
"_WPEff40")
212 if "2017v2" in self.
toKeep:
215 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017",
218 'tauIdMVAIsoDBoldDMwLT2017' : {
219 'Eff95' :
"DBoldDMwLTEff95",
220 'Eff90' :
"DBoldDMwLTEff90",
221 'Eff80' :
"DBoldDMwLTEff80",
222 'Eff70' :
"DBoldDMwLTEff70",
223 'Eff60' :
"DBoldDMwLTEff60",
224 'Eff50' :
"DBoldDMwLTEff50",
225 'Eff40' :
"DBoldDMwLTEff40" 230 if self.
debug:
print (
"runTauID: not is_above_cmssw_version(9, 4, 5). Will update the list of available in DB samples to access 2017v2")
233 _byIsolationOldDMMVArun2017v2raw =
"rerunDiscriminationByIsolationOldDMMVArun2017v2raw"+self.
postfix 234 setattr(self.
process,_byIsolationOldDMMVArun2017v2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
236 Prediscriminants = noPrediscriminants,
237 loadMVAfromDB = cms.bool(
True),
238 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2"),
239 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
240 verbosity = cms.int32(0)
243 _byIsolationOldDMMVArun2017v2 =
"rerunDiscriminationByIsolationOldDMMVArun2017v2"+self.
postfix 244 setattr(self.
process,_byIsolationOldDMMVArun2017v2,patDiscriminationByIsolationMVArun2v1.clone(
246 Prediscriminants = noPrediscriminants,
247 toMultiplex = _byIsolationOldDMMVArun2017v2raw,
248 loadMVAfromDB = cms.bool(
True),
249 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_mvaOutput_normalization"),
252 category = cms.uint32(0),
253 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2"),
254 variable = cms.string(
"pt"),
257 workingPoints = cms.vstring(
266 verbosity = cms.int32(0)
269 _rerunIsolationOldDMMVArun2017v2Task = cms.Task(
270 getattr(self.
process,_byIsolationOldDMMVArun2017v2raw),
271 getattr(self.
process,_byIsolationOldDMMVArun2017v2)
273 _rerunMvaIsolationTask.add(_rerunIsolationOldDMMVArun2017v2Task)
274 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMMVArun2017v2Task)
276 tauIDSources.byIsolationMVArun2017v2DBoldDMwLTraw2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"raw")
277 tauIDSources.byVVLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff95")
278 tauIDSources.byVLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff90")
279 tauIDSources.byLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff80")
280 tauIDSources.byMediumIsolationMVArun2017v2DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff70")
281 tauIDSources.byTightIsolationMVArun2017v2DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff60")
282 tauIDSources.byVTightIsolationMVArun2017v2DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff50")
283 tauIDSources.byVVTightIsolationMVArun2017v2DBoldDMwLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2017v2,
"_WPEff40")
285 if "newDM2017v2" in self.
toKeep:
288 'tauIdMVAIsoDBnewDMwLT2017' :
"tauIdMVAIsoDBnewDMwLT2017",
291 'tauIdMVAIsoDBnewDMwLT2017' : {
292 'Eff95' :
"DBnewDMwLTEff95",
293 'Eff90' :
"DBnewDMwLTEff90",
294 'Eff80' :
"DBnewDMwLTEff80",
295 'Eff70' :
"DBnewDMwLTEff70",
296 'Eff60' :
"DBnewDMwLTEff60",
297 'Eff50' :
"DBnewDMwLTEff50",
298 'Eff40' :
"DBnewDMwLTEff40" 303 if self.
debug:
print (
"runTauID: not is_above_cmssw_version(9, 4, 5). Will update the list of available in DB samples to access newDM2017v2")
306 _byIsolationNewDMMVArun2017v2raw =
"rerunDiscriminationByIsolationNewDMMVArun2017v2raw"+self.
postfix 307 setattr(self.
process,_byIsolationNewDMMVArun2017v2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
309 Prediscriminants = noPrediscriminants,
310 loadMVAfromDB = cms.bool(
True),
311 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2"),
312 mvaOpt = cms.string(
"DBnewDMwLTwGJ"),
313 verbosity = cms.int32(0)
316 _byIsolationNewDMMVArun2017v2 =
"rerunDiscriminationByIsolationNewDMMVArun2017v2"+self.
postfix 317 setattr(self.
process,_byIsolationNewDMMVArun2017v2,patDiscriminationByIsolationMVArun2v1.clone(
319 Prediscriminants = noPrediscriminants,
320 toMultiplex = _byIsolationNewDMMVArun2017v2raw,
321 loadMVAfromDB = cms.bool(
True),
322 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_mvaOutput_normalization"),
325 category = cms.uint32(0),
326 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2"),
327 variable = cms.string(
"pt"),
330 workingPoints = cms.vstring(
339 verbosity = cms.int32(0)
342 _rerunIsolationNewDMMVArun2017v2Task = cms.Task(
343 getattr(self.
process,_byIsolationNewDMMVArun2017v2raw),
344 getattr(self.
process,_byIsolationNewDMMVArun2017v2)
346 _rerunMvaIsolationTask.add(_rerunIsolationNewDMMVArun2017v2Task)
347 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationNewDMMVArun2017v2Task)
349 tauIDSources.byIsolationMVArun2017v2DBnewDMwLTraw2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"raw")
350 tauIDSources.byVVLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff95")
351 tauIDSources.byVLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff90")
352 tauIDSources.byLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff80")
353 tauIDSources.byMediumIsolationMVArun2017v2DBnewDMwLT2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff70")
354 tauIDSources.byTightIsolationMVArun2017v2DBnewDMwLT2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff60")
355 tauIDSources.byVTightIsolationMVArun2017v2DBnewDMwLT2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff50")
356 tauIDSources.byVVTightIsolationMVArun2017v2DBnewDMwLT2017 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2017v2,
"_WPEff40")
358 if "dR0p32017v2" in self.
toKeep:
361 'tauIdMVAIsoDBoldDMdR0p3wLT2017' :
"tauIdMVAIsoDBoldDMdR0p3wLT2017",
364 'tauIdMVAIsoDBoldDMdR0p3wLT2017' : {
365 'Eff95' :
"DBoldDMdR0p3wLTEff95",
366 'Eff90' :
"DBoldDMdR0p3wLTEff90",
367 'Eff80' :
"DBoldDMdR0p3wLTEff80",
368 'Eff70' :
"DBoldDMdR0p3wLTEff70",
369 'Eff60' :
"DBoldDMdR0p3wLTEff60",
370 'Eff50' :
"DBoldDMdR0p3wLTEff50",
371 'Eff40' :
"DBoldDMdR0p3wLTEff40" 376 if self.
debug:
print (
"runTauID: not is_above_cmssw_version(9, 4, 5). Will update the list of available in DB samples to access dR0p32017v2")
379 _byIsolationOldDMdR0p3MVArun2017v2raw =
"rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2raw"+self.
postfix 380 setattr(self.
process,_byIsolationOldDMdR0p3MVArun2017v2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
382 Prediscriminants = noPrediscriminants,
383 loadMVAfromDB = cms.bool(
True),
384 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2"),
385 mvaOpt = cms.string(
"DBoldDMwLTwGJ"),
386 srcChargedIsoPtSum = cms.string(
'chargedIsoPtSumdR03'),
387 srcFootprintCorrection = cms.string(
'footprintCorrectiondR03'),
388 srcNeutralIsoPtSum = cms.string(
'neutralIsoPtSumdR03'),
389 srcPhotonPtSumOutsideSignalCone = cms.string(
'photonPtSumOutsideSignalConedR03'),
390 verbosity = cms.int32(0)
393 _byIsolationOldDMdR0p3MVArun2017v2 =
"rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2"+self.
postfix 394 setattr(self.
process,_byIsolationOldDMdR0p3MVArun2017v2,patDiscriminationByIsolationMVArun2v1.clone(
396 Prediscriminants = noPrediscriminants,
397 toMultiplex = _byIsolationOldDMdR0p3MVArun2017v2raw,
398 loadMVAfromDB = cms.bool(
True),
399 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_mvaOutput_normalization"),
402 category = cms.uint32(0),
403 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2"),
404 variable = cms.string(
"pt"),
407 workingPoints = cms.vstring(
416 verbosity = cms.int32(0)
419 _rerunIsolationOldDMdR0p3MVArun2017v2Task = cms.Task(
420 getattr(self.
process,_byIsolationOldDMdR0p3MVArun2017v2raw),
421 getattr(self.
process,_byIsolationOldDMdR0p3MVArun2017v2)
423 _rerunMvaIsolationTask.add(_rerunIsolationOldDMdR0p3MVArun2017v2Task)
424 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMdR0p3MVArun2017v2Task)
426 tauIDSources.byIsolationMVArun2017v2DBoldDMdR0p3wLTraw2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"raw")
427 tauIDSources.byVVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff95")
428 tauIDSources.byVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff90")
429 tauIDSources.byLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff80")
430 tauIDSources.byMediumIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff70")
431 tauIDSources.byTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff60")
432 tauIDSources.byVTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff50")
433 tauIDSources.byVVTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.
tauIDMVAinputs(_byIsolationOldDMdR0p3MVArun2017v2,
"_WPEff40")
462 if "2016v1" in self.
toKeep:
463 _byIsolationOldDMMVArun2016v1raw =
"rerunDiscriminationByIsolationOldDMMVArun2v1raw"+self.
postfix 464 setattr(self.
process,_byIsolationOldDMMVArun2016v1raw,patDiscriminationByIsolationMVArun2v1raw.clone(
466 Prediscriminants = noPrediscriminants,
467 loadMVAfromDB = cms.bool(
True),
468 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1"),
469 mvaOpt = cms.string(
"DBoldDMwLT"),
470 verbosity = cms.int32(0)
473 _byIsolationOldDMMVArun2016v1 =
"rerunDiscriminationByIsolationOldDMMVArun2v1"+self.
postfix 474 setattr(self.
process,_byIsolationOldDMMVArun2016v1,patDiscriminationByIsolationMVArun2v1.clone(
476 Prediscriminants = noPrediscriminants,
477 toMultiplex = _byIsolationOldDMMVArun2016v1raw,
478 loadMVAfromDB = cms.bool(
True),
479 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_mvaOutput_normalization"),
482 category = cms.uint32(0),
483 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1"),
484 variable = cms.string(
"pt"),
487 workingPoints = cms.vstring(
497 _rerunIsolationOldDMMVArun2016v1Task = cms.Task(
498 getattr(self.
process,_byIsolationOldDMMVArun2016v1raw),
499 getattr(self.
process,_byIsolationOldDMMVArun2016v1)
501 _rerunMvaIsolationTask.add(_rerunIsolationOldDMMVArun2016v1Task)
502 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationOldDMMVArun2016v1Task)
504 tauIDSources.byIsolationMVArun2v1DBoldDMwLTraw2016 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"raw")
505 tauIDSources.byVLooseIsolationMVArun2v1DBoldDMwLT2016 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff90")
506 tauIDSources.byLooseIsolationMVArun2v1DBoldDMwLT2016 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff80")
507 tauIDSources.byMediumIsolationMVArun2v1DBoldDMwLT2016 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff70")
508 tauIDSources.byTightIsolationMVArun2v1DBoldDMwLT2016 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff60")
509 tauIDSources.byVTightIsolationMVArun2v1DBoldDMwLT2016 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff50")
510 tauIDSources.byVVTightIsolationMVArun2v1DBoldDMwLT2016 = self.
tauIDMVAinputs(_byIsolationOldDMMVArun2016v1,
"_WPEff40")
513 if "newDM2016v1" in self.
toKeep:
514 _byIsolationNewDMMVArun2016v1raw =
"rerunDiscriminationByIsolationNewDMMVArun2v1raw"+self.
postfix 515 setattr(self.
process,_byIsolationNewDMMVArun2016v1raw,patDiscriminationByIsolationMVArun2v1raw.clone(
517 Prediscriminants = noPrediscriminants,
518 loadMVAfromDB = cms.bool(
True),
519 mvaName = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1"),
520 mvaOpt = cms.string(
"DBnewDMwLT"),
521 verbosity = cms.int32(0)
524 _byIsolationNewDMMVArun2016v1 =
"rerunDiscriminationByIsolationNewDMMVArun2v1"+self.
postfix 525 setattr(self.
process,_byIsolationNewDMMVArun2016v1,patDiscriminationByIsolationMVArun2v1.clone(
527 Prediscriminants = noPrediscriminants,
528 toMultiplex = _byIsolationNewDMMVArun2016v1raw,
529 loadMVAfromDB = cms.bool(
True),
530 mvaOutput_normalization = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_mvaOutput_normalization"),
533 category = cms.uint32(0),
534 cut = cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_WPEff90"),
535 variable = cms.string(
"pt"),
538 workingPoints = cms.vstring(
548 _rerunIsolationNewDMMVArun2016v1Task = cms.Task(
549 getattr(self.
process,_byIsolationNewDMMVArun2016v1raw),
550 getattr(self.
process,_byIsolationNewDMMVArun2016v1)
552 _rerunMvaIsolationTask.add(_rerunIsolationNewDMMVArun2016v1Task)
553 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationNewDMMVArun2016v1Task)
555 tauIDSources.byIsolationMVArun2v1DBnewDMwLTraw2016 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"raw")
556 tauIDSources.byVLooseIsolationMVArun2v1DBnewDMwLT2016 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff90")
557 tauIDSources.byLooseIsolationMVArun2v1DBnewDMwLT2016 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff80")
558 tauIDSources.byMediumIsolationMVArun2v1DBnewDMwLT2016 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff70")
559 tauIDSources.byTightIsolationMVArun2v1DBnewDMwLT2016 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff60")
560 tauIDSources.byVTightIsolationMVArun2v1DBnewDMwLT2016 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff50")
561 tauIDSources.byVVTightIsolationMVArun2v1DBnewDMwLT2016 = self.
tauIDMVAinputs(_byIsolationNewDMMVArun2016v1,
"_WPEff40")
563 if "deepTau2017v2" in self.
toKeep:
564 if self.
debug:
print (
"Adding DeepTau v2 IDs")
566 _deepTauName =
"deepTau2017v2" 567 workingPoints_ = WORKING_POINTS_v2p1
570 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_core.pb',
571 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_inner.pb',
572 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_outer.pb',
576 Prediscriminants = noPrediscriminants,
578 graph_file = file_names,
579 year = full_version[0],
580 version = full_version[1],
584 _deepTauProducer = getattr(self.
process,_deepTauName+self.
postfix)
586 from Configuration.ProcessModifiers.deepTauSonicTriton_cff
import deepTauSonicTriton
587 deepTauSonicTriton.toReplaceWith(_deepTauProducer, DeepTauIdSonicProducer.clone(
589 mode = cms.string(
'PseudoAsync'),
590 allowedTries = cms.untracked.uint32(0),
591 verbose = cms.untracked.bool(
False),
592 modelName = cms.string(
"deeptau_2017v2p1"),
593 modelVersion = cms.string(
''),
594 modelConfigPath = cms.FileInPath(
"RecoTauTag/TrainingFiles/data/DeepTauIdSONIC/deeptau_2017v2p1/config.pbtxt"),
595 preferredServer = cms.untracked.string(
''),
596 timeout = cms.untracked.uint32(300),
597 useSharedMemory = cms.untracked.bool(
True),
598 compression = cms.untracked.string(
''),
599 outputs = cms.untracked.vstring()
601 Prediscriminants = noPrediscriminants,
603 year = full_version[0],
604 version = full_version[1],
610 _rerunMvaIsolationTask.add(_deepTauProducer)
611 _rerunMvaIsolationSequence += _deepTauProducer
614 if "deepTau2017v2p1" in self.
toKeep:
615 if self.
debug:
print (
"Adding DeepTau v2p1 IDs")
617 _deepTauName =
"deepTau2017v2p1" 618 workingPoints_ = WORKING_POINTS_v2p1
621 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_core.pb',
622 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_inner.pb',
623 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v2p6_e6_outer.pb',
627 Prediscriminants = noPrediscriminants,
629 graph_file = file_names,
630 year = full_version[0],
631 version = full_version[1],
633 disable_dxy_pca =
True 636 _deepTauProducer = getattr(self.
process,_deepTauName+self.
postfix)
638 from Configuration.ProcessModifiers.deepTauSonicTriton_cff
import deepTauSonicTriton
639 deepTauSonicTriton.toReplaceWith(_deepTauProducer, DeepTauIdSonicProducer.clone(
641 mode = cms.string(
'PseudoAsync'),
642 allowedTries = cms.untracked.uint32(0),
643 verbose = cms.untracked.bool(
False),
644 modelName = cms.string(
"deeptau_2017v2p1"),
645 modelVersion = cms.string(
''),
646 modelConfigPath = cms.FileInPath(
"RecoTauTag/TrainingFiles/data/DeepTauIdSONIC/deeptau_2017v2p1/config.pbtxt"),
647 preferredServer = cms.untracked.string(
''),
648 timeout = cms.untracked.uint32(300),
649 useSharedMemory = cms.untracked.bool(
True),
650 compression = cms.untracked.string(
''),
651 outputs = cms.untracked.vstring()
653 Prediscriminants = noPrediscriminants,
655 year = full_version[0],
656 version = full_version[1],
658 disable_dxy_pca =
True 663 _rerunMvaIsolationTask.add(_deepTauProducer)
664 _rerunMvaIsolationSequence += _deepTauProducer
666 if "deepTau2018v2p5" in self.
toKeep:
667 if self.
debug:
print (
"Adding DeepTau v2p5 IDs")
669 _deepTauName =
"deepTau2018v2p5" 670 workingPoints_ = WORKING_POINTS_v2p5
673 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2018v2p5_core.pb',
674 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2018v2p5_inner.pb',
675 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2018v2p5_outer.pb',
679 Prediscriminants = noPrediscriminants,
681 graph_file = file_names,
682 year = full_version[0],
683 version = full_version[1],
684 sub_version = full_version[2],
685 disable_dxy_pca =
True,
686 disable_hcalFraction_workaround =
True,
687 disable_CellIndex_workaround =
True 690 _deepTauProducer = getattr(self.
process,_deepTauName+self.
postfix)
692 from Configuration.ProcessModifiers.deepTauSonicTriton_cff
import deepTauSonicTriton
693 deepTauSonicTriton.toReplaceWith(_deepTauProducer, DeepTauIdSonicProducer.clone(
695 mode = cms.string(
'PseudoAsync'),
696 allowedTries = cms.untracked.uint32(0),
697 verbose = cms.untracked.bool(
False),
698 modelName = cms.string(
"deeptau_2018v2p5"),
699 modelVersion = cms.string(
''),
700 modelConfigPath = cms.FileInPath(
"RecoTauTag/TrainingFiles/data/DeepTauIdSONIC/deeptau_2018v2p5/config.pbtxt"),
701 preferredServer = cms.untracked.string(
''),
702 timeout = cms.untracked.uint32(300),
703 useSharedMemory = cms.untracked.bool(
True),
704 compression = cms.untracked.string(
''),
705 outputs = cms.untracked.vstring(),
707 Prediscriminants = noPrediscriminants,
709 year = full_version[0],
710 version = full_version[1],
711 sub_version = full_version[2],
712 disable_dxy_pca =
True,
713 disable_hcalFraction_workaround =
True,
714 disable_CellIndex_workaround =
True 719 _rerunMvaIsolationTask.add(_deepTauProducer)
720 _rerunMvaIsolationSequence += _deepTauProducer
722 if "deepTau2026v2p5" in self.
toKeep:
723 if self.
debug:
print (
"Adding Phase2 DeepTau v2p5 IDs")
725 _deepTauName =
"deepTau2026v2p5" 726 workingPoints_ = WORKING_POINTS_PHASEII_v2p5
729 'core:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2026v2p5_core.pb',
730 'inner:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2026v2p5_inner.pb',
731 'outer:RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2026v2p5_outer.pb',
735 Prediscriminants = noPrediscriminants,
737 graph_file = file_names,
738 year = full_version[0],
739 version = full_version[1],
740 sub_version = full_version[2],
741 disable_dxy_pca =
True,
742 disable_hcalFraction_workaround =
True,
743 disable_CellIndex_workaround =
True 746 from RecoTauTag.RecoTau.mergedPhase2SlimmedElectronsForTauId_cff
import mergedSlimmedElectronsForTauId
747 if not hasattr(self.
process,
"mergedSlimmedElectronsForTauId"):
748 self.
process.mergedSlimmedElectronsForTauId = mergedSlimmedElectronsForTauId
749 setattr(getattr(self.
process, _deepTauName+self.
postfix),
"electrons", cms.InputTag(
"mergedSlimmedElectronsForTauId"))
750 setattr(getattr(self.
process, _deepTauName+self.
postfix),
"vertices", cms.InputTag(
"offlineSlimmedPrimaryVertices4D"))
754 _deepTauProducer = getattr(self.
process,_deepTauName+self.
postfix)
755 _rerunMvaIsolationTask.add(self.
process.mergedSlimmedElectronsForTauId)
756 _rerunMvaIsolationTask.add(_deepTauProducer)
757 _rerunMvaIsolationSequence += self.
process.mergedSlimmedElectronsForTauId
758 _rerunMvaIsolationSequence += _deepTauProducer
760 if "againstEle2018" in self.
toKeep:
761 antiElectronDiscrMVA6_version =
"MVA6v3_noeveto" 765 _byElectronRejectionMVA62018Raw =
"patTauDiscriminationByElectronRejectionMVA62018Raw"+self.
postfix 766 setattr(self.
process,_byElectronRejectionMVA62018Raw,patTauDiscriminationAgainstElectronMVA6.clone(
768 Prediscriminants = noPrediscriminants,
769 srcElectrons = cms.InputTag(
'slimmedElectrons'),
770 vetoEcalCracks = cms.bool(
False),
771 mvaName_NoEleMatch_wGwoGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL',
772 mvaName_NoEleMatch_wGwoGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC',
773 mvaName_NoEleMatch_woGwoGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL',
774 mvaName_NoEleMatch_woGwoGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC',
775 mvaName_wGwGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL',
776 mvaName_wGwGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC',
777 mvaName_woGwGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL',
778 mvaName_woGwGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC' 782 _byElectronRejectionMVA62018 =
"patTauDiscriminationByElectronRejectionMVA62018"+self.
postfix 783 setattr(self.
process,
"patTauDiscriminationByElectronRejectionMVA62018"+self.
postfix,patTauDiscriminantCutMultiplexer.clone(
785 Prediscriminants = noPrediscriminants,
786 toMultiplex = _byElectronRejectionMVA62018Raw,
789 category = cms.uint32(0),
790 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL'),
791 variable = cms.string(
'pt')
794 category = cms.uint32(2),
795 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL'),
796 variable = cms.string(
'pt')
799 category = cms.uint32(5),
800 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL'),
801 variable = cms.string(
'pt')
804 category = cms.uint32(7),
805 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL'),
806 variable = cms.string(
'pt')
809 category = cms.uint32(8),
810 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC'),
811 variable = cms.string(
'pt')
814 category = cms.uint32(10),
815 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC'),
816 variable = cms.string(
'pt')
819 category = cms.uint32(13),
820 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC'),
821 variable = cms.string(
'pt')
824 category = cms.uint32(15),
825 cut = cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC'),
826 variable = cms.string(
'pt')
829 workingPoints = cms.vstring(
838 _patTauDiscriminationByElectronRejectionMVA62018Task = cms.Task(
839 getattr(self.
process,_byElectronRejectionMVA62018Raw),
840 getattr(self.
process,_byElectronRejectionMVA62018)
842 _rerunMvaIsolationTask.add(_patTauDiscriminationByElectronRejectionMVA62018Task)
843 _rerunMvaIsolationSequence += cms.Sequence(_patTauDiscriminationByElectronRejectionMVA62018Task)
845 _againstElectronTauIDSources = cms.PSet(
846 againstElectronMVA6Raw2018 = self.
tauIDMVAinputs(_byElectronRejectionMVA62018,
"raw"),
847 againstElectronMVA6category2018 = self.
tauIDMVAinputs(_byElectronRejectionMVA62018,
"category"),
848 againstElectronVLooseMVA62018 = self.
tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff98"),
849 againstElectronLooseMVA62018 = self.
tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff90"),
850 againstElectronMediumMVA62018 = self.
tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff80"),
851 againstElectronTightMVA62018 = self.
tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff70"),
852 againstElectronVTightMVA62018 = self.
tauIDMVAinputs(_byElectronRejectionMVA62018,
"_WPeff60")
854 _tauIDSourcesWithAgainistEle = cms.PSet(
855 tauIDSources.clone(),
856 _againstElectronTauIDSources
858 tauIDSources =_tauIDSourcesWithAgainistEle.clone()
860 if "newDMPhase2v1" in self.
toKeep:
861 if self.
debug:
print (
"Adding newDMPhase2v1 ID")
863 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)))
864 _byIsolationNewDMMVAPhase2raw =
"rerunDiscriminationByIsolationMVADBnewDMwLTPhase2raw"+self.
postfix 865 setattr(self.
process,_byIsolationNewDMMVAPhase2raw,patDiscriminationByIsolationMVArun2v1raw.clone(
867 Prediscriminants = noPrediscriminants,
868 loadMVAfromDB =
True,
869 mvaName =
'RecoTauTag_tauIdMVAIsoPhase2',
870 mvaOpt =
'DBnewDMwLTwGJPhase2',
874 _byIsolationNewDMMVAPhase2 =
"rerunDiscriminationByIsolationMVADBnewDMwLTPhase2"+self.
postfix 875 setattr(self.
process,_byIsolationNewDMMVAPhase2,patDiscriminationByIsolationMVArun2v1.clone(
877 Prediscriminants = noPrediscriminants,
878 toMultiplex = _byIsolationNewDMMVAPhase2raw,
879 loadMVAfromDB =
True,
880 mvaOutput_normalization =
'RecoTauTag_tauIdMVAIsoPhase2_mvaOutput_normalization',
883 category = cms.uint32(0),
884 cut = cms.string(
"RecoTauTag_tauIdMVAIsoPhase2"),
885 variable = cms.string(
"pt"),
888 workingPoints = cms.vstring(
898 _rerunIsolationMVADBnewDMwLTPhase2Task = cms.Task(
899 getattr(self.
process,_byIsolationNewDMMVAPhase2raw),
900 getattr(self.
process,_byIsolationNewDMMVAPhase2)
902 _rerunMvaIsolationTask.add(_rerunIsolationMVADBnewDMwLTPhase2Task)
903 _rerunMvaIsolationSequence += cms.Sequence(_rerunIsolationMVADBnewDMwLTPhase2Task)
905 tauIDSources.byIsolationMVADBnewDMwLTPhase2raw =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"raw")
906 tauIDSources.byVVLooseIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VVLoose")
907 tauIDSources.byVLooseIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VLoose")
908 tauIDSources.byLooseIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_Loose")
909 tauIDSources.byMediumIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_Medium")
910 tauIDSources.byTightIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_Tight")
911 tauIDSources.byVTightIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VTight")
912 tauIDSources.byVVTightIsolationMVADBnewDMwLTPhase2 =
tauIDMVAinputs(_byIsolationNewDMMVAPhase2,
"_VVTight")
914 if "againstElePhase2v1" in self.
toKeep:
915 if self.
debug:
print (
"Adding anti-e Phase2v1 ID")
918 from RecoTauTag.RecoTau.PATTauDiscriminationAgainstElectronMVA6Phase2_cff
import patTauDiscriminationAgainstElectronMVA6Phase2Raw, patTauDiscriminationAgainstElectronMVA6Phase2, mergedSlimmedElectronsForTauId
919 _byElectronRejectionMVA6Phase2v1Raw =
"patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw"+self.
postfix 920 setattr(self.
process,_byElectronRejectionMVA6Phase2v1Raw,patTauDiscriminationAgainstElectronMVA6Phase2Raw.clone(
922 Prediscriminants = noPrediscriminants
925 _byElectronRejectionMVA6Phase2v1 =
"patTauDiscriminationByElectronRejectionMVA6Phase2v1"+self.
postfix 926 setattr(self.
process,_byElectronRejectionMVA6Phase2v1,patTauDiscriminationAgainstElectronMVA6Phase2.clone(
928 Prediscriminants = noPrediscriminants,
929 toMultiplex = _byElectronRejectionMVA6Phase2v1Raw
932 if not hasattr(self.
process,
"mergedSlimmedElectronsForTauId"):
933 self.
process.mergedSlimmedElectronsForTauId = mergedSlimmedElectronsForTauId
934 _patTauDiscriminationByElectronRejectionMVA6Phase2v1Task = cms.Task(
935 self.
process.mergedSlimmedElectronsForTauId,
936 getattr(self.
process,_byElectronRejectionMVA6Phase2v1Raw),
937 getattr(self.
process,_byElectronRejectionMVA6Phase2v1)
939 _rerunMvaIsolationTask.add(_patTauDiscriminationByElectronRejectionMVA6Phase2v1Task)
940 _rerunMvaIsolationSequence += cms.Sequence(_patTauDiscriminationByElectronRejectionMVA6Phase2v1Task)
942 _againstElectronTauIDPhase2v1Sources = cms.PSet(
943 againstElectronMVA6RawPhase2v1 = self.
tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"raw"),
944 againstElectronMVA6categoryPhase2v1 = self.
tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"category"),
945 againstElectronVLooseMVA6Phase2v1 = self.
tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_VLoose"),
946 againstElectronLooseMVA6Phase2v1 = self.
tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_Loose"),
947 againstElectronMediumMVA6Phase2v1 = self.
tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_Medium"),
948 againstElectronTightMVA6Phase2v1 = self.
tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_Tight"),
949 againstElectronVTightMVA6Phase2v1 = self.
tauIDMVAinputs(_byElectronRejectionMVA6Phase2v1,
"_VTight")
951 _tauIDSourcesWithAgainistElePhase2v1 = cms.PSet(
952 tauIDSources.clone(),
953 _againstElectronTauIDPhase2v1Sources
955 tauIDSources =_tauIDSourcesWithAgainistElePhase2v1.clone()
959 embedID = cms.EDProducer(
"PATTauIDEmbedder",
961 tauIDSources = tauIDSources
965 tauIDSources = cms.PSet(
969 if not hasattr(self.
process,
"rerunMvaIsolationTask"+self.
postfix):
970 setattr(self.
process,
"rerunMvaIsolationTask"+self.
postfix,_rerunMvaIsolationTask)
972 _updatedRerunMvaIsolationTask = getattr(self.
process,
"rerunMvaIsolationTask"+self.
postfix)
973 _updatedRerunMvaIsolationTask.add(_rerunMvaIsolationTask)
974 setattr(self.
process,
"rerunMvaIsolationTask"+self.
postfix,_updatedRerunMvaIsolationTask)
975 if not hasattr(self.
process,
"rerunMvaIsolationSequence"+self.
postfix):
976 setattr(self.
process,
"rerunMvaIsolationSequence"+self.
postfix,_rerunMvaIsolationSequence)
978 _updatedRerunMvaIsolationSequence = getattr(self.
process,
"rerunMvaIsolationSequence"+self.
postfix)
979 _updatedRerunMvaIsolationSequence += _rerunMvaIsolationSequence
980 setattr(self.
process,
"rerunMvaIsolationSequence"+self.
postfix,_updatedRerunMvaIsolationSequence)
984 for target,points
in workingPoints_.items():
985 setattr(tauIDSources,
'by{}VS{}raw'.
format(producer_name[0].upper()+producer_name[1:], target),
986 cms.PSet(inputTag = cms.InputTag(producer_name+self.
postfix,
'VS{}'.
format(target)), workingPointIndex = cms.int32(-1)))
989 for index, (point,cut)
in enumerate(points.items()):
990 cut_expressions.append(
str(cut))
992 setattr(tauIDSources,
'by{}{}VS{}'.
format(point, producer_name[0].upper()+producer_name[1:], target),
993 cms.PSet(inputTag = cms.InputTag(producer_name+self.
postfix,
'VS{}'.
format(target)), workingPointIndex = cms.int32(index)))
994 if len(cut_expressions) > 0:
995 setattr(getattr(self.
process, producer_name+self.
postfix),
'VS{}WP'.
format(target), cms.vstring(*cut_expressions))
999 """returns the DeepTau year, version, subversion. File name should contain a version label with data takig year \ 1000 (2011-2, 2015-8), version number (vX) and subversion (pX), e.g. 2017v0p6, in general the following format: \ 1001 {year}v{version}p{subversion}""" 1002 version_search = re.search(
'(20[1,2][125678])v([0-9]+)(p[0-9]+|)[\._]', file_name)
1003 if not version_search:
1004 raise RuntimeError(
'File "{}" has an invalid name pattern, should be in the format "{year}v{version}p{subversion}". \ 1005 Unable to extract version number.'.
format(file_name))
1006 year = version_search.group(1)
1007 version = version_search.group(2)
1008 subversion = version_search.group(3)
1009 if len(subversion) > 0:
1010 subversion = subversion[1:]
1013 return int(year),
int(version),
int(subversion)
tauIdDiscrMVA_2017_version
def is_above_cmssw_version(klass, release=9, subversion=4, patch=0, debug=False)
def getDeepTauVersion(self, file_name)
def get_cmssw_version_number(klass, debug=False)
tauIdDiscrMVA_WPs_run2_2017
def get_cmssw_version(debug=False)
tauIdDiscrMVA_trainings_run2_2017
def loadMVA_WPs_run2_2017(self)
def processDeepProducer(self, producer_name, tauIDSources, workingPoints_)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def split(sequence, size)
def tauIDMVAinputs(self, module, wp)
def versionToInt(release=9, subversion=4, patch=0, debug=False)