Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoEgamma
ElectronIdentification
python
Identification
mvaElectronID_tools.py
Go to the documentation of this file.
1
import
FWCore.ParameterSet.Config
as
cms
2
3
# =======================================================
4
# Define simple containers for MVA cut values and related
5
# =======================================================
6
7
class
EleMVA_3Categories_WP
:
8
"""
9
This is a container class to hold MVA cut values for a 3-category MVA
10
as well as the names of the value maps that contain the MVA values computed
11
for all particles in a producer upstream.
12
"""
13
def
__init__
(self,
14
idName,
15
mvaValueMapName,
16
mvaCategoriesMapName,
17
cutCategory0,
18
cutCategory1,
19
cutCategory2
20
):
21
self.
idName
= idName
22
self.
mvaValueMapName
= mvaValueMapName
23
self.
mvaCategoriesMapName
= mvaCategoriesMapName
24
self.
cutCategory0
= cutCategory0
25
self.
cutCategory1
= cutCategory1
26
self.
cutCategory2
= cutCategory2
27
28
def
getCutValues
(self):
29
return
[self.
cutCategory0
, self.
cutCategory1
, self.
cutCategory2
]
30
31
class
EleMVA_6Categories_WP
:
32
"""
33
This is a container class to hold MVA cut values for a 6-category MVA
34
as well as the names of the value maps that contain the MVA values computed
35
for all particles in a producer upstream.
36
"""
37
def
__init__
(self,
38
idName,
39
mvaValueMapName,
40
mvaCategoriesMapName,
41
cutCategory0,
42
cutCategory1,
43
cutCategory2,
44
cutCategory3,
45
cutCategory4,
46
cutCategory5
47
):
48
self.
idName
= idName
49
self.
mvaValueMapName
= mvaValueMapName
50
self.
mvaCategoriesMapName
= mvaCategoriesMapName
51
self.
cutCategory0
= cutCategory0
52
self.
cutCategory1
= cutCategory1
53
self.
cutCategory2
= cutCategory2
54
self.
cutCategory3
= cutCategory3
55
self.
cutCategory4
= cutCategory4
56
self.
cutCategory5
= cutCategory5
57
58
def
getCutValues
(self):
59
return
[self.
cutCategory0
, self.
cutCategory1
, self.
cutCategory2
,
60
self.
cutCategory3
, self.
cutCategory4
, self.
cutCategory5
]
61
62
# ==============================================================
63
# Define the complete MVA cut sets
64
# ==============================================================
65
66
def
configureVIDMVAEleID_V1
( mvaWP ):
67
"""
68
This function configures the full cms.PSet for a VID ID and returns it.
69
The inputs: an object of the class EleMVA_6Categories_WP or similar
70
that contains all necessary parameters for this MVA.
71
"""
72
parameterSet = cms.PSet(
73
#
74
idName = cms.string( mvaWP.idName ),
75
cutFlow = cms.VPSet(
76
cms.PSet( cutName = cms.string(
"GsfEleMVACut"
),
77
mvaCuts = cms.vdouble( mvaWP.getCutValues() ),
78
mvaValueMapName = cms.InputTag( mvaWP.mvaValueMapName ),
79
mvaCategoriesMapName =cms.InputTag( mvaWP.mvaCategoriesMapName ),
80
needsAdditionalProducts = cms.bool(
True
),
81
isIgnored = cms.bool(
False
)
82
)
83
)
84
)
85
#
86
return
parameterSet
mvaElectronID_tools.EleMVA_6Categories_WP.idName
idName
Definition:
mvaElectronID_tools.py:48
mvaElectronID_tools.EleMVA_3Categories_WP.mvaCategoriesMapName
mvaCategoriesMapName
Definition:
mvaElectronID_tools.py:23
Config
mvaElectronID_tools.EleMVA_3Categories_WP.cutCategory1
cutCategory1
Definition:
mvaElectronID_tools.py:25
mvaElectronID_tools.EleMVA_6Categories_WP.getCutValues
def getCutValues
Definition:
mvaElectronID_tools.py:58
mvaElectronID_tools.EleMVA_6Categories_WP.cutCategory5
cutCategory5
Definition:
mvaElectronID_tools.py:56
mvaElectronID_tools.configureVIDMVAEleID_V1
def configureVIDMVAEleID_V1
Definition:
mvaElectronID_tools.py:66
mvaElectronID_tools.EleMVA_3Categories_WP.idName
idName
Definition:
mvaElectronID_tools.py:21
mvaElectronID_tools.EleMVA_3Categories_WP.cutCategory0
cutCategory0
Definition:
mvaElectronID_tools.py:24
mvaElectronID_tools.EleMVA_3Categories_WP.getCutValues
def getCutValues
Definition:
mvaElectronID_tools.py:28
mvaElectronID_tools.EleMVA_3Categories_WP.cutCategory2
cutCategory2
Definition:
mvaElectronID_tools.py:26
mvaElectronID_tools.EleMVA_6Categories_WP.cutCategory0
cutCategory0
Definition:
mvaElectronID_tools.py:51
mvaElectronID_tools.EleMVA_6Categories_WP.cutCategory4
cutCategory4
Definition:
mvaElectronID_tools.py:55
mvaElectronID_tools.EleMVA_6Categories_WP.mvaCategoriesMapName
mvaCategoriesMapName
Definition:
mvaElectronID_tools.py:50
mvaElectronID_tools.EleMVA_3Categories_WP.__init__
def __init__
Definition:
mvaElectronID_tools.py:20
mvaElectronID_tools.EleMVA_6Categories_WP.mvaValueMapName
mvaValueMapName
Definition:
mvaElectronID_tools.py:49
mvaElectronID_tools.EleMVA_6Categories_WP.cutCategory3
cutCategory3
Definition:
mvaElectronID_tools.py:54
mvaElectronID_tools.EleMVA_6Categories_WP
Definition:
mvaElectronID_tools.py:31
mvaElectronID_tools.EleMVA_3Categories_WP
Definition:
mvaElectronID_tools.py:7
mvaElectronID_tools.EleMVA_3Categories_WP.mvaValueMapName
mvaValueMapName
Definition:
mvaElectronID_tools.py:22
mvaElectronID_tools.EleMVA_6Categories_WP.cutCategory1
cutCategory1
Definition:
mvaElectronID_tools.py:52
mvaElectronID_tools.EleMVA_6Categories_WP.cutCategory2
cutCategory2
Definition:
mvaElectronID_tools.py:53
mvaElectronID_tools.EleMVA_6Categories_WP.__init__
def __init__
Definition:
mvaElectronID_tools.py:47
Generated for CMSSW Reference Manual by
1.8.5