CMS 3D CMS Logo

writeAntiMuonDiscrMVA_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 antiMuonDiscrMVA_inputFileName = "RecoTauTag/RecoTau/data/gbrDiscriminationAgainstMuonMVA.root"
4 
5 antiMuonDiscrMVA_version = "v1"
6 
7 writeAntiMuonDiscrMVAs = cms.EDAnalyzer("GBRForestWriter",
8  jobs = cms.VPSet()
9 )
10 
11 antiMuonDiscrMVA_inputFileName = {
12  'GBRForest' : "RecoTauTag/RecoTau/data/gbrDiscriminationAgainstMuonMVA.root",
13  'TGraph' : "RecoTauTag/RecoTau/data/wpDiscriminationByMVAMuonRejection.root"
14 }
15 
16 antiMuonDiscrMVA_WPs = [ "eff99_5", "eff99_0", "eff98_0" ]
17 
18 antiMuonDiscrMVA_version = "v1"
19 
20 writeAntiMuonDiscrMVAs = cms.EDAnalyzer("GBRForestWriter",
21  jobs = cms.VPSet()
22 )
23 writeAntiMuonDiscrWPs = cms.EDAnalyzer("TGraphWriter",
24  jobs = cms.VPSet()
25 )
26 writeAntiMuonDiscrMVAoutputNormalizations = cms.EDAnalyzer("TFormulaWriter",
27  jobs = cms.VPSet()
28 )
29 
30 gbrForestName = "againstMuonMVA"
31 
32 writeAntiMuonDiscrMVAs.jobs.append(
33  cms.PSet(
34  inputFileName = cms.FileInPath(antiMuonDiscrMVA_inputFileName['GBRForest']),
35  inputFileType = cms.string("GBRForest"),
36  gbrForestName = cms.string(gbrForestName),
37  outputFileType = cms.string("SQLLite"),
38  outputRecord = cms.string("RecoTauTag_%s%s" % (gbrForestName, antiMuonDiscrMVA_version))
39  )
40 )
41 for WP in antiMuonDiscrMVA_WPs:
42  writeAntiMuonDiscrWPs.jobs.append(
43  cms.PSet(
44  inputFileName = cms.FileInPath(antiMuonDiscrMVA_inputFileName['TGraph']),
45  graphName = cms.string("opt2%s" % WP),
46  outputRecord = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, antiMuonDiscrMVA_version, WP))
47  )
48  )
49 writeAntiMuonDiscrMVAoutputNormalizations.jobs.append(
50  cms.PSet(
51  inputFileName = cms.FileInPath(antiMuonDiscrMVA_inputFileName['TGraph']),
52  formulaName = cms.string("mvaOutput_normalization_opt2"),
53  outputRecord = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, antiMuonDiscrMVA_version))
54  )
55 )
56 
57 writeAntiMuonDiscrSequence = cms.Sequence(writeAntiMuonDiscrMVAs + writeAntiMuonDiscrWPs + writeAntiMuonDiscrMVAoutputNormalizations)