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

Member Function Documentation

def ntupleEnum._Enum.toString (   self,
  val 
)

Definition at line 11 of file ntupleEnum.py.

References ntupleEnum._Enum._reverse.

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

Member Data Documentation

ntupleEnum._Enum._reverse
private

Definition at line 4 of file ntupleEnum.py.

Referenced by ntupleEnum._Enum.toString().