CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
ntuple._RecoHitAdaptor Class Reference
Inheritance diagram for ntuple._RecoHitAdaptor:
ntuple.Seed ntuple.SimHit ntuple.Track

Public Member Functions

def __init__
 
def gluedHits
 
def hits
 
def invalidHits
 
def pixelHits
 
def stripHits
 

Private Member Functions

def _hits
 

Detailed Description

Adaptor class for objects containing hits (e.g. tracks)

Definition at line 153 of file ntuple.py.

Constructor & Destructor Documentation

def ntuple._RecoHitAdaptor.__init__ (   self)

Definition at line 155 of file ntuple.py.

156  def __init__(self):
157  super(_RecoHitAdaptor, self).__init__()

Member Function Documentation

def ntuple._RecoHitAdaptor._hits (   self)
private
Internal method to generate pairs of hit index and type.

Definition at line 158 of file ntuple.py.

References ComparisonHelper.zip().

Referenced by ntuple._RecoHitAdaptor.gluedHits(), ntuple._RecoHitAdaptor.hits(), ntuple._RecoHitAdaptor.invalidHits(), ntuple._RecoHitAdaptor.pixelHits(), and ntuple._RecoHitAdaptor.stripHits().

159  def _hits(self):
160  """Internal method to generate pairs of hit index and type."""
161  for ihit, hitType in zip(self.hitIdx(), self.hitType()):
162  yield (ihit, hitType)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def ntuple._RecoHitAdaptor.gluedHits (   self)
Returns generator for matched strip hits.

Definition at line 198 of file ntuple.py.

References ntuple._Object._checkIsValid(), FP420HitsObject._hits, TrackerHitsObject._hits, SortingOutput._hits, ntuple._RecoHitAdaptor._hits(), MatchingOutput._hits, DTBtiChip._hits, ntuple._Collection._tree, python.cmstools.EventTree._tree, ntuple._Object._tree, ntuple.TrackingNtuple._tree, ntuple.Event._tree, and ntuple.BeamSpot._tree.

199  def gluedHits(self):
200  """Returns generator for matched strip hits."""
201  self._checkIsValid()
202  for ihit, hitType in self._hits():
203  if hitType != 2:
204  continue
205  yield GluedHit(self._tree, ihit)
def ntuple._RecoHitAdaptor.hits (   self)
Returns generator for hits.

Generator returns PixelHit/StripHit/GluedHit depending on the
hit type.

Definition at line 163 of file ntuple.py.

References FP420HitsObject._hits, TrackerHitsObject._hits, SortingOutput._hits, ntuple._RecoHitAdaptor._hits(), MatchingOutput._hits, DTBtiChip._hits, ntuple._Collection._tree, python.cmstools.EventTree._tree, ntuple._Object._tree, ntuple.TrackingNtuple._tree, ntuple.Event._tree, and ntuple.BeamSpot._tree.

164  def hits(self):
165  """Returns generator for hits.
166 
167  Generator returns PixelHit/StripHit/GluedHit depending on the
168  hit type.
169 
170  """
171  for ihit, hitType in self._hits():
172  if hitType == 0:
173  yield PixelHit(self._tree, ihit)
174  elif hitType == 1:
175  yield StripHit(self._tree, ihit)
176  elif hitType == 2:
177  yield GluedHit(self._tree, ihit)
178  elif hitType == 3:
179  yield InvalidHit(self._tree, ihit)
180  else:
181  raise Exception("Unknown hit type %d" % hitType)
def ntuple._RecoHitAdaptor.invalidHits (   self)
Returns generator for invalid hits.

Definition at line 206 of file ntuple.py.

References ntuple._Object._checkIsValid(), FP420HitsObject._hits, TrackerHitsObject._hits, SortingOutput._hits, ntuple._RecoHitAdaptor._hits(), MatchingOutput._hits, DTBtiChip._hits, ntuple._Collection._tree, python.cmstools.EventTree._tree, ntuple._Object._tree, ntuple.TrackingNtuple._tree, ntuple.Event._tree, and ntuple.BeamSpot._tree.

207  def invalidHits(self):
208  """Returns generator for invalid hits."""
209  self._checkIsValid()
210  for ihit, hitType in self._hits():
211  if hitType != 3:
212  continue
213  yield InvalidHit(self._tree, ihit)
def ntuple._RecoHitAdaptor.pixelHits (   self)
Returns generator for pixel hits.

Definition at line 182 of file ntuple.py.

References ntuple._Object._checkIsValid(), FP420HitsObject._hits, TrackerHitsObject._hits, SortingOutput._hits, ntuple._RecoHitAdaptor._hits(), MatchingOutput._hits, DTBtiChip._hits, ntuple._Collection._tree, python.cmstools.EventTree._tree, ntuple._Object._tree, ntuple.TrackingNtuple._tree, ntuple.Event._tree, and ntuple.BeamSpot._tree.

183  def pixelHits(self):
184  """Returns generator for pixel hits."""
185  self._checkIsValid()
186  for ihit, hitType in self._hits():
187  if hitType != 0:
188  continue
189  yield PixelHit(self._tree, ihit)
def ntuple._RecoHitAdaptor.stripHits (   self)
Returns generator for strip hits.

Definition at line 190 of file ntuple.py.

References ntuple._Object._checkIsValid(), FP420HitsObject._hits, TrackerHitsObject._hits, SortingOutput._hits, ntuple._RecoHitAdaptor._hits(), MatchingOutput._hits, DTBtiChip._hits, ntuple._Collection._tree, python.cmstools.EventTree._tree, ntuple._Object._tree, ntuple.TrackingNtuple._tree, ntuple.Event._tree, and ntuple.BeamSpot._tree.

191  def stripHits(self):
192  """Returns generator for strip hits."""
193  self._checkIsValid()
194  for ihit, hitType in self._hits():
195  if hitType != 1:
196  continue
197  yield StripHit(self._tree, ihit)