CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
eventsfwlite.py
Go to the documentation of this file.
1 from DataFormats.FWLite import Events as FWLiteEvents
2 
3 class Events(object):
4  def __init__(self, files, tree_name, options=None):
5  if options is not None :
6  if not hasattr(options,"inputFiles"):
7  options.inputFiles=files
8  if not hasattr(options,"maxEvents"):
9  options.maxEvents = 0
10  if not hasattr(options,"secondaryInputFiles"):
11  options.secondaryInputFiles = []
12  self.events = FWLiteEvents(options=options)
13  else :
14  self.events = FWLiteEvents(files)
15 
16  def __len__(self):
17  return self.events.size()
18 
19  def __getattr__(self, key):
20  return getattr(self.events, key)
21 
22  def __getitem__(self, iEv):
23  self.events.to(iEv)
24  return self
list object
Definition: dbtoconf.py:77