CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
event.Event Class Reference
Inheritance diagram for event.Event:

Public Member Functions

def __init__
 
def __str__
 

Public Attributes

 eventWeight
 
 iEv
 
 input
 
 setup
 

Detailed Description

Event class.

The Looper passes the Event object to each of its Analyzers,
which in turn can:
- read some information
- add more information
- modify existing information.

Attributes:
  iEv = event processing index, starting at 0
  eventWeight = a weight, set to 1 at the beginning of the processing
  input = input, as determined by the looper
#TODO: provide a clear interface for access control (put, get, del products) - we should keep track of the name and id of the analyzer.

Definition at line 3 of file event.py.

Constructor & Destructor Documentation

def event.Event.__init__ (   self,
  iEv,
  input_data,
  setup,
  eventWeight = 1 
)

Definition at line 19 of file event.py.

19 
20  def __init__(self, iEv, input_data, setup, eventWeight=1 ):
21  self.iEv = iEv
22  self.input = input_data
23  self.setup = setup
24  self.eventWeight = eventWeight
def __init__
Definition: event.py:19
eventWeight
Definition: event.py:23

Member Function Documentation

def event.Event.__str__ (   self)

Definition at line 25 of file event.py.

References event.Event.iEv, join(), and python.multivaluedict.map().

25 
26  def __str__(self):
27  header = '{type}: {iEv}'.format( type=self.__class__.__name__,
28  iEv = self.iEv)
29  varlines = []
30  for var,value in sorted(vars(self).iteritems()):
31  tmp = value
32  # check for recursivity
33  recursive = False
34  if hasattr(value, '__getitem__'):
35  if (len(value)>0 and value[0].__class__ == value.__class__):
36  recursive = True
37  if hasattr(value, '__contains__') and \
38  not isinstance(value, (str,unicode)) and \
39  not isinstance(value, TChain) and \
40  not recursive :
41  tmp = map(str, value)
42 
43  varlines.append( '\t{var:<15}: {value}'.format(var=var, value=tmp) )
44  all = [ header ]
45  all.extend(varlines)
46  return '\n'.join( all )
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def __str__
Definition: event.py:25

Member Data Documentation

event.Event.eventWeight

Definition at line 23 of file event.py.

event.Event.iEv

Definition at line 20 of file event.py.

Referenced by event.Event.__str__().

event.Event.input

Definition at line 21 of file event.py.

event.Event.setup

Definition at line 22 of file event.py.

Referenced by looper.Looper.loop(), looper.Looper.process(), and looper.Looper.write().