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
eventstfile.Events Class Reference
Inheritance diagram for eventstfile.Events:

Public Member Functions

def __init__
 
def __iter__
 
def size
 
def to
 

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 
10  def __init__(self, filename, treename, options=None):
11  self.file = TFile(filename)
12  if self.file.IsZombie():
13  raise ValueError('file {fnam} does not exist'.format(fnam=filename))
14  self.tree = self.file.Get(treename)
15  if self.tree == None: # is None would not work
16  raise ValueError('tree {tree} does not exist in file {fnam}'.format(
17  tree = treename,
18  fnam = filename
19  ))

Member Function Documentation

def eventstfile.Events.__iter__ (   self)

Definition at line 28 of file eventstfile.py.

References SimpleTreeProducer.SimpleTreeProducer.tree, eventstfile.Events.tree, CSCTFanalyzer.tree, CSCTFAnalyzer.tree, core.TreeAnalyzerNumpy.TreeAnalyzerNumpy.tree, TreeWriterForEcalCorrection.tree, TkOfflineVariables.tree, AlignmentIORootBase.tree, IsolatedParticlesGeneratedJets.tree, EcalPerEvtMatacqAnalyzer.tree, EcalMatacqAnalyzer.tree, IsoTrackCalibration.tree, HcalIsoTrkAnalyzer.tree, IsoTrackCalib.tree, IsolatedGenParticles.tree, IsolatedTracksHcalScale.tree, and IsolatedTracksNxN.tree.

28 
29  def __iter__(self):
30  return iter(self.tree)
def eventstfile.Events.size (   self)

Definition at line 20 of file eventstfile.py.

20 
21  def size(self):
22  return self.tree.GetEntries()
def eventstfile.Events.to (   self,
  iEv 
)
navigate to event iEv.

Definition at line 23 of file eventstfile.py.

References SimpleTreeProducer.SimpleTreeProducer.tree, eventstfile.Events.tree, CSCTFanalyzer.tree, CSCTFAnalyzer.tree, core.TreeAnalyzerNumpy.TreeAnalyzerNumpy.tree, TreeWriterForEcalCorrection.tree, TkOfflineVariables.tree, AlignmentIORootBase.tree, IsolatedParticlesGeneratedJets.tree, EcalPerEvtMatacqAnalyzer.tree, EcalMatacqAnalyzer.tree, IsoTrackCalibration.tree, HcalIsoTrkAnalyzer.tree, IsoTrackCalib.tree, IsolatedGenParticles.tree, IsolatedTracksHcalScale.tree, and IsolatedTracksNxN.tree.

23 
24  def to(self, iEv):
25  '''navigate to event iEv.'''
26  self.tree.GetEntry(iEv)
27  return self.tree

Member Data Documentation

eventstfile.Events.file

Definition at line 10 of file eventstfile.py.

eventstfile.Events.tree

Definition at line 13 of file eventstfile.py.

Referenced by eventstfile.Events.__iter__(), svgfig.SVG.__str__(), MetTreeProducer.MetTreeProducer.declareVariables(), core.AutoFillTreeProducer.AutoFillTreeProducer.declareVariables(), core.AutoFillTreeProducer.AutoFillTreeProducer.fillTree(), MetTreeProducer.MetTreeProducer.process(), python.cmstools.EventTree.SetAlias(), and eventstfile.Events.to().