CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mvaPhotonID_Spring15_50ns_nonTrig_V0_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 Spring15 MC samples for non-triggering photons.
12 # See more documentation in this presentation:
13 # https://indico.cern.ch/event/369233/contribution/3/material/slides/0.pdf
14 #
15 
16 # This MVA implementation class name
17 mvaSpring15NonTrigClassName = "PhotonMVAEstimatorRun2Spring15NonTrig"
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 = "50nsV0"
22 
23 # There are 2 categories in this MVA. They have to be configured in this strict order
24 # (cuts and weight files order):
25 # 0 barrel photons
26 # 1 endcap photons
27 
28 mvaSpring15NonTrigWeightFiles_V0 = cms.vstring(
29  "RecoEgamma/PhotonIdentification/data/Spring15/photon_general_MVA_Spring15_50ns_EB_V0.weights.xml",
30  "RecoEgamma/PhotonIdentification/data/Spring15/photon_general_MVA_Spring15_50ns_EE_V0.weights.xml"
31  )
32 
33 # Load some common definitions for MVA machinery
35 
36 # The locatoins of value maps with the actual MVA values and categories
37 # for all particles.
38 # The names for the maps are "<module name>:<MVA class name>Values"
39 # and "<module name>:<MVA class name>Categories"
40 mvaProducerModuleLabel = "photonMVAValueMapProducer"
41 mvaValueMapName = mvaProducerModuleLabel + ":" + mvaSpring15NonTrigClassName + mvaTag + "Values"
42 mvaCategoriesMapName = mvaProducerModuleLabel + ":" + mvaSpring15NonTrigClassName + mvaTag + "Categories"
43 
44 # The working point for this MVA that is expected to have about 90% signal
45 # efficiency in each category for photons with pt>30 GeV (somewhat lower
46 # for lower pt photons).
47 idName = "mvaPhoID-Spring15-50ns-nonTrig-V0-wp90"
48 MVA_WP90 = PhoMVA_2Categories_WP(
49  idName = idName,
50  mvaValueMapName = mvaValueMapName, # map with MVA values for all particles
51  mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
52  cutCategory0 = 0.224, # EB
53  cutCategory1 = 0.355 # EE
54  )
55 
56 #
57 # Finally, set up VID configuration for all cuts
58 #
59 
60 # Create the PSet that will be fed to the MVA value map producer
61 mvaPhoID_Spring15_50ns_nonTrig_V0_producer_config = cms.PSet(
62  mvaName = cms.string(mvaSpring15NonTrigClassName),
63  mvaTag = cms.string(mvaTag),
64  weightFileNames = mvaSpring15NonTrigWeightFiles_V0,
65  #
66  # All the event content needed for this MVA implementation follows
67  #
68  # All the value maps: these are expected to be produced by the
69  # PhotonIDValueMapProducer running upstream
70  #
71  useValueMaps = cms.bool(True),
72  full5x5SigmaIEtaIEtaMap = cms.InputTag("photonIDValueMapProducer:phoFull5x5SigmaIEtaIEta"),
73  full5x5SigmaIEtaIPhiMap = cms.InputTag("photonIDValueMapProducer:phoFull5x5SigmaIEtaIPhi"),
74  full5x5E1x3Map = cms.InputTag("photonIDValueMapProducer:phoFull5x5E1x3"),
75  full5x5E2x2Map = cms.InputTag("photonIDValueMapProducer:phoFull5x5E2x2"),
76  full5x5E2x5MaxMap = cms.InputTag("photonIDValueMapProducer:phoFull5x5E2x5Max"),
77  full5x5E5x5Map = cms.InputTag("photonIDValueMapProducer:phoFull5x5E5x5"),
78  esEffSigmaRRMap = cms.InputTag("photonIDValueMapProducer:phoESEffSigmaRR"),
79  phoChargedIsolation = cms.InputTag("photonIDValueMapProducer:phoChargedIsolation"),
80  phoPhotonIsolation = cms.InputTag("photonIDValueMapProducer:phoPhotonIsolation"),
81  phoWorstChargedIsolation = cms.InputTag("photonIDValueMapProducer:phoWorstChargedIsolation"),
82  #
83  # Original event content: pileup in this case
84  #
85  rho = cms.InputTag("fixedGridRhoFastjetAll")
86  )
87 # Create the VPset's for VID cuts
88 mvaPhoID_Spring15_50ns_nonTrig_V0_wp90 = configureVIDMVAPhoID_V1( MVA_WP90 )
89 
90 # The MD5 sum numbers below reflect the exact set of cut variables
91 # and values above. If anything changes, one has to
92 # 1) comment out the lines below about the registry,
93 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
94 # 3) update the MD5 sum strings below and uncomment the lines again.
95 #
96 
97 central_id_registry.register( mvaPhoID_Spring15_50ns_nonTrig_V0_wp90.idName,
98  'f7632ecc85a3b775335fd9bf78f468df')
99 
100 mvaPhoID_Spring15_50ns_nonTrig_V0_wp90.isPOGApproved = cms.untracked.bool(False)