CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mvaElectronID_Spring15_25ns_Trig_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 triggering electrons.
12 # See more documentation in this presentation (P.Pigard):
13 # https://indico.cern.ch/event/369245/contribution/3/attachments/1153011/1655996/20150910_EID_POG_vAsPresented.pdf
14 #
15 
16 # This MVA implementation class name
17 mvaSpring15TrigClassName = "ElectronMVAEstimatorRun2Spring15Trig"
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 3 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)
26 # 1 EB2 (eta>=0.8)
27 # 2 EE
28 
29 mvaSpring15TrigWeightFiles_V1 = cms.vstring(
30  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB1_10_oldTrigSpring15_25ns_data_1_VarD_TMVA412_Sig6BkgAll_MG_noSpec_BDT.weights.xml",
31  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB2_10_oldTrigSpring15_25ns_data_1_VarD_TMVA412_Sig6BkgAll_MG_noSpec_BDT.weights.xml",
32  "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EE_10_oldTrigSpring15_25ns_data_1_VarD_TMVA412_Sig6BkgAll_MG_noSpec_BDT.weights.xml"
33  )
34 
35 # Load some common definitions for MVA machinery
37 
38 # The locatoins of value maps with the actual MVA values and categories
39 # for all particles.
40 # The names for the maps are "<module name>:<MVA class name>Values"
41 # and "<module name>:<MVA class name>Categories"
42 mvaProducerModuleLabel = "electronMVAValueMapProducer"
43 mvaValueMapName = mvaProducerModuleLabel + ":" + mvaSpring15TrigClassName + mvaTag + "Values"
44 mvaCategoriesMapName = mvaProducerModuleLabel + ":" + mvaSpring15TrigClassName + mvaTag + "Categories"
45 
46 # The working point for this MVA that is expected to have about 90% signal
47 # efficiency in each category
48 idName90 = "mvaEleID-Spring15-25ns-Trig-V1-wp90"
49 MVA_WP90 = EleMVA_3Categories_WP(
50  idName = idName90,
51  mvaValueMapName = mvaValueMapName, # map with MVA values for all particles
52  mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
53  cutCategory0 = 0.972153, # EB1
54  cutCategory1 = 0.922126, # EB2
55  cutCategory2 = 0.610764 # EE
56  )
57 
58 idName80 = "mvaEleID-Spring15-25ns-Trig-V1-wp80"
59 MVA_WP80 = EleMVA_3Categories_WP(
60  idName = idName80,
61  mvaValueMapName = mvaValueMapName, # map with MVA values for all particles
62  mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
63  cutCategory0 = 0.988153, # EB1
64  cutCategory1 = 0.96791 , # EB2
65  cutCategory2 = 0.841729 # EE
66  )
67 
68 #
69 # Finally, set up VID configuration for all cuts
70 #
71 
72 # Create the PSet that will be fed to the MVA value map producer
73 mvaEleID_Spring15_25ns_Trig_V1_producer_config = cms.PSet(
74  mvaName = cms.string(mvaSpring15TrigClassName),
75  mvaTag = cms.string(mvaTag),
76  # This MVA uses conversion info, so configure several data items on that
77  beamSpot = cms.InputTag('offlineBeamSpot'),
78  conversionsAOD = cms.InputTag('allConversions'),
79  conversionsMiniAOD = cms.InputTag('reducedEgamma:reducedConversions'),
80  #
81  weightFileNames = mvaSpring15TrigWeightFiles_V1
82  )
83 # Create the VPset's for VID cuts
84 mvaEleID_Spring15_25ns_Trig_V1_wp90 = configureVIDMVAEleID_V1( MVA_WP90 )
85 mvaEleID_Spring15_25ns_Trig_V1_wp80 = configureVIDMVAEleID_V1( MVA_WP80 )
86 
87 # The MD5 sum numbers below reflect the exact set of cut variables
88 # and values above. If anything changes, one has to
89 # 1) comment out the lines below about the registry,
90 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
91 # 3) update the MD5 sum strings below and uncomment the lines again.
92 #
93 
94 central_id_registry.register(mvaEleID_Spring15_25ns_Trig_V1_wp90.idName,
95  'bb430b638bf3a4d970627021b0da63ae')
96 central_id_registry.register(mvaEleID_Spring15_25ns_Trig_V1_wp80.idName,
97  '81046ab478185af337be1be9b30948ae')
98 
99 mvaEleID_Spring15_25ns_Trig_V1_wp90.isPOGApproved = cms.untracked.bool(True)
100 mvaEleID_Spring15_25ns_Trig_V1_wp80.isPOGApproved = cms.untracked.bool(True)