CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, filename, treename, options=None)
 
def __iter__ (self)
 
def size (self)
 
def to (self, iEv)
 

Public Attributes

 file
 
 tree
 

Detailed Description

Event list from a tree in a root file.

Definition at line 6 of file eventstfile.py.

Constructor & Destructor Documentation

def eventstfile.Events.__init__ (   self,
  filename,
  treename,
  options = None 
)

Definition at line 9 of file eventstfile.py.

9  def __init__(self, filename, treename, options=None):
10  self.file = TFile(filename)
11  if self.file.IsZombie():
12  raise ValueError('file {fnam} does not exist'.format(fnam=filename))
13  self.tree = self.file.Get(treename)
14  if self.tree == None: # is None would not work
15  raise ValueError('tree {tree} does not exist in file {fnam}'.format(
16  tree = treename,
17  fnam = filename
18  ))
19 
def __init__(self, filename, treename, options=None)
Definition: eventstfile.py:9

Member Function Documentation

def eventstfile.Events.__iter__ (   self)
def eventstfile.Events.size (   self)

Definition at line 20 of file eventstfile.py.

Referenced by ntupleDataFormat._Collection.__iter__(), and ntupleDataFormat._Collection.__len__().

20  def size(self):
21  return self.tree.GetEntries()
22 

Member Data Documentation

eventstfile.Events.file

Definition at line 10 of file eventstfile.py.