1 import FWCore.ParameterSet.Config
as cms
3 tauIdDiscrMVA_trainings = {
4 'tauIdMVAoldDMwoLT' :
"tauIdMVAoldDMwoLT",
5 'tauIdMVAoldDMwLT' :
"tauIdMVAoldDMwLT",
6 'tauIdMVAnewDMwoLT' :
"tauIdMVAnewDMwoLT",
7 'tauIdMVAnewDMwLT' :
"tauIdMVAnewDMwLT" 11 'tauIdMVAoldDMwoLT' : {
12 'Eff90' :
"oldDMwoLTEff90",
13 'Eff80' :
"oldDMwoLTEff80",
14 'Eff70' :
"oldDMwoLTEff70",
15 'Eff60' :
"oldDMwoLTEff60",
16 'Eff50' :
"oldDMwoLTEff50",
17 'Eff40' :
"oldDMwoLTEff40" 19 'tauIdMVAoldDMwLT' : {
20 'Eff90' :
"oldDMwLTEff90",
21 'Eff80' :
"oldDMwLTEff80",
22 'Eff70' :
"oldDMwLTEff70",
23 'Eff60' :
"oldDMwLTEff60",
24 'Eff50' :
"oldDMwLTEff50",
25 'Eff40' :
"oldDMwLTEff40" 27 'tauIdMVAnewDMwoLT' : {
28 'Eff90' :
"newDMwoLTEff90",
29 'Eff80' :
"newDMwoLTEff80",
30 'Eff70' :
"newDMwoLTEff70",
31 'Eff60' :
"newDMwoLTEff60",
32 'Eff50' :
"newDMwoLTEff50",
33 'Eff40' :
"newDMwoLTEff40" 35 'tauIdMVAnewDMwLT' : {
36 'Eff90' :
"newDMwLTEff90",
37 'Eff80' :
"newDMwLTEff80",
38 'Eff70' :
"newDMwLTEff70",
39 'Eff60' :
"newDMwLTEff60",
40 'Eff50' :
"newDMwLTEff50",
41 'Eff40' :
"newDMwLTEff40" 45 tauIdDiscrMVA_mvaOutput_normalizations = {
46 'tauIdMVAoldDMwoLT' :
"mvaOutput_normalization_oldDMwoLT",
47 'tauIdMVAoldDMwLT' :
"mvaOutput_normalization_oldDMwLT",
48 'tauIdMVAnewDMwoLT' :
"mvaOutput_normalization_newDMwoLT",
49 'tauIdMVAnewDMwLT' :
"mvaOutput_normalization_newDMwLT" 53 tauIdDiscrMVA_inputFileNames = {
54 'tauIdMVAoldDMwoLT' : {
55 'GBRForest' :
"RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_oldDMwoLT.root",
56 'TGraph' :
"RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwoLT.root" 59 'tauIdMVAoldDMwLT' : {
60 'GBRForest' :
"RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_oldDMwLT.root",
61 'TGraph' :
"RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwLT.root" 63 'tauIdMVAnewDMwoLT' : {
64 'GBRForest' :
"RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_newDMwoLT.root",
65 'TGraph' :
"RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwoLT.root" 67 'tauIdMVAnewDMwLT' : {
68 'GBRForest' :
"RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_newDMwLT.root",
69 'TGraph' :
"RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwLT.root" 73 tauIdDiscrMVA_version =
"v1" 75 writeTauIdDiscrMVAs = cms.EDAnalyzer(
"GBRForestWriter",
78 writeTauIdDiscrWPs = cms.EDAnalyzer(
"TGraphWriter",
81 writeTauIdDiscrMVAoutputNormalizations = cms.EDAnalyzer(
"TFormulaWriter",
85 for training, gbrForestName
in tauIdDiscrMVA_trainings.items():
86 writeTauIdDiscrMVAs.jobs.append(
88 inputFileName = cms.FileInPath(tauIdDiscrMVA_inputFileNames[training][
'GBRForest']),
89 inputFileType = cms.string(
"GBRForest"),
90 gbrForestName = cms.string(gbrForestName),
91 outputFileType = cms.string(
"SQLLite"),
92 outputRecord = cms.string(
"RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version))
95 for WP
in tauIdDiscrMVA_WPs[training].
keys():
96 writeTauIdDiscrWPs.jobs.append(
98 inputFileName = cms.FileInPath(tauIdDiscrMVA_inputFileNames[training][
'TGraph']),
99 graphName = cms.string(tauIdDiscrMVA_WPs[training][WP]),
100 outputRecord = cms.string(
"RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP))
103 writeTauIdDiscrMVAoutputNormalizations.jobs.append(
105 inputFileName = cms.FileInPath(tauIdDiscrMVA_inputFileNames[training][
'TGraph']),
106 formulaName = cms.string(tauIdDiscrMVA_mvaOutput_normalizations[training]),
107 outputRecord = cms.string(
"RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version))
111 writeTauIdDiscrSequence = cms.Sequence(writeTauIdDiscrMVAs + writeTauIdDiscrWPs + writeTauIdDiscrMVAoutputNormalizations)