CMS 3D CMS Logo

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