CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mvaElectronID_Spring15_25ns_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 25ns Spring15 MC samples for non-triggering electrons.
12 # See more documentation in this presentation (P.Pigard):
13 # https://indico.cern.ch/event/370506/contribution/1/attachments/1135340/1624370/20150726_EID_POG_circulating_vAsPresentedC.pdf
14 #
15 
16 # This MVA implementation class name
17 mvaSpring15NonTrigClassName = "ElectronMVAEstimatorRun2Spring15NonTrig"
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 mvaSpring15NonTrigWeightFiles_V1 = cms.vstring(
33  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB1_5_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml",
34  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB2_5_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml",
35  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EE_5_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml",
36  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB1_10_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml",
37  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB2_10_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml",
38  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EE_10_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_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 + ":" + mvaSpring15NonTrigClassName + mvaTag + "Values"
50 mvaCategoriesMapName = mvaProducerModuleLabel + ":" + mvaSpring15NonTrigClassName + mvaTag + "Categories"
51 
52 # The working point for this MVA that is expected to have about 90% signal
53 # efficiency in each category
54 idName90 = "mvaEleID-Spring15-25ns-nonTrig-V1-wp90"
55 MVA_WP90 = EleMVA_6Categories_WP(
56  idName = idName90,
57  mvaValueMapName = mvaValueMapName, # map with MVA values for all particles
58  mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
59  cutCategory0 = -0.083313, # EB1 low pt
60  cutCategory1 = -0.235222, # EB2 low pt
61  cutCategory2 = -0.67099, # EE low pt
62  cutCategory3 = 0.913286, # EB1
63  cutCategory4 = 0.805013, # EB2
64  cutCategory5 = 0.358969 # EE
65  )
66 
67 idName80 = "mvaEleID-Spring15-25ns-nonTrig-V1-wp80"
68 MVA_WP80 = EleMVA_6Categories_WP(
69  idName = idName80,
70  mvaValueMapName = mvaValueMapName, # map with MVA values for all particles
71  mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
72  cutCategory0 = 0.287435, # EB1 low pt
73  cutCategory1 = 0.221846, # EB2 low pt
74  cutCategory2 = -0.303263, # EE low pt
75  cutCategory3 = 0.967083, # EB1
76  cutCategory4 = 0.929117, # EB2
77  cutCategory5 = 0.726311 # EE
78  )
79 
80 #
81 # Finally, set up VID configuration for all cuts
82 #
83 
84 # Create the PSet that will be fed to the MVA value map producer
85 mvaEleID_Spring15_25ns_nonTrig_V1_producer_config = cms.PSet(
86  mvaName = cms.string(mvaSpring15NonTrigClassName),
87  mvaTag = cms.string(mvaTag),
88  # This MVA uses conversion info, so configure several data items on that
89  beamSpot = cms.InputTag('offlineBeamSpot'),
90  conversionsAOD = cms.InputTag('allConversions'),
91  conversionsMiniAOD = cms.InputTag('reducedEgamma:reducedConversions'),
92  #
93  weightFileNames = mvaSpring15NonTrigWeightFiles_V1
94  )
95 # Create the VPset's for VID cuts
96 mvaEleID_Spring15_25ns_nonTrig_V1_wp90 = configureVIDMVAEleID_V1( MVA_WP90 )
97 mvaEleID_Spring15_25ns_nonTrig_V1_wp80 = configureVIDMVAEleID_V1( MVA_WP80 )
98 
99 # The MD5 sum numbers below reflect the exact set of cut variables
100 # and values above. If anything changes, one has to
101 # 1) comment out the lines below about the registry,
102 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
103 # 3) update the MD5 sum strings below and uncomment the lines again.
104 #
105 
106 central_id_registry.register(mvaEleID_Spring15_25ns_nonTrig_V1_wp90.idName,
107  'ac4fdc160eefe9eae7338601c02ed4bb')
108 central_id_registry.register(mvaEleID_Spring15_25ns_nonTrig_V1_wp80.idName,
109  '113c47ceaea0fa687b8bd6d880eb4957')
110 
111 mvaEleID_Spring15_25ns_nonTrig_V1_wp90.isPOGApproved = cms.untracked.bool(True)
112 mvaEleID_Spring15_25ns_nonTrig_V1_wp80.isPOGApproved = cms.untracked.bool(True)