CMS 3D CMS Logo

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