CMS 3D CMS Logo

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