CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
event.Event Class Reference
Inheritance diagram for event.Event:

Public Member Functions

def __init__ (self, iEv, input_data=None, setup=None, eventWeight=1)
 
def __str__ (self)
 

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 5 of file event.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 21 of file event.py.

21  def __init__(self, iEv, input_data=None, setup=None, eventWeight=1 ):
22  self.iEv = iEv
23  self.input = input_data
24  self.setup = setup
25  self.eventWeight = eventWeight
26 

Member Function Documentation

◆ __str__()

def event.Event.__str__ (   self)

Definition at line 27 of file event.py.

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

References __class__< T >.__class__(), event.Event.iEv, join(), and genParticles_cff.map.

Member Data Documentation

◆ eventWeight

event.Event.eventWeight

Definition at line 25 of file event.py.

◆ iEv

event.Event.iEv

Definition at line 22 of file event.py.

Referenced by event.Event.__str__().

◆ input

event.Event.input

Definition at line 23 of file event.py.

◆ setup

event.Event.setup
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103
format
genParticles_cff.map
map
Definition: genParticles_cff.py:11