CMS 3D CMS Logo

List of all members | Public Member Functions
ntupleDataFormat.Seeds Class Reference
Inheritance diagram for ntupleDataFormat.Seeds:
ntupleDataFormat._Collection

Public Member Functions

def __init__ (self, tree)
 
def nSeedsForAlgo (self, algo)
 
def seedForAlgo (self, algo, iseed)
 
def seedsForAlgo (self, algo)
 
- Public Member Functions inherited from ntupleDataFormat._Collection
def __getitem__ (self, index)
 
def __init__ (self, tree, sizeBranch, objclass)
 
def __iter__ (self)
 
def __len__ (self)
 
def size (self)
 

Detailed Description

Class presenting a collection of seeds.

Definition at line 918 of file ntupleDataFormat.py.

Constructor & Destructor Documentation

def ntupleDataFormat.Seeds.__init__ (   self,
  tree 
)
Constructor.

Arguments:
tree -- TTree object

Definition at line 920 of file ntupleDataFormat.py.

920  def __init__(self, tree):
921  """Constructor.
922 
923  Arguments:
924  tree -- TTree object
925  """
926  super(Seeds, self).__init__(tree, "see_pt", Seed)
927 
def __init__(self, tree)

Member Function Documentation

def ntupleDataFormat.Seeds.nSeedsForAlgo (   self,
  algo 
)
Returns the number of seeds for a given 'algo'.

Definition at line 928 of file ntupleDataFormat.py.

References ntupleDataFormat._seedOffsetForAlgo(), ntupleDataFormat._Collection._tree, and python.cmstools.EventTree._tree.

928  def nSeedsForAlgo(self, algo):
929  """Returns the number of seeds for a given 'algo'."""
930  (offset, next_offset) = _seedOffsetForAlgo(self._tree, algo)
931  return next_offset - offset
932 
def nSeedsForAlgo(self, algo)
def _seedOffsetForAlgo(tree, algo)
def ntupleDataFormat.Seeds.seedForAlgo (   self,
  algo,
  iseed 
)
Returns Seed of index 'iseed' for 'algo'.

Definition at line 942 of file ntupleDataFormat.py.

References ntupleDataFormat._seedOffsetForAlgo(), ntupleDataFormat._Collection._tree, and python.cmstools.EventTree._tree.

942  def seedForAlgo(self, algo, iseed):
943  """Returns Seed of index 'iseed' for 'algo'."""
944  (offset, next_offset) = _seedOffsetForAlgo(self._tree, algo)
945  if iseed >= (next_offset-offset):
946  raise Exception("Seed index %d is larger than the number of seeds %d for algo %d (%s)" % (iseed, next_offset-offset, algo, Algo.toString(algo)))
947  return Seed(self._tree, offset+iseed)
948 
def seedForAlgo(self, algo, iseed)
def _seedOffsetForAlgo(tree, algo)
def ntupleDataFormat.Seeds.seedsForAlgo (   self,
  algo 
)
Returns generator iterating over the seeds of a given 'algo'.

Generator returns Seed object.

Definition at line 933 of file ntupleDataFormat.py.

References ntupleDataFormat._seedOffsetForAlgo(), ntupleDataFormat._Collection._tree, and python.cmstools.EventTree._tree.

933  def seedsForAlgo(self, algo):
934  """Returns generator iterating over the seeds of a given 'algo'.
935 
936  Generator returns Seed object.
937  """
938  (offset, next_offset) = _seedOffsetForAlgo(self._tree, algo)
939  for isee in xrange(offset, next_offset):
940  yield Seed(self._tree, isee)
941 
def seedsForAlgo(self, algo)
def _seedOffsetForAlgo(tree, algo)