CMS 3D CMS Logo

mvaElectronID_Fall17_iso_V1_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 
4 # Documentation of the MVA
5 # https://twiki.cern.ch/twiki/bin/viewauth/CMS/MultivariateElectronIdentificationRun2
6 # https://rembserj.web.cern.ch/rembserj/notes/Electron_MVA_ID_2017_documentation
7 
8 #
9 # In this file we define the locations of the MVA weights, cuts on the MVA values
10 # for specific working points, and configure those cuts in VID
11 #
12 
13 # The tag is an extra string attached to the names of the products
14 # such as ValueMaps that needs to distinguish cases when the same MVA estimator
15 # class is used with different tuning/weights
16 mvaTag = "Fall17IsoV1"
17 
18 # There are 6 categories in this MVA. They have to be configured in this strict order
19 # (cuts and weight files order):
20 # 0 EB1 (eta<0.8) pt 5-10 GeV | pt < ptSplit && |eta| < ebSplit
21 # 1 EB2 (eta>=0.8) pt 5-10 GeV | pt < ptSplit && |eta| >= ebSplit && |eta| < ebeeSplit
22 # 2 EE pt 5-10 GeV | pt < ptSplit && |eta| >= ebeeSplit
23 # 3 EB1 (eta<0.8) pt 10-inf GeV | pt >= ptSplit && |eta| < ebSplit
24 # 4 EB2 (eta>=0.8) pt 10-inf GeV | pt >= ptSplit && |eta| >= ebSplit && |eta| < ebeeSplit
25 # 5 EE pt 10-inf GeV | pt >= ptSplit && |eta| >= ebeeSplit
26 
27 
28 mvaFall17WeightFiles_V1 = cms.vstring(
29  "RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EB1_5_2017_puinfo_iso_BDT.weights.xml.gz",
30  "RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EB2_5_2017_puinfo_iso_BDT.weights.xml.gz",
31  "RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EE_5_2017_puinfo_iso_BDT.weights.xml.gz",
32  "RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EB1_10_2017_puinfo_iso_BDT.weights.xml.gz",
33  "RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EB2_10_2017_puinfo_iso_BDT.weights.xml.gz",
34  "RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EE_10_2017_puinfo_iso_BDT.weights.xml.gz"
35  )
36 
37 ## The working point for this MVA that is expected to have about 90% signal
38 # WP tuned to give about 90 and 80% signal efficiecny for electrons from Drell-Yan with pT > 25 GeV
39 # The working point for the low pt categories is just taken over from the high pt
40 idName90 = "mvaEleID-Fall17-iso-V1-wp90"
41 MVA_WP90 = EleMVA_WP(
42  idName90, mvaTag,
43  cutCategory0 = "0.9387070396095831 - exp(-pt / 2.6525585228167636) * 0.8222647164151365", # EB1 low pt
44  cutCategory1 = "0.8948802925677235 - exp(-pt / 2.7645670358783523) * 0.4123381218697539", # EB2 low pt
45  cutCategory2 = "-1830.8583661119892 - exp(-pt / -36578.11055382301) * -1831.2083578116517", # EE low pt
46  cutCategory3 = "0.9717674837607253 - exp(-pt / 8.912850985100356) * 1.9712414940437244", # EB1
47  cutCategory4 = "0.9458745023265976 - exp(-pt / 8.83104420392795) * 2.40849932040698", # EB2
48  cutCategory5 = "0.8979112012086751 - exp(-pt / 9.814082144168015) * 4.171581694893849", # EE
49 )
50 
51 idName80 = "mvaEleID-Fall17-iso-V1-wp80"
52 MVA_WP80 = EleMVA_WP(
53  idName80, mvaTag,
54  cutCategory0 = "0.9725509559754997 - exp(-pt / 2.976593261509491) * 0.2653858736397496", # EB1 low pt
55  cutCategory1 = "0.9508038141601247 - exp(-pt / 2.6633500558725713) * 0.2355820499260076", # EB2 low pt
56  cutCategory2 = "0.9365037167596238 - exp(-pt / 1.5765442323949856) * 3.067015289215309", # EE low pt
57  cutCategory3 = "0.9896562087723659 - exp(-pt / 10.342490511998674) * 0.40204156417414094", # EB1
58  cutCategory4 = "0.9819232656533827 - exp(-pt / 9.05548836482051) * 0.772674931169389", # EB2
59  cutCategory5 = "0.9625098201744635 - exp(-pt / 8.42589315557279) * 2.2916152615134173", # EE
60 )
61 
62 ### WP tuned for HZZ analysis with very high efficiency (about 98%)
63 # The working points were found by requiring the same signal efficiencies in
64 # each category as for the Spring 16 HZZ ID
65 # (see RecoEgamma/ElectronIdentification/python/Identification/mvaElectronID_Spring16_HZZ_V1_cff.py)
66 idNamewpLoose = "mvaEleID-Fall17-iso-V1-wpLoose"
67 MVA_WPLoose = EleMVA_WP(
68  idNamewpLoose, mvaTag,
69  cutCategory0 = "-0.09564086146419018", # EB1 low pt
70  cutCategory1 = "-0.28229916981926795", # EB2 low pt
71  cutCategory2 = "-0.05466682296962322", # EE low pt
72  cutCategory3 = "-0.833466688584422" , # EB1
73  cutCategory4 = "-0.7677000247570116" , # EB2
74  cutCategory5 = "-0.6917305995653829" # EE
75  )
76 
77 #
78 # Finally, set up VID configuration for all cuts
79 #
80 
81 # Create the PSet that will be fed to the MVA value map producer
82 mvaEleID_Fall17_iso_V1_producer_config = cms.PSet(
83  mvaName = cms.string(mvaClassName),
84  mvaTag = cms.string(mvaTag),
85  # Category parameters
86  nCategories = cms.int32(6),
87  categoryCuts = cms.vstring(*EleMVA_6CategoriesCuts),
88  # Weight files and variable definitions
89  weightFileNames = mvaFall17WeightFiles_V1,
90  variableDefinition = cms.string("RecoEgamma/ElectronIdentification/data/ElectronMVAEstimatorRun2Fall17V1Variables.txt")
91  )
92 # Create the VPset's for VID cuts
93 mvaEleID_Fall17_V1_wpLoose = configureVIDMVAEleID( MVA_WPLoose )
94 mvaEleID_Fall17_V1_wp90 = configureVIDMVAEleID( MVA_WP90)
95 mvaEleID_Fall17_V1_wp80 = configureVIDMVAEleID( MVA_WP80)
96 
97 mvaEleID_Fall17_V1_wpLoose.isPOGApproved = cms.untracked.bool(True)
98 mvaEleID_Fall17_V1_wp90.isPOGApproved = cms.untracked.bool(True)
99 mvaEleID_Fall17_V1_wp80.isPOGApproved = cms.untracked.bool(True)
def configureVIDMVAEleID(mvaWP, cutName="GsfEleMVACut")