CMS 3D CMS Logo

writeAntiElectronDiscrMVA_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # CV: The different categories of the anti-electron MVA discriminator are documented in CMS AN-2012/417.
4 # Also see RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationAgainstElectronMVA5GBR.cc .
5 antiElectronDiscrMVA_categories = {
6  '0' : "gbr_NoEleMatch_woGwoGSF_BL",
7  '1' : "gbr_NoEleMatch_woGwGSF_BL",
8  '2' : "gbr_NoEleMatch_wGwoGSF_BL",
9  '3' : "gbr_NoEleMatch_wGwGSF_BL",
10  '4' : "gbr_woGwoGSF_BL",
11  '5' : "gbr_woGwGSF_BL",
12  '6' : "gbr_wGwoGSF_BL",
13  '7' : "gbr_wGwGSF_BL",
14  '8' : "gbr_NoEleMatch_woGwoGSF_EC",
15  '9' : "gbr_NoEleMatch_woGwGSF_EC",
16  '10' : "gbr_NoEleMatch_wGwoGSF_EC",
17  '11' : "gbr_NoEleMatch_wGwGSF_EC",
18  '12' : "gbr_woGwoGSF_EC",
19  '13' : "gbr_woGwGSF_EC",
20  '14' : "gbr_wGwoGSF_EC",
21  '15' : "gbr_wGwGSF_EC"
22 }
23 
24 antiElectronDiscrMVA_inputFileName = {
25  'GBRForest' : "RecoTauTag/RecoTau/data/gbrDiscriminationAgainstElectronMVA5.root",
26  'TGraph' : "RecoTauTag/RecoTau/data/wpDiscriminationAgainstElectronMVA5.root"
27 }
28 
29 antiElectronDiscrMVA_WPs = [ "eff99", "eff96", "eff91", "eff85", "eff79" ]
30 
31 antiElectronDiscrMVA_version = "v1"
32 
33 writeAntiElectronDiscrMVAs = cms.EDAnalyzer("GBRForestWriter",
34  jobs = cms.VPSet()
35 )
36 writeAntiElectronDiscrWPs = cms.EDAnalyzer("TGraphWriter",
37  jobs = cms.VPSet()
38 )
39 
40 for category, gbrForestName in antiElectronDiscrMVA_categories.items():
41  writeAntiElectronDiscrMVAs.jobs.append(
42  cms.PSet(
43  inputFileName = cms.FileInPath(antiElectronDiscrMVA_inputFileName['GBRForest']),
44  inputFileType = cms.string("GBRForest"),
45  gbrForestName = cms.string(gbrForestName),
46  outputFileType = cms.string("SQLLite"),
47  outputRecord = cms.string("RecoTauTag_antiElectronMVA5%s_%s" % (antiElectronDiscrMVA_version, gbrForestName))
48  )
49  )
50  for WP in antiElectronDiscrMVA_WPs:
51  writeAntiElectronDiscrWPs.jobs.append(
52  cms.PSet(
53  inputFileName = cms.FileInPath(antiElectronDiscrMVA_inputFileName['TGraph']),
54  graphName = cms.string("%scat%s" % (WP, category)),
55  outputRecord = cms.string("RecoTauTag_antiElectronMVA5%s_%s_WP%s" % (antiElectronDiscrMVA_version, gbrForestName, WP))
56  )
57  )
58 
59 writeAntiElectronDiscrSequence = cms.Sequence(writeAntiElectronDiscrMVAs + writeAntiElectronDiscrWPs)