CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mvaElectronID_PHYS14_PU20bx25_nonTrig_V1_cff.py
Go to the documentation of this file.
1 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
2 
3 import FWCore.ParameterSet.Config as cms
4 
5 #
6 # In this file we define the locations of the MVA weights, cuts on the MVA values
7 # for specific working points, and configure those cuts in VID
8 #
9 
10 #
11 # The following MVA is derived for PHYS14 MC samples for non-triggering electrons.
12 # See more documentation in this presentation:
13 # https://indico.cern.ch/event/367861/contribution/1/material/slides/0.pdf
14 #
15 
16 # This MVA implementation class name
17 mvaPhys14NonTrigClassName = "ElectronMVAEstimatorRun2Phys14NonTrig"
18 # The tag is an extra string attached to the names of the products
19 # such as ValueMaps that needs to distinguish cases when the same MVA estimator
20 # class is used with different tuning/weights
21 mvaTag = "25nsV1"
22 
23 # There are 6 categories in this MVA. They have to be configured in this strict order
24 # (cuts and weight files order):
25 # 0 EB1 (eta<0.8) pt 5-10 GeV
26 # 1 EB2 (eta>=0.8) pt 5-10 GeV
27 # 2 EE pt 5-10 GeV
28 # 3 EB1 (eta<0.8) pt 10-inf GeV
29 # 4 EB2 (eta>=0.8) pt 10-inf GeV
30 # 5 EE pt 10-inf GeV
31 
32 mvaPhys14NonTrigWeightFiles_V1 = cms.vstring(
33  "RecoEgamma/ElectronIdentification/data/PHYS14/EIDmva_EB1_5_oldscenario2phys14_BDT.weights.xml",
34  "RecoEgamma/ElectronIdentification/data/PHYS14/EIDmva_EB2_5_oldscenario2phys14_BDT.weights.xml",
35  "RecoEgamma/ElectronIdentification/data/PHYS14/EIDmva_EE_5_oldscenario2phys14_BDT.weights.xml",
36  "RecoEgamma/ElectronIdentification/data/PHYS14/EIDmva_EB1_10_oldscenario2phys14_BDT.weights.xml",
37  "RecoEgamma/ElectronIdentification/data/PHYS14/EIDmva_EB2_10_oldscenario2phys14_BDT.weights.xml",
38  "RecoEgamma/ElectronIdentification/data/PHYS14/EIDmva_EE_10_oldscenario2phys14_BDT.weights.xml"
39  )
40 
41 # Load some common definitions for MVA machinery
43 
44 # The locatoins of value maps with the actual MVA values and categories
45 # for all particles.
46 # The names for the maps are "<module name>:<MVA class name>Values"
47 # and "<module name>:<MVA class name>Categories"
48 mvaProducerModuleLabel = "electronMVAValueMapProducer"
49 mvaValueMapName = mvaProducerModuleLabel + ":" + mvaPhys14NonTrigClassName + mvaTag + "Values"
50 mvaCategoriesMapName = mvaProducerModuleLabel + ":" + mvaPhys14NonTrigClassName + mvaTag + "Categories"
51 
52 # The working point for this MVA that is expected to have about 80% signal
53 # efficiency on in each category
54 idName = "mvaEleID-PHYS14-PU20bx25-nonTrig-V1-wp80"
55 MVA_WP80 = EleMVA_6Categories_WP(
56  idName,
57  mvaValueMapName, # map with MVA values for all particles
58  mvaCategoriesMapName, # map with category index for all particles
59  cutCategory0 = -0.253, # EB1 low pt
60  cutCategory1 = 0.081, # EB2 low pt
61  cutCategory2 = -0.081, # EE low pt
62  cutCategory3 = 0.965, # EB1
63  cutCategory4 = 0.917, # EB2
64  cutCategory5 = 0.683 # EE
65  )
66 
67 # The working point for this MVA that is expected to have about 90% signal
68 # efficiency in each category
69 idName = "mvaEleID-PHYS14-PU20bx25-nonTrig-V1-wp90"
70 MVA_WP90 = EleMVA_6Categories_WP(
71  idName = idName,
72  mvaValueMapName = mvaValueMapName, # map with MVA values for all particles
73  mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
74  cutCategory0 = -0.483, # EB1 low pt
75  cutCategory1 = -0.267, # EB2 low pt
76  cutCategory2 = -0.323, # EE low pt
77  cutCategory3 = 0.933, # EB1
78  cutCategory4 = 0.825, # EB2
79  cutCategory5 = 0.337 # EE
80  )
81 
82 #
83 # Finally, set up VID configuration for all cuts
84 #
85 
86 # Create the PSet that will be fed to the MVA value map producer
87 mvaEleID_PHYS14_PU20bx25_nonTrig_V1_producer_config = cms.PSet(
88  mvaName = cms.string(mvaPhys14NonTrigClassName),
89  mvaTag = cms.string(mvaTag),
90  weightFileNames = mvaPhys14NonTrigWeightFiles_V1
91  )
92 # Create the VPset's for VID cuts
93 mvaEleID_PHYS14_PU20bx25_nonTrig_V1_wp80 = configureVIDMVAEleID_V1( MVA_WP80 )
94 mvaEleID_PHYS14_PU20bx25_nonTrig_V1_wp90 = configureVIDMVAEleID_V1( MVA_WP90 )
95 
96 # The MD5 sum numbers below reflect the exact set of cut variables
97 # and values above. If anything changes, one has to
98 # 1) comment out the lines below about the registry,
99 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
100 # 3) update the MD5 sum strings below and uncomment the lines again.
101 #
102 
103 central_id_registry.register( mvaEleID_PHYS14_PU20bx25_nonTrig_V1_wp80.idName,
104  '768465d41956da069c83bf245398d5e6')
105 central_id_registry.register( mvaEleID_PHYS14_PU20bx25_nonTrig_V1_wp90.idName,
106  '7d091368510c32f0ab29a53323cae95a')
107 
108 mvaEleID_PHYS14_PU20bx25_nonTrig_V1_wp80.isPOGApproved = cms.untracked.bool(False)
109 mvaEleID_PHYS14_PU20bx25_nonTrig_V1_wp90.isPOGApproved = cms.untracked.bool(False)