7 """class to rerun the tau seq and acces trainings from the database""" 9 def __init__(self, process, cms, debug = False,
10 updatedTauName =
"slimmedTausNewID",
11 toKeep = [
"2016v1",
"newDM2016v1",
"deepTau2017v1",
"DPFTau_2016_v0"],
12 tauIdDiscrMVA_trainings_run2_2017 = {
13 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017",
15 tauIdDiscrMVA_WPs_run2_2017 = {
16 'tauIdMVAIsoDBoldDMwLT2017' : {
17 'Eff95' :
"DBoldDMwLTEff95",
18 'Eff90' :
"DBoldDMwLTEff90",
19 'Eff80' :
"DBoldDMwLTEff80",
20 'Eff70' :
"DBoldDMwLTEff70",
21 'Eff60' :
"DBoldDMwLTEff60",
22 'Eff50' :
"DBoldDMwLTEff50",
23 'Eff40' :
"DBoldDMwLTEff40" 26 tauIdDiscrMVA_2017_version =
"v1",
29 super(TauIDEmbedder, self).
__init__()
34 self.process.load(
'RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi')
35 if len(conditionDB) != 0:
36 self.process.CondDBTauConnection.connect = cms.string(conditionDB)
37 self.process.loadRecoTauTagMVAsFromPrepDB.connect = cms.string(conditionDB)
51 """returns 'CMSSW_X_Y_Z'""" 52 cmssw_version = os.environ[
"CMSSW_VERSION"]
53 if debug:
print "get_cmssw_version:", cmssw_version
58 """returns '(release, subversion, patch)' (without 'CMSSW_')""" 59 v = klass.get_cmssw_version().
split(
"CMSSW_")[1].
split(
"_")[0:3]
60 if debug:
print "get_cmssw_version_number:", v
65 return int(v[0]),
int(v[1]), patch
69 version = release * 10000 + subversion * 100 + patch + 1
70 if debug:
print "versionToInt:", version
76 split_cmssw_version = klass.get_cmssw_version_number()
77 if klass.versionToInt(release, subversion, patch) > klass.versionToInt(split_cmssw_version[0], split_cmssw_version[1], split_cmssw_version[2]):
78 if debug:
print "is_above_cmssw_version:",
False 81 if debug:
print "is_above_cmssw_version:",
True 85 if self.
debug:
print "loadMVA_WPs_run2_2017: performed" 87 for training, gbrForestName
in self.tauIdDiscrMVA_trainings_run2_2017.items():
89 self.process.loadRecoTauTagMVAsFromPrepDB.toGet.append(
91 record = self.cms.string(
'GBRWrapperRcd'),
98 self.process.loadRecoTauTagMVAsFromPrepDB.toGet.append(
100 record = self.cms.string(
'PhysicsTGraphPayloadRcd'),
106 self.process.loadRecoTauTagMVAsFromPrepDB.toGet.append(
108 record = self.cms.string(
'PhysicsTFormulaPayloadRcd'),
110 label = self.cms.untracked.string(
"RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, self.
tauIdDiscrMVA_2017_version))
115 self.process.rerunMvaIsolationTask = self.cms.Task()
116 self.process.rerunMvaIsolationSequence = self.cms.Sequence()
117 tauIDSources = self.cms.PSet()
120 if "2017v1" in self.
toKeep:
123 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017",
126 'tauIdMVAIsoDBoldDMwLT2017' : {
127 'Eff95' :
"DBoldDMwLTEff95",
128 'Eff90' :
"DBoldDMwLTEff90",
129 'Eff80' :
"DBoldDMwLTEff80",
130 'Eff70' :
"DBoldDMwLTEff70",
131 'Eff60' :
"DBoldDMwLTEff60",
132 'Eff50' :
"DBoldDMwLTEff50",
133 'Eff40' :
"DBoldDMwLTEff40" 138 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" 141 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1raw = patDiscriminationByIsolationMVArun2v1raw.clone(
142 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
143 Prediscriminants = noPrediscriminants,
144 loadMVAfromDB = self.cms.bool(
True),
145 mvaName = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1"),
146 mvaOpt = self.cms.string(
"DBoldDMwLTwGJ"),
147 requireDecayMode = self.cms.bool(
True),
148 verbosity = self.cms.int32(0)
151 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose = patDiscriminationByIsolationMVArun2v1VLoose.clone(
152 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
153 Prediscriminants = noPrediscriminants,
154 toMultiplex = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1raw'),
155 key = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1raw:category'),
156 loadMVAfromDB = self.cms.bool(
True),
157 mvaOutput_normalization = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_mvaOutput_normalization"),
158 mapping = self.cms.VPSet(
160 category = self.cms.uint32(0),
161 cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff90"),
162 variable = self.cms.string(
"pt"),
167 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VVLoose = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose.clone()
168 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VVLoose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff95")
169 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Loose = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose.clone()
170 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Loose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff80")
171 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Medium = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose.clone()
172 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Medium.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff70")
173 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Tight = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose.clone()
174 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Tight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff60")
175 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VTight = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose.clone()
176 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff50")
177 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VVTight = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose.clone()
178 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VVTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v1_WPEff40")
181 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1raw,
182 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose,
183 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VVLoose,
184 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Loose,
185 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Medium,
186 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1Tight,
187 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VTight,
188 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v1VVTight
193 tauIDSources.byIsolationMVArun2017v1DBoldDMwLTraw2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1raw')
194 tauIDSources.byVVLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1VVLoose')
195 tauIDSources.byVLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1VLoose')
196 tauIDSources.byLooseIsolationMVArun2017v1DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1Loose')
197 tauIDSources.byMediumIsolationMVArun2017v1DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1Medium')
198 tauIDSources.byTightIsolationMVArun2017v1DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1Tight')
199 tauIDSources.byVTightIsolationMVArun2017v1DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1VTight')
200 tauIDSources.byVVTightIsolationMVArun2017v1DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v1VVTight')
203 if "2017v2" in self.
toKeep:
206 'tauIdMVAIsoDBoldDMwLT2017' :
"tauIdMVAIsoDBoldDMwLT2017",
209 'tauIdMVAIsoDBoldDMwLT2017' : {
210 'Eff95' :
"DBoldDMwLTEff95",
211 'Eff90' :
"DBoldDMwLTEff90",
212 'Eff80' :
"DBoldDMwLTEff80",
213 'Eff70' :
"DBoldDMwLTEff70",
214 'Eff60' :
"DBoldDMwLTEff60",
215 'Eff50' :
"DBoldDMwLTEff50",
216 'Eff40' :
"DBoldDMwLTEff40" 221 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" 224 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2raw = patDiscriminationByIsolationMVArun2v1raw.clone(
225 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
226 Prediscriminants = noPrediscriminants,
227 loadMVAfromDB = self.cms.bool(
True),
228 mvaName = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2"),
229 mvaOpt = self.cms.string(
"DBoldDMwLTwGJ"),
230 requireDecayMode = self.cms.bool(
True),
231 verbosity = self.cms.int32(0)
234 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose = patDiscriminationByIsolationMVArun2v1VLoose.clone(
235 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
236 Prediscriminants = noPrediscriminants,
237 toMultiplex = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2raw'),
238 key = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2raw:category'),
239 loadMVAfromDB = self.cms.bool(
True),
240 mvaOutput_normalization = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_mvaOutput_normalization"),
241 mapping = self.cms.VPSet(
243 category = self.cms.uint32(0),
244 cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff90"),
245 variable = self.cms.string(
"pt"),
248 verbosity = self.cms.int32(0)
251 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VVLoose = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose.clone()
252 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VVLoose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff95")
253 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Loose = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose.clone()
254 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Loose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff80")
255 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Medium = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose.clone()
256 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Medium.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff70")
257 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Tight = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose.clone()
258 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Tight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff60")
259 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VTight = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose.clone()
260 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff50")
261 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VVTight = self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose.clone()
262 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VVTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2017v2_WPEff40")
265 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2raw,
266 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose,
267 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VVLoose,
268 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Loose,
269 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Medium,
270 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2Tight,
271 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VTight,
272 self.process.rerunDiscriminationByIsolationOldDMMVArun2017v2VVTight
277 tauIDSources.byIsolationMVArun2017v2DBoldDMwLTraw2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2raw')
278 tauIDSources.byVVLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2VVLoose')
279 tauIDSources.byVLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2VLoose')
280 tauIDSources.byLooseIsolationMVArun2017v2DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2Loose')
281 tauIDSources.byMediumIsolationMVArun2017v2DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2Medium')
282 tauIDSources.byTightIsolationMVArun2017v2DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2Tight')
283 tauIDSources.byVTightIsolationMVArun2017v2DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2VTight')
284 tauIDSources.byVVTightIsolationMVArun2017v2DBoldDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2017v2VVTight')
286 if "newDM2017v2" in self.
toKeep:
289 'tauIdMVAIsoDBnewDMwLT2017' :
"tauIdMVAIsoDBnewDMwLT2017",
292 'tauIdMVAIsoDBnewDMwLT2017' : {
293 'Eff95' :
"DBnewDMwLTEff95",
294 'Eff90' :
"DBnewDMwLTEff90",
295 'Eff80' :
"DBnewDMwLTEff80",
296 'Eff70' :
"DBnewDMwLTEff70",
297 'Eff60' :
"DBnewDMwLTEff60",
298 'Eff50' :
"DBnewDMwLTEff50",
299 'Eff40' :
"DBnewDMwLTEff40" 304 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" 307 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2raw = patDiscriminationByIsolationMVArun2v1raw.clone(
308 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
309 Prediscriminants = noPrediscriminants,
310 loadMVAfromDB = self.cms.bool(
True),
311 mvaName = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2"),
312 mvaOpt = self.cms.string(
"DBnewDMwLTwGJ"),
313 requireDecayMode = self.cms.bool(
True),
314 verbosity = self.cms.int32(0)
317 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose = patDiscriminationByIsolationMVArun2v1VLoose.clone(
318 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
319 Prediscriminants = noPrediscriminants,
320 toMultiplex = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2raw'),
321 key = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2raw:category'),
322 loadMVAfromDB = self.cms.bool(
True),
323 mvaOutput_normalization = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_mvaOutput_normalization"),
324 mapping = self.cms.VPSet(
326 category = self.cms.uint32(0),
327 cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff90"),
328 variable = self.cms.string(
"pt"),
331 verbosity = self.cms.int32(0)
334 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VVLoose = self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose.clone()
335 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VVLoose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff95")
336 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Loose = self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose.clone()
337 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Loose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff80")
338 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Medium = self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose.clone()
339 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Medium.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff70")
340 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Tight = self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose.clone()
341 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Tight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff60")
342 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VTight = self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose.clone()
343 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff50")
344 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VVTight = self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose.clone()
345 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VVTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2017v2_WPEff40")
348 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2raw,
349 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose,
350 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VVLoose,
351 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Loose,
352 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Medium,
353 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2Tight,
354 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VTight,
355 self.process.rerunDiscriminationByIsolationNewDMMVArun2017v2VVTight
360 tauIDSources.byIsolationMVArun2017v2DBnewDMwLTraw2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2raw')
361 tauIDSources.byVVLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2VVLoose')
362 tauIDSources.byVLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2VLoose')
363 tauIDSources.byLooseIsolationMVArun2017v2DBnewDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2Loose')
364 tauIDSources.byMediumIsolationMVArun2017v2DBnewDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2Medium')
365 tauIDSources.byTightIsolationMVArun2017v2DBnewDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2Tight')
366 tauIDSources.byVTightIsolationMVArun2017v2DBnewDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2VTight')
367 tauIDSources.byVVTightIsolationMVArun2017v2DBnewDMwLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2017v2VVTight')
369 if "dR0p32017v2" in self.
toKeep:
372 'tauIdMVAIsoDBoldDMdR0p3wLT2017' :
"tauIdMVAIsoDBoldDMdR0p3wLT2017",
375 'tauIdMVAIsoDBoldDMdR0p3wLT2017' : {
376 'Eff95' :
"DBoldDMdR0p3wLTEff95",
377 'Eff90' :
"DBoldDMdR0p3wLTEff90",
378 'Eff80' :
"DBoldDMdR0p3wLTEff80",
379 'Eff70' :
"DBoldDMdR0p3wLTEff70",
380 'Eff60' :
"DBoldDMdR0p3wLTEff60",
381 'Eff50' :
"DBoldDMdR0p3wLTEff50",
382 'Eff40' :
"DBoldDMdR0p3wLTEff40" 387 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" 390 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2raw = patDiscriminationByIsolationMVArun2v1raw.clone(
391 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
392 Prediscriminants = noPrediscriminants,
393 loadMVAfromDB = self.cms.bool(
True),
394 mvaName = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2"),
395 mvaOpt = self.cms.string(
"DBoldDMwLTwGJ"),
396 requireDecayMode = self.cms.bool(
True),
397 srcChargedIsoPtSum = self.cms.string(
'chargedIsoPtSumdR03'),
398 srcFootprintCorrection = self.cms.string(
'footprintCorrectiondR03'),
399 srcNeutralIsoPtSum = self.cms.string(
'neutralIsoPtSumdR03'),
400 srcPhotonPtSumOutsideSignalCone = self.cms.string(
'photonPtSumOutsideSignalConedR03'),
401 verbosity = self.cms.int32(0)
404 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose = patDiscriminationByIsolationMVArun2v1VLoose.clone(
405 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
406 Prediscriminants = noPrediscriminants,
407 toMultiplex = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2raw'),
408 key = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2raw:category'),
409 loadMVAfromDB = self.cms.bool(
True),
410 mvaOutput_normalization = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_mvaOutput_normalization"),
411 mapping = self.cms.VPSet(
413 category = self.cms.uint32(0),
414 cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff90"),
415 variable = self.cms.string(
"pt"),
418 verbosity = self.cms.int32(0)
421 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVLoose = self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose.clone()
422 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVLoose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff95")
423 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Loose = self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose.clone()
424 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Loose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff80")
425 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Medium = self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose.clone()
426 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Medium.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff70")
427 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Tight = self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose.clone()
428 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Tight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff60")
429 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VTight = self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose.clone()
430 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff50")
431 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVTight = self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose.clone()
432 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT2017v2_WPEff40")
435 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2raw,
436 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose,
437 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVLoose,
438 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Loose,
439 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Medium,
440 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Tight,
441 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VTight,
442 self.process.rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVTight
447 tauIDSources.byIsolationMVArun2017v2DBoldDMdR0p3wLTraw2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2raw')
448 tauIDSources.byVVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVLoose')
449 tauIDSources.byVLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VLoose')
450 tauIDSources.byLooseIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Loose')
451 tauIDSources.byMediumIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Medium')
452 tauIDSources.byTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2Tight')
453 tauIDSources.byVTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VTight')
454 tauIDSources.byVVTightIsolationMVArun2017v2DBoldDMdR0p3wLT2017 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMdR0p3MVArun2017v2VVTight')
484 if "2016v1" in self.
toKeep:
485 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1raw = patDiscriminationByIsolationMVArun2v1raw.clone(
486 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
487 Prediscriminants = noPrediscriminants,
488 loadMVAfromDB = self.cms.bool(
True),
489 mvaName = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1"),
490 mvaOpt = self.cms.string(
"DBoldDMwLT"),
491 requireDecayMode = self.cms.bool(
True),
492 verbosity = self.cms.int32(0)
495 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VLoose = patDiscriminationByIsolationMVArun2v1VLoose.clone(
496 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
497 Prediscriminants = noPrediscriminants,
498 toMultiplex = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1raw'),
499 key = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1raw:category'),
500 loadMVAfromDB = self.cms.bool(
True),
501 mvaOutput_normalization = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_mvaOutput_normalization"),
502 mapping = self.cms.VPSet(
504 category = self.cms.uint32(0),
505 cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_WPEff90"),
506 variable = self.cms.string(
"pt"),
511 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Loose = self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VLoose.clone()
512 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Loose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_WPEff80")
513 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Medium = self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VLoose.clone()
514 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Medium.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_WPEff70")
515 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Tight = self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VLoose.clone()
516 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Tight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_WPEff60")
517 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VTight = self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VLoose.clone()
518 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_WPEff50")
519 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VVTight = self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VLoose.clone()
520 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VVTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBoldDMwLT2016v1_WPEff40")
523 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1raw,
524 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VLoose,
525 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Loose,
526 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Medium,
527 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1Tight,
528 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VTight,
529 self.process.rerunDiscriminationByIsolationOldDMMVArun2v1VVTight
534 tauIDSources.byIsolationMVArun2v1DBoldDMwLTraw2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1raw')
535 tauIDSources.byVLooseIsolationMVArun2v1DBoldDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1VLoose')
536 tauIDSources.byLooseIsolationMVArun2v1DBoldDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1Loose')
537 tauIDSources.byMediumIsolationMVArun2v1DBoldDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1Medium')
538 tauIDSources.byTightIsolationMVArun2v1DBoldDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1Tight')
539 tauIDSources.byVTightIsolationMVArun2v1DBoldDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1VTight')
540 tauIDSources.byVVTightIsolationMVArun2v1DBoldDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationOldDMMVArun2v1VVTight')
543 if "newDM2016v1" in self.
toKeep:
544 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1raw = patDiscriminationByIsolationMVArun2v1raw.clone(
545 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
546 Prediscriminants = noPrediscriminants,
547 loadMVAfromDB = self.cms.bool(
True),
548 mvaName = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1"),
549 mvaOpt = self.cms.string(
"DBnewDMwLT"),
550 requireDecayMode = self.cms.bool(
True),
551 verbosity = self.cms.int32(0)
554 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VLoose = patDiscriminationByIsolationMVArun2v1VLoose.clone(
555 PATTauProducer = self.cms.InputTag(
'slimmedTaus'),
556 Prediscriminants = noPrediscriminants,
557 toMultiplex = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1raw'),
558 key = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1raw:category'),
559 loadMVAfromDB = self.cms.bool(
True),
560 mvaOutput_normalization = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_mvaOutput_normalization"),
561 mapping = self.cms.VPSet(
563 category = self.cms.uint32(0),
564 cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_WPEff90"),
565 variable = self.cms.string(
"pt"),
570 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Loose = self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VLoose.clone()
571 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Loose.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_WPEff80")
572 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Medium = self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VLoose.clone()
573 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Medium.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_WPEff70")
574 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Tight = self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VLoose.clone()
575 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Tight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_WPEff60")
576 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VTight = self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VLoose.clone()
577 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_WPEff50")
578 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VVTight = self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VLoose.clone()
579 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VVTight.mapping[0].cut = self.cms.string(
"RecoTauTag_tauIdMVAIsoDBnewDMwLT2016v1_WPEff40")
582 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1raw,
583 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VLoose,
584 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Loose,
585 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Medium,
586 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1Tight,
587 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VTight,
588 self.process.rerunDiscriminationByIsolationNewDMMVArun2v1VVTight
593 tauIDSources.byIsolationMVArun2v1DBnewDMwLTraw2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1raw')
594 tauIDSources.byVLooseIsolationMVArun2v1DBnewDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1VLoose')
595 tauIDSources.byLooseIsolationMVArun2v1DBnewDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1Loose')
596 tauIDSources.byMediumIsolationMVArun2v1DBnewDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1Medium')
597 tauIDSources.byTightIsolationMVArun2v1DBnewDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1Tight')
598 tauIDSources.byVTightIsolationMVArun2v1DBnewDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1VTight')
599 tauIDSources.byVVTightIsolationMVArun2v1DBnewDMwLT2016 = self.cms.InputTag(
'rerunDiscriminationByIsolationNewDMMVArun2v1VVTight')
601 if "deepTau2017v1" in self.
toKeep:
602 print "Adding DeepTau IDs" 606 "VVVLoose" : 0.96424,
616 "VVVLoose" : 0.959619,
617 "VVLoose" : 0.997687,
637 file_name =
'RecoTauTag/TrainingFiles/data/DeepTauId/deepTau_2017v1_20L1024N_quantized.pb' 638 self.process.deepTau2017v1 = self.cms.EDProducer(
"DeepTauId",
639 electrons = self.cms.InputTag(
'slimmedElectrons'),
640 muons = self.cms.InputTag(
'slimmedMuons'),
641 taus = self.cms.InputTag(
'slimmedTaus'),
642 graph_file = self.cms.string(file_name),
643 mem_mapped = self.cms.bool(
False)
648 self.process.rerunMvaIsolationTask.add(self.process.deepTau2017v1)
649 self.process.rerunMvaIsolationSequence += self.process.deepTau2017v1
651 if "DPFTau_2016_v0" in self.
toKeep:
652 print "Adding DPFTau isolation (v0)" 656 "Tight" :
"if(decayMode == 0) return (0.898328 - 0.000160992 * pt);" + \
657 "if(decayMode == 1) return (0.910138 - 0.000229923 * pt);" + \
658 "if(decayMode == 10) return (0.873958 - 0.0002328 * pt);" + \
668 file_name =
'RecoTauTag/TrainingFiles/data/DPFTauId/DPFIsolation_2017v0_quantized.pb' 669 self.process.dpfTau2016v0 = self.cms.EDProducer(
"DPFIsolation",
670 pfcands = self.cms.InputTag(
'packedPFCandidates'),
671 taus = self.cms.InputTag(
'slimmedTaus'),
672 vertices = self.cms.InputTag(
'offlineSlimmedPrimaryVertices'),
673 graph_file = self.cms.string(file_name),
675 mem_mapped = self.cms.bool(
False)
680 self.process.rerunMvaIsolationTask.add(self.process.dpfTau2016v0)
681 self.process.rerunMvaIsolationSequence += self.process.dpfTau2016v0
684 if "DPFTau_2016_v1" in self.
toKeep:
685 print "Adding DPFTau isolation (v1)" 686 print "WARNING: WPs are not defined for DPFTau_2016_v1" 687 print "WARNING: The score of DPFTau_2016_v1 is inverted: i.e. for Sig->0, for Bkg->1 with -1 for undefined input (preselection not passed)." 690 "all": {
"Tight" : 0.123}
693 file_name =
'RecoTauTag/TrainingFiles/data/DPFTauId/DPFIsolation_2017v1_quantized.pb' 694 self.process.dpfTau2016v1 = self.cms.EDProducer(
"DPFIsolation",
695 pfcands = self.cms.InputTag(
'packedPFCandidates'),
696 taus = self.cms.InputTag(
'slimmedTaus'),
697 vertices = self.cms.InputTag(
'offlineSlimmedPrimaryVertices'),
698 graph_file = self.cms.string(file_name),
700 mem_mapped = self.cms.bool(
False)
705 self.process.rerunMvaIsolationTask.add(self.process.dpfTau2016v1)
706 self.process.rerunMvaIsolationSequence += self.process.dpfTau2016v1
708 if "againstEle2018" in self.
toKeep:
709 antiElectronDiscrMVA6_version =
"MVA6v3_noeveto" 712 from RecoTauTag.RecoTau.PATTauDiscriminationAgainstElectronMVA6_cfi
import patTauDiscriminationAgainstElectronMVA6
713 self.process.patTauDiscriminationByElectronRejectionMVA62018Raw = patTauDiscriminationAgainstElectronMVA6.clone(
714 Prediscriminants = noPrediscriminants,
715 vetoEcalCracks = self.cms.bool(
False),
716 mvaName_NoEleMatch_wGwoGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL',
717 mvaName_NoEleMatch_wGwoGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC',
718 mvaName_NoEleMatch_woGwoGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL',
719 mvaName_NoEleMatch_woGwoGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC',
720 mvaName_wGwGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL',
721 mvaName_wGwGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC',
722 mvaName_woGwGSF_BL =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL',
723 mvaName_woGwGSF_EC =
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC' 728 self.process.patTauDiscriminationByVLooseElectronRejectionMVA62018 = patTauDiscriminantCutMultiplexer.clone(
729 PATTauProducer = self.process.patTauDiscriminationByElectronRejectionMVA62018Raw.PATTauProducer,
730 Prediscriminants = self.process.patTauDiscriminationByElectronRejectionMVA62018Raw.Prediscriminants,
731 toMultiplex = self.cms.InputTag(
"patTauDiscriminationByElectronRejectionMVA62018Raw"),
732 key = self.cms.InputTag(
"patTauDiscriminationByElectronRejectionMVA62018Raw",
"category"),
733 mapping = self.cms.VPSet(
735 category = self.cms.uint32(0),
736 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL_WPeff98'),
737 variable = self.cms.string(
'pt')
740 category = self.cms.uint32(2),
741 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL_WPeff98'),
742 variable = self.cms.string(
'pt')
745 category = self.cms.uint32(5),
746 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL_WPeff98'),
747 variable = self.cms.string(
'pt')
750 category = self.cms.uint32(7),
751 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL_WPeff98'),
752 variable = self.cms.string(
'pt')
755 category = self.cms.uint32(8),
756 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC_WPeff98'),
757 variable = self.cms.string(
'pt')
760 category = self.cms.uint32(10),
761 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC_WPeff98'),
762 variable = self.cms.string(
'pt')
765 category = self.cms.uint32(13),
766 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC_WPeff98'),
767 variable = self.cms.string(
'pt')
770 category = self.cms.uint32(15),
771 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC_WPeff98'),
772 variable = self.cms.string(
'pt')
777 self.process.patTauDiscriminationByLooseElectronRejectionMVA62018 = self.process.patTauDiscriminationByVLooseElectronRejectionMVA62018.clone(
778 mapping = self.cms.VPSet(
780 category = self.cms.uint32(0),
781 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL_WPeff90'),
782 variable = self.cms.string(
'pt')
785 category = self.cms.uint32(2),
786 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL_WPeff90'),
787 variable = self.cms.string(
'pt')
790 category = self.cms.uint32(5),
791 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL_WPeff90'),
792 variable = self.cms.string(
'pt')
795 category = self.cms.uint32(7),
796 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL_WPeff90'),
797 variable = self.cms.string(
'pt')
800 category = self.cms.uint32(8),
801 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC_WPeff90'),
802 variable = self.cms.string(
'pt')
805 category = self.cms.uint32(10),
806 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC_WPeff90'),
807 variable = self.cms.string(
'pt')
810 category = self.cms.uint32(13),
811 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC_WPeff90'),
812 variable = self.cms.string(
'pt')
815 category = self.cms.uint32(15),
816 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC_WPeff90'),
817 variable = self.cms.string(
'pt')
822 self.process.patTauDiscriminationByMediumElectronRejectionMVA62018 = self.process.patTauDiscriminationByVLooseElectronRejectionMVA62018.clone(
823 mapping = self.cms.VPSet(
825 category = self.cms.uint32(0),
826 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL_WPeff80'),
827 variable = self.cms.string(
'pt')
830 category = self.cms.uint32(2),
831 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL_WPeff80'),
832 variable = self.cms.string(
'pt')
835 category = self.cms.uint32(5),
836 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL_WPeff80'),
837 variable = self.cms.string(
'pt')
840 category = self.cms.uint32(7),
841 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL_WPeff80'),
842 variable = self.cms.string(
'pt')
845 category = self.cms.uint32(8),
846 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC_WPeff80'),
847 variable = self.cms.string(
'pt')
850 category = self.cms.uint32(10),
851 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC_WPeff80'),
852 variable = self.cms.string(
'pt')
855 category = self.cms.uint32(13),
856 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC_WPeff80'),
857 variable = self.cms.string(
'pt')
860 category = self.cms.uint32(15),
861 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC_WPeff80'),
862 variable = self.cms.string(
'pt')
867 self.process.patTauDiscriminationByTightElectronRejectionMVA62018 = self.process.patTauDiscriminationByVLooseElectronRejectionMVA62018.clone(
868 mapping = self.cms.VPSet(
870 category = self.cms.uint32(0),
871 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL_WPeff70'),
872 variable = self.cms.string(
'pt')
875 category = self.cms.uint32(2),
876 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL_WPeff70'),
877 variable = self.cms.string(
'pt')
880 category = self.cms.uint32(5),
881 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL_WPeff70'),
882 variable = self.cms.string(
'pt')
885 category = self.cms.uint32(7),
886 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL_WPeff70'),
887 variable = self.cms.string(
'pt')
890 category = self.cms.uint32(8),
891 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC_WPeff70'),
892 variable = self.cms.string(
'pt')
895 category = self.cms.uint32(10),
896 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC_WPeff70'),
897 variable = self.cms.string(
'pt')
900 category = self.cms.uint32(13),
901 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC_WPeff70'),
902 variable = self.cms.string(
'pt')
905 category = self.cms.uint32(15),
906 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC_WPeff70'),
907 variable = self.cms.string(
'pt')
912 self.process.patTauDiscriminationByVTightElectronRejectionMVA62018 = self.process.patTauDiscriminationByVLooseElectronRejectionMVA62018.clone(
913 mapping = self.cms.VPSet(
915 category = self.cms.uint32(0),
916 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_BL_WPeff60'),
917 variable = self.cms.string(
'pt')
920 category = self.cms.uint32(2),
921 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_BL_WPeff60'),
922 variable = self.cms.string(
'pt')
925 category = self.cms.uint32(5),
926 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_BL_WPeff60'),
927 variable = self.cms.string(
'pt')
930 category = self.cms.uint32(7),
931 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_BL_WPeff60'),
932 variable = self.cms.string(
'pt')
935 category = self.cms.uint32(8),
936 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_woGwoGSF_EC_WPeff60'),
937 variable = self.cms.string(
'pt')
940 category = self.cms.uint32(10),
941 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_NoEleMatch_wGwoGSF_EC_WPeff60'),
942 variable = self.cms.string(
'pt')
945 category = self.cms.uint32(13),
946 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_woGwGSF_EC_WPeff60'),
947 variable = self.cms.string(
'pt')
950 category = self.cms.uint32(15),
951 cut = self.cms.string(
'RecoTauTag_antiElectron'+antiElectronDiscrMVA6_version+
'_gbr_wGwGSF_EC_WPeff60'),
952 variable = self.cms.string(
'pt')
957 self.process.patTauDiscriminationByElectronRejectionMVA62018Task = self.cms.Task(
958 self.process.patTauDiscriminationByElectronRejectionMVA62018Raw,
959 self.process.patTauDiscriminationByVLooseElectronRejectionMVA62018,
960 self.process.patTauDiscriminationByLooseElectronRejectionMVA62018,
961 self.process.patTauDiscriminationByMediumElectronRejectionMVA62018,
962 self.process.patTauDiscriminationByTightElectronRejectionMVA62018,
963 self.process.patTauDiscriminationByVTightElectronRejectionMVA62018
965 self.process.patTauDiscriminationByElectronRejectionMVA62018Seq = self.cms.Sequence(self.process.patTauDiscriminationByElectronRejectionMVA62018Task)
966 self.process.rerunMvaIsolationTask.add(self.process.patTauDiscriminationByElectronRejectionMVA62018Task)
967 self.process.rerunMvaIsolationSequence += self.process.patTauDiscriminationByElectronRejectionMVA62018Seq
969 _againstElectronTauIDSources = self.cms.PSet(
970 againstElectronMVA6Raw2018 = self.cms.InputTag(
"patTauDiscriminationByElectronRejectionMVA62018Raw"),
971 againstElectronMVA6category2018 = self.cms.InputTag(
"patTauDiscriminationByElectronRejectionMVA62018Raw",
"category"),
972 againstElectronVLooseMVA62018 = self.cms.InputTag(
"patTauDiscriminationByVLooseElectronRejectionMVA62018"),
973 againstElectronLooseMVA62018 = self.cms.InputTag(
"patTauDiscriminationByLooseElectronRejectionMVA62018"),
974 againstElectronMediumMVA62018 = self.cms.InputTag(
"patTauDiscriminationByMediumElectronRejectionMVA62018"),
975 againstElectronTightMVA62018 = self.cms.InputTag(
"patTauDiscriminationByTightElectronRejectionMVA62018"),
976 againstElectronVTightMVA62018 = self.cms.InputTag(
"patTauDiscriminationByVTightElectronRejectionMVA62018")
978 _tauIDSourcesWithAgainistEle = self.cms.PSet(
979 tauIDSources.clone(),
980 _againstElectronTauIDSources
982 tauIDSources =_tauIDSourcesWithAgainistEle.clone()
986 embedID = self.cms.EDProducer(
"PATTauIDEmbedder",
987 src = self.cms.InputTag(
'slimmedTaus'),
988 tauIDSources = tauIDSources
994 for target,points
in workingPoints_.iteritems():
995 cuts = self.cms.PSet()
996 setattr(tauIDSources,
'by{}VS{}raw'.
format(producer_name[0].
upper()+producer_name[1:], target),
997 self.cms.InputTag(producer_name,
'VS{}'.
format(target)))
998 for point,cut
in points.iteritems():
999 setattr(cuts, point, self.cms.string(
str(cut)))
1001 setattr(tauIDSources,
'by{}{}VS{}'.
format(point, producer_name[0].
upper()+producer_name[1:], target),
1002 self.cms.InputTag(producer_name,
'VS{}{}'.
format(target, point)))
1004 setattr(getattr(self.
process, producer_name),
'VS{}WP'.
format(target), cuts)
1008 """returns the DNN version. File name should contain a version label with data takig year (2011-2, 2015-8) and \ 1009 version number (vX), e.g. 2017v0, in general the following format: {year}v{version}""" 1010 version_search = re.search(
'201[125678]v([0-9]+)[\._]', file_name)
1011 if not version_search:
1012 raise RuntimeError(
'File "{}" has an invalid name pattern, should be in the format "{year}v{version}". \ 1013 Unable to extract version number.'.
format(file_name))
1014 version = version_search.group(1)
tauIdDiscrMVA_2017_version
def is_above_cmssw_version(klass, release=9, subversion=4, patch=0, debug=False)
def get_cmssw_version_number(klass, debug=False)
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
tauIdDiscrMVA_WPs_run2_2017
def get_cmssw_version(debug=False)
tauIdDiscrMVA_trainings_run2_2017
def getDpfTauVersion(self, file_name)
def loadMVA_WPs_run2_2017(self)
rerunIsolationOldDMMVArun2016v1Task
def processDeepProducer(self, producer_name, tauIDSources, workingPoints_)
rerunIsolationNewDMMVArun2017v2Task
rerunIsolationOldDMdR0p3MVArun2017v2Task
rerunIsolationOldDMMVArun2017v2Task
rerunIsolationOldDMMVArun2017v1Task
rerunIsolationNewDMMVArun2016v1Task
def versionToInt(release=9, subversion=4, patch=0, debug=False)