CMS 3D CMS Logo

switchMVAtoDB_cfi.py
Go to the documentation of this file.
1 '''Helper function to switch the MVA input to local root file from the sqlite DB'''
2 import FWCore.ParameterSet.Config as cms
3 
4 
5 from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceParam
6 
7 def switchMVAtoDB(process):
8  '''Contrary to its name, replace the MVA input by local root files for all MVA discriminators
9 
10  usage: add following 2 lines to your config file in order to execute this function:
11 
12  from RecoTauTag.Configuration.switchMVAtoDB_cfi import switchMVAtoDB
13  process = switchMVAtoDB(process)
14 
15  The function takes no parameters. The names of the input root files are defined in
16  RecoTauTag/Configuration/python/switchMVAtoDB_cff.py (parameter inputFileName).
17  '''
18 # process.load("RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi")
19  massSearchReplaceParam(getattr(process,"produceAndDiscriminateHPSPFTaus"),"loadMVAfromDB", cms.bool(True), cms.bool(False))
20  #muon discriminators
21  process.hpsPFTauDiscriminationByMVArawMuonRejection.mvaName = cms.string("againstMuonMVA")
22  process.hpsPFTauDiscriminationByMVArawMuonRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/gbrDiscriminationAgainstMuonMVA.root')
23  massSearchReplaceParam(getattr(process,"produceAndDiscriminateHPSPFTaus"), "mvaOutput_normalization", cms.string("RecoTauTag_againstMuonMVAv1_mvaOutput_normalization"), cms.string("mvaOutput_normalization_opt2"))
24  process.hpsPFTauDiscriminationByMVALooseMuonRejection.mapping[0].cut = cms.string("opt2eff99_5")
25  process.hpsPFTauDiscriminationByMVAMediumMuonRejection.mapping[0].cut = cms.string("opt2eff99_0")
26  process.hpsPFTauDiscriminationByMVATightMuonRejection.mapping[0].cut = cms.string("opt2eff98_0")
27 
28  process.hpsPFTauDiscriminationByMVALooseMuonRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByMVAMuonRejection.root')
29  process.hpsPFTauDiscriminationByMVAMediumMuonRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByMVAMuonRejection.root')
30  process.hpsPFTauDiscriminationByMVATightMuonRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByMVAMuonRejection.root')
31 
32  #electron discriminators (MVA5)
33  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_woGwoGSF_EC = cms.string('gbr_woGwoGSF_EC')
34  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_woGwGSF_EC = cms.string('gbr_woGwGSF_EC')
35  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_wGwoGSF_EC = cms.string('gbr_wGwoGSF_EC')
36  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_wGwGSF_EC = cms.string('gbr_wGwGSF_EC')
37  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_woGwoGSF_BL = cms.string('gbr_woGwoGSF_BL')
38  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_woGwGSF_BL = cms.string('gbr_woGwGSF_BL')
39  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_wGwoGSF_BL = cms.string('gbr_wGwoGSF_BL')
40  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_wGwGSF_BL = cms.string('gbr_wGwGSF_BL')
41 
42  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_woGwoGSF_EC = cms.string('gbr_NoEleMatch_woGwoGSF_EC')
43  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_woGwGSF_EC = cms.string('gbr_NoEleMatch_woGwGSF_EC')
44  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_wGwoGSF_EC = cms.string('gbr_NoEleMatch_wGwoGSF_EC')
45  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_wGwGSF_EC = cms.string('gbr_NoEleMatch_wGwGSF_EC')
46  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_woGwoGSF_BL = cms.string('gbr_NoEleMatch_woGwoGSF_BL')
47  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_woGwGSF_BL = cms.string('gbr_NoEleMatch_woGwGSF_BL')
48  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_wGwoGSF_BL = cms.string('gbr_NoEleMatch_wGwoGSF_BL')
49  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.mvaName_NoEleMatch_wGwGSF_BL = cms.string('gbr_NoEleMatch_wGwGSF_BL')
50 
51  process.hpsPFTauDiscriminationByMVA5rawElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/gbrDiscriminationAgainstElectronMVA5.root')
52 
53  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[0].cut = cms.string("eff99cat0")
54  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[1].cut = cms.string("eff99cat1")
55  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[2].cut = cms.string("eff99cat2")
56  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[3].cut = cms.string("eff99cat3")
57  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[4].cut = cms.string("eff99cat4")
58  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[5].cut = cms.string("eff99cat5")
59  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[6].cut = cms.string("eff99cat6")
60  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[7].cut = cms.string("eff99cat7")
61  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[8].cut = cms.string("eff99cat8")
62  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[9].cut = cms.string("eff99cat9")
63  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[10].cut = cms.string("eff99cat10")
64  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[11].cut = cms.string("eff99cat11")
65  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[12].cut = cms.string("eff99cat12")
66  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[13].cut = cms.string("eff99cat13")
67  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[14].cut = cms.string("eff99cat14")
68  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.mapping[15].cut = cms.string("eff99cat15")
69 
70  process.hpsPFTauDiscriminationByMVA5VLooseElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationAgainstElectronMVA5.root')
71 
72  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[0].cut = cms.string("eff96cat0")
73  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[1].cut = cms.string("eff96cat1")
74  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[2].cut = cms.string("eff96cat2")
75  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[3].cut = cms.string("eff96cat3")
76  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[4].cut = cms.string("eff96cat4")
77  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[5].cut = cms.string("eff96cat5")
78  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[6].cut = cms.string("eff96cat6")
79  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[7].cut = cms.string("eff96cat7")
80  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[8].cut = cms.string("eff96cat8")
81  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[9].cut = cms.string("eff96cat9")
82  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[10].cut = cms.string("eff96cat10")
83  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[11].cut = cms.string("eff96cat11")
84  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[12].cut = cms.string("eff96cat12")
85  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[13].cut = cms.string("eff96cat13")
86  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[14].cut = cms.string("eff96cat14")
87  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.mapping[15].cut = cms.string("eff96cat15")
88 
89  process.hpsPFTauDiscriminationByMVA5LooseElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationAgainstElectronMVA5.root')
90 
91  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[0].cut = cms.string("eff91cat0")
92  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[1].cut = cms.string("eff91cat1")
93  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[2].cut = cms.string("eff91cat2")
94  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[3].cut = cms.string("eff91cat3")
95  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[4].cut = cms.string("eff91cat4")
96  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[5].cut = cms.string("eff91cat5")
97  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[6].cut = cms.string("eff91cat6")
98  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[7].cut = cms.string("eff91cat7")
99  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[8].cut = cms.string("eff91cat8")
100  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[9].cut = cms.string("eff91cat9")
101  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[10].cut = cms.string("eff91cat10")
102  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[11].cut = cms.string("eff91cat11")
103  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[12].cut = cms.string("eff91cat12")
104  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[13].cut = cms.string("eff91cat13")
105  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[14].cut = cms.string("eff91cat14")
106  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.mapping[15].cut = cms.string("eff91cat15")
107 
108  process.hpsPFTauDiscriminationByMVA5MediumElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationAgainstElectronMVA5.root')
109 
110  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[0].cut = cms.string("eff85cat0")
111  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[1].cut = cms.string("eff85cat1")
112  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[2].cut = cms.string("eff85cat2")
113  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[3].cut = cms.string("eff85cat3")
114  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[4].cut = cms.string("eff85cat4")
115  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[5].cut = cms.string("eff85cat5")
116  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[6].cut = cms.string("eff85cat6")
117  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[7].cut = cms.string("eff85cat7")
118  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[8].cut = cms.string("eff85cat8")
119  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[9].cut = cms.string("eff85cat9")
120  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[10].cut = cms.string("eff85cat10")
121  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[11].cut = cms.string("eff85cat11")
122  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[12].cut = cms.string("eff85cat12")
123  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[13].cut = cms.string("eff85cat13")
124  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[14].cut = cms.string("eff85cat14")
125  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.mapping[15].cut = cms.string("eff85cat15")
126 
127  process.hpsPFTauDiscriminationByMVA5TightElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationAgainstElectronMVA5.root')
128 
129  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[0].cut = cms.string("eff79cat0")
130  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[1].cut = cms.string("eff79cat1")
131  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[2].cut = cms.string("eff79cat2")
132  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[3].cut = cms.string("eff79cat3")
133  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[4].cut = cms.string("eff79cat4")
134  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[5].cut = cms.string("eff79cat5")
135  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[6].cut = cms.string("eff79cat6")
136  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[7].cut = cms.string("eff79cat7")
137  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[8].cut = cms.string("eff79cat8")
138  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[9].cut = cms.string("eff79cat9")
139  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[10].cut = cms.string("eff79cat10")
140  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[11].cut = cms.string("eff79cat11")
141  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[12].cut = cms.string("eff79cat12")
142  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[13].cut = cms.string("eff79cat13")
143  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[14].cut = cms.string("eff79cat14")
144  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.mapping[15].cut = cms.string("eff79cat15")
145 
146  process.hpsPFTauDiscriminationByMVA5VTightElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationAgainstElectronMVA5.root')
147 
148  #electron discriminators (MVA6)
149  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_woGwGSF_EC = cms.string('gbr_woGwGSF_EC')
150  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_wGwGSF_EC = cms.string('gbr_wGwGSF_EC')
151  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_woGwGSF_BL = cms.string('gbr_woGwGSF_BL')
152  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_wGwGSF_BL = cms.string('gbr_wGwGSF_BL')
153  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_NoEleMatch_woGwoGSF_EC = cms.string('gbr_NoEleMatch_woGwoGSF_EC')
154  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_NoEleMatch_wGwoGSF_EC = cms.string('gbr_NoEleMatch_wGwoGSF_EC')
155  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_NoEleMatch_woGwoGSF_BL = cms.string('gbr_NoEleMatch_woGwoGSF_BL')
156  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.mvaName_NoEleMatch_wGwoGSF_BL = cms.string('gbr_NoEleMatch_wGwoGSF_BL')
157 
158  process.hpsPFTauDiscriminationByMVA6rawElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/gbrDiscriminationAgainstElectronMVA6.root')
159 
160  process.hpsPFTauDiscriminationByMVA6ElectronRejection.mapping[0].cut = cms.string("")
161  for i, cat in enumerate([0, 2, 5, 7, 8, 10, 13, 15]):
162  process.hpsPFTauDiscriminationByMVA6ElectronRejection.mapping[i].workingPoints = cms.vstring(
163  "eff99cat%i"%cat,
164  "eff96cat%i"%cat,
165  "eff91cat%i"%cat,
166  "eff85cat%i"%cat,
167  "eff79cat%i"%cat
168  ) #.mapping[i].workingPoints overrides .workingPoints but the latter config can still be used to retrieve indices, e.g. by PAT step
169 
170  process.hpsPFTauDiscriminationByMVA6ElectronRejection.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationAgainstElectronMVA6.root')
171 
172  #isolation
173  process.hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw.mvaName = cms.string("tauIdMVAoldDMwoLT")
174  massSearchReplaceParam(getattr(process,"produceAndDiscriminateHPSPFTaus"),"mvaOutput_normalization", cms.string("RecoTauTag_tauIdMVAoldDMwoLTv1_mvaOutput_normalization"), cms.string("mvaOutput_normalization_oldDMwoLT"))
175  process.hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT.mapping[0].cut = cms.string("oldDMwoLTEff90")
176  process.hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT.mapping[0].cut = cms.string("oldDMwoLTEff80")
177  process.hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwoLT.mapping[0].cut = cms.string("oldDMwoLTEff70")
178  process.hpsPFTauDiscriminationByTightIsolationMVA3oldDMwoLT.mapping[0].cut = cms.string("oldDMwoLTEff60")
179  process.hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwoLT.mapping[0].cut = cms.string("oldDMwoLTEff50")
180  process.hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwoLT.mapping[0].cut = cms.string("oldDMwoLTEff40")
181 
182  process.hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_oldDMwoLT.root')
183  process.hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwoLT.root')
184  process.hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwoLT.root')
185  process.hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwoLT.root')
186  process.hpsPFTauDiscriminationByTightIsolationMVA3oldDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwoLT.root')
187  process.hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwoLT.root')
188  process.hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwoLT.root')
189 
190  process.hpsPFTauDiscriminationByIsolationMVA3oldDMwLTraw.mvaName = cms.string("tauIdMVAoldDMwLT")
191  massSearchReplaceParam(getattr(process,"produceAndDiscriminateHPSPFTaus"),"mvaOutput_normalization", cms.string("RecoTauTag_tauIdMVAoldDMwLTv1_mvaOutput_normalization"), cms.string("mvaOutput_normalization_oldDMwLT"))
192  process.hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwLT.mapping[0].cut = cms.string("oldDMwLTEff90")
193  process.hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwLT.mapping[0].cut = cms.string("oldDMwLTEff80")
194  process.hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwLT.mapping[0].cut = cms.string("oldDMwLTEff70")
195  process.hpsPFTauDiscriminationByTightIsolationMVA3oldDMwLT.mapping[0].cut = cms.string("oldDMwLTEff60")
196  process.hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwLT.mapping[0].cut = cms.string("oldDMwLTEff50")
197  process.hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwLT.mapping[0].cut = cms.string("oldDMwLTEff40")
198 
199  process.hpsPFTauDiscriminationByIsolationMVA3oldDMwLTraw.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_oldDMwLT.root')
200  process.hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwLT.root')
201  process.hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwLT.root')
202  process.hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwLT.root')
203  process.hpsPFTauDiscriminationByTightIsolationMVA3oldDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwLT.root')
204  process.hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwLT.root')
205  process.hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_oldDMwLT.root')
206 
207 
208  process.hpsPFTauDiscriminationByIsolationMVA3newDMwoLTraw.mvaName = cms.string("tauIdMVAnewDMwoLT")
209  massSearchReplaceParam(getattr(process,"produceAndDiscriminateHPSPFTaus"),"mvaOutput_normalization", cms.string("RecoTauTag_tauIdMVAnewDMwoLTv1_mvaOutput_normalization"), cms.string("mvaOutput_normalization_newDMwoLT"))
210  process.hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwoLT.mapping[0].cut = cms.string("newDMwoLTEff90")
211  process.hpsPFTauDiscriminationByLooseIsolationMVA3newDMwoLT.mapping[0].cut = cms.string("newDMwoLTEff80")
212  process.hpsPFTauDiscriminationByMediumIsolationMVA3newDMwoLT.mapping[0].cut = cms.string("newDMwoLTEff70")
213  process.hpsPFTauDiscriminationByTightIsolationMVA3newDMwoLT.mapping[0].cut = cms.string("newDMwoLTEff60")
214  process.hpsPFTauDiscriminationByVTightIsolationMVA3newDMwoLT.mapping[0].cut = cms.string("newDMwoLTEff50")
215  process.hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwoLT.mapping[0].cut = cms.string("newDMwoLTEff40")
216 
217  process.hpsPFTauDiscriminationByIsolationMVA3newDMwoLTraw.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_newDMwoLT.root')
218  process.hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwoLT.root')
219  process.hpsPFTauDiscriminationByLooseIsolationMVA3newDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwoLT.root')
220  process.hpsPFTauDiscriminationByMediumIsolationMVA3newDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwoLT.root')
221  process.hpsPFTauDiscriminationByTightIsolationMVA3newDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwoLT.root')
222  process.hpsPFTauDiscriminationByVTightIsolationMVA3newDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwoLT.root')
223  process.hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwoLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwoLT.root')
224 
225 
226  process.hpsPFTauDiscriminationByIsolationMVA3newDMwLTraw.mvaName = cms.string("tauIdMVAnewDMwLT")
227  massSearchReplaceParam(getattr(process,"produceAndDiscriminateHPSPFTaus"),"mvaOutput_normalization", cms.string("RecoTauTag_tauIdMVAnewDMwLTv1_mvaOutput_normalization"), cms.string("mvaOutput_normalization_newDMwLT"))
228  process.hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwLT.mapping[0].cut = cms.string("newDMwLTEff90")
229  process.hpsPFTauDiscriminationByLooseIsolationMVA3newDMwLT.mapping[0].cut = cms.string("newDMwLTEff80")
230  process.hpsPFTauDiscriminationByMediumIsolationMVA3newDMwLT.mapping[0].cut = cms.string("newDMwLTEff70")
231  process.hpsPFTauDiscriminationByTightIsolationMVA3newDMwLT.mapping[0].cut = cms.string("newDMwLTEff60")
232  process.hpsPFTauDiscriminationByVTightIsolationMVA3newDMwLT.mapping[0].cut = cms.string("newDMwLTEff50")
233  process.hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT.mapping[0].cut = cms.string("newDMwLTEff40")
234 
235  process.hpsPFTauDiscriminationByIsolationMVA3newDMwLTraw.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/gbrDiscriminationByIsolationMVA3_newDMwLT.root')
236  process.hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwLT.root')
237  process.hpsPFTauDiscriminationByLooseIsolationMVA3newDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwLT.root')
238  process.hpsPFTauDiscriminationByMediumIsolationMVA3newDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwLT.root')
239  process.hpsPFTauDiscriminationByTightIsolationMVA3newDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwLT.root')
240  process.hpsPFTauDiscriminationByVTightIsolationMVA3newDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwLT.root')
241  process.hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT.inputFileName = cms.FileInPath('RecoTauTag/RecoTau/data/wpDiscriminationByIsolationMVA3_newDMwLT.root')
242 
243 
244 
245 
246 
247  # if hasattr(process,'pfParticleSelectionSequence'):
248  # process.load("CommonTools.ParticleFlow.deltaBetaWeights_cff")
249  # process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
250 
251  # if hasattr(process,'elPFIsoDepositNeutral'):
252  # process.elPFIsoDepositNeutral=isoDepositReplace('pfElectronTranslator:pf','pfWeightedNeutralHadrons')
253 
254  # if hasattr(process,'elPFIsoDepositGamma'):
255  # process.elPFIsoDepositGamma=isoDepositReplace('pfElectronTranslator:pf','pfWeightedPhotons')
256 
257  # if hasattr(process,'gedElPFIsoDepositNeutral'):
258  # process.gedElPFIsoDepositNeutral=isoDepositReplace('gedGsfElectronsTmp','pfWeightedNeutralHadrons')
259 
260  # if hasattr(process,'gedElPFIsoDepositGamma'):
261  # process.gedElPFIsoDepositGamma=isoDepositReplace('gedGsfElectronsTmp','pfWeightedPhotons')
262 
263  # if hasattr(process,'muPFIsoDepositNeutral'):
264  # process.muPFIsoDepositNeutral=isoDepositReplace('muons1stStep','pfWeightedNeutralHadrons')
265 
266  # if hasattr(process,'muPFIsoDepositGamma'):
267  # process.muPFIsoDepositGamma=isoDepositReplace('muons1stStep','pfWeightedPhotons')
268 
269  # if hasattr(process,'phPFIsoDepositNeutral'):
270  # process.phPFIsoDepositNeutral=isoDepositReplace('pfSelectedPhotons','pfWeightedNeutralHadrons')
271 
272  # if hasattr(process,'phPFIsoDepositGamma'):
273  # process.phPFIsoDepositGamma.ExtractorPSet.inputCandView = cms.InputTag("pfWeightedPhotons")
274 
275  return process
276 
def massSearchReplaceParam(sequence, paramName, paramOldValue, paramValue, verbose=False)
Definition: MassReplace.py:129
def switchMVAtoDB(process)