CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ntupleEnum._Enum Class Reference

Public Member Functions

def __init__ (self, values)
 
def toString (self, val)
 

Private Attributes

 _reverse
 

Detailed Description

Definition at line 2 of file ntupleEnum.py.

Constructor & Destructor Documentation

def ntupleEnum._Enum.__init__ (   self,
  values 
)

Definition at line 3 of file ntupleEnum.py.

3  def __init__(self, **values):
4  import six
5  self._reverse = {}
6  for key, value in six.iteritems(values):
7  setattr(self, key, value)
8  if value in self._reverse:
9  raise Exception("Value %s is already used for a key %s, tried to re-add it for key %s" % (value, self._reverse[value], key))
10  self._reverse[value] = key
11 
def __init__(self, values)
Definition: ntupleEnum.py:3

Member Function Documentation

def ntupleEnum._Enum.toString (   self,
  val 
)

Definition at line 12 of file ntupleEnum.py.

References ntupleEnum._Enum._reverse.

12  def toString(self, val):
13  return self._reverse[val]
14 
def toString(self, val)
Definition: ntupleEnum.py:12

Member Data Documentation

ntupleEnum._Enum._reverse
private

Definition at line 5 of file ntupleEnum.py.

Referenced by ntupleEnum._Enum.toString().