CMS 3D CMS Logo

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