CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mvaPhotonID_PHYS14_PU20bx25_nonTrig_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 PHYS14 MC samples for non-triggering photons.
12 # See more documentation in this presentation:
13 # https://indico.cern.ch/event/369217/contribution/2/material/slides/0.pdf
14 #
15 
16 # This MVA implementation class name
17 mvaPhys14NonTrigClassName = "PhotonMVAEstimatorRun2Phys14NonTrig"
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 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 mvaPhys14NonTrigWeightFiles_V1 = cms.vstring(
29  "RecoEgamma/PhotonIdentification/data/PHYS14/photon_general_MVA_phys14_pu20bx25_EB_V1.weights.xml",
30  "RecoEgamma/PhotonIdentification/data/PHYS14/photon_general_MVA_phys14_pu20bx25_EE_V1.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 + ":" + mvaPhys14NonTrigClassName + mvaTag + "Values"
42 mvaCategoriesMapName = mvaProducerModuleLabel + ":" + mvaPhys14NonTrigClassName + 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-PHYS14-PU20bx25-nonTrig-V1-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.593, # EB
53  cutCategory1 = 0.679 # 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_PHYS14_PU20bx25_nonTrig_V1_producer_config = cms.PSet(
62  mvaName = cms.string(mvaPhys14NonTrigClassName),
63  mvaTag = cms.string(mvaTag),
64  weightFileNames = mvaPhys14NonTrigWeightFiles_V1,
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_PHYS14_PU20bx25_nonTrig_V1_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_PHYS14_PU20bx25_nonTrig_V1_wp90.idName,
98  'f3ff6ade4680f277c31deb921aa370e4')
99 
100 mvaPhoID_PHYS14_PU20bx25_nonTrig_V1_wp90.isPOGApproved = cms.untracked.bool(True)