CMS 3D CMS Logo

Classes | Functions | Variables
mvaPhotonID_tools Namespace Reference

Classes

class  PhoMVA_2Categories_WP
 

Functions

def configureFullVIDMVAPhoID (mvaTag, variablesFile, weightFiles, wpConfig, addKwargsForValueProducer)
 
def configureVIDMVAPhoID_V1 (mvaWP)
 

Variables

 ebeeSplit
 
 mvaClassName
 
 mvaProducerModuleLabel
 

Function Documentation

def mvaPhotonID_tools.configureFullVIDMVAPhoID (   mvaTag,
  variablesFile,
  weightFiles,
  wpConfig,
  addKwargsForValueProducer 
)

Definition at line 85 of file mvaPhotonID_tools.py.

References configureVIDMVAPhoID_V1().

85 def configureFullVIDMVAPhoID(mvaTag, variablesFile, weightFiles, wpConfig, **addKwargsForValueProducer):
86 
87  mvaValueMapName = mvaProducerModuleLabel + ":" + mvaClassName + mvaTag + "Values"
88  mvaCategoriesMapName = mvaProducerModuleLabel + ":" + mvaClassName + mvaTag + "Categories"
89 
90  # Create the PSet that will be fed to the MVA value map producer
91  producer_config = cms.PSet(
92  mvaName = cms.string(mvaClassName),
93  mvaTag = cms.string(mvaTag),
94  weightFileNames = cms.vstring(*weightFiles),
95  variableDefinition = cms.string(variablesFile),
96  ebeeSplit = cms.double(ebeeSplit),
97  **addKwargsForValueProducer
98  )
99 
100  # Create the VPset's for VID cuts
101  VID_config = {}
102  for wpc in wpConfig:
103  idName = wpc["idName"]
104  VID_config[idName] = configureVIDMVAPhoID_V1(
106  idName = idName,
107  mvaValueMapName = mvaValueMapName, # map with MVA values for all particles
108  mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
109  cutCategory0 = wpc["cuts"]["EB"], # EB
110  cutCategory1 = wpc["cuts"]["EE"] # EE
111  )
112  )
113 
114  configs = {"producer_config": producer_config, "VID_config": VID_config}
115  return configs
116 
def configureFullVIDMVAPhoID(mvaTag, variablesFile, weightFiles, wpConfig, addKwargsForValueProducer)
def configureVIDMVAPhoID_V1(mvaWP)
def mvaPhotonID_tools.configureVIDMVAPhoID_V1 (   mvaWP)
This function configures the full cms.PSet for a VID ID and returns it.
The inputs: an object of the class PhoMVA_2Categories_WP or similar
that contains all necessary parameters for this MVA.

Definition at line 46 of file mvaPhotonID_tools.py.

Referenced by configureFullVIDMVAPhoID().

47  """
48  This function configures the full cms.PSet for a VID ID and returns it.
49  The inputs: an object of the class PhoMVA_2Categories_WP or similar
50  that contains all necessary parameters for this MVA.
51  """
52  parameterSet = cms.PSet(
53  #
54  idName = cms.string( mvaWP.idName ),
55  cutFlow = cms.VPSet(
56  cms.PSet( cutName = cms.string("PhoMVACut"),
57  mvaCuts = cms.vdouble( mvaWP.getCutValues() ),
58  mvaValueMapName = cms.InputTag( mvaWP.mvaValueMapName ),
59  mvaCategoriesMapName =cms.InputTag( mvaWP.mvaCategoriesMapName ),
60  needsAdditionalProducts = cms.bool(True),
61  isIgnored = cms.bool(False)
62  )
63  )
64  )
65  #
66  return parameterSet
67 
68 # ===============================================
69 # High level function to create a two category ID
70 # ===============================================
71 
72 # mvaTag:
73 # The mvaTag is an extra string attached to the names of the products
74 # such as ValueMaps that needs to distinguish cases when the same MVA estimator
75 # class is used with different tuning/weights
76 # variablesFile:
77 # The file listing the variables used in this MVA
78 # weightFiles:
79 # The weight files in the order EB first, then EE
80 # wpConfig:
81 # A dictionary with the names and cut values of the working points
82 # addKwargsForValueProducer:
83 # Additional keyword parameters passed to the producer config
84 
def configureVIDMVAPhoID_V1(mvaWP)

Variable Documentation

mvaPhotonID_tools.ebeeSplit

Definition at line 5 of file mvaPhotonID_tools.py.

mvaPhotonID_tools.mvaClassName

Definition at line 8 of file mvaPhotonID_tools.py.

mvaPhotonID_tools.mvaProducerModuleLabel

Definition at line 14 of file mvaPhotonID_tools.py.