CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
ntupleDataFormat._RecoHitAdaptor Class Reference
Inheritance diagram for ntupleDataFormat._RecoHitAdaptor:
ntupleDataFormat.Seed ntupleDataFormat.SimHit ntupleDataFormat.Track

Public Member Functions

def __init__ (self)
 
def gluedHits (self)
 
def hits (self)
 
def invalidHits (self)
 
def phase2OTHits (self)
 
def pixelHits (self)
 
def stripHits (self)
 

Private Member Functions

def _hits (self)
 

Detailed Description

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

Definition at line 204 of file ntupleDataFormat.py.

Constructor & Destructor Documentation

def ntupleDataFormat._RecoHitAdaptor.__init__ (   self)

Definition at line 206 of file ntupleDataFormat.py.

206  def __init__(self):
207  super(_RecoHitAdaptor, self).__init__()
208 

Member Function Documentation

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

Definition at line 209 of file ntupleDataFormat.py.

References ComparisonHelper.zip().

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

209  def _hits(self):
210  """Internal method to generate pairs of hit index and type."""
211  for ihit, hitType in zip(self.hitIdx(), self.hitType()):
212  yield (ihit, hitType)
213 
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def ntupleDataFormat._RecoHitAdaptor.gluedHits (   self)
def ntupleDataFormat._RecoHitAdaptor.hits (   self)
Returns generator for hits.

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

Definition at line 214 of file ntupleDataFormat.py.

References TrackerHitsObject._hits, FP420HitsObject._hits, DTBtiChip._hits, ntupleDataFormat._RecoHitAdaptor._hits(), ntuplePrintersDiff.SeedPrinter._hits, ntuplePrintersDiff.TrackPrinter._hits, ntuplePrintersDiff.TrackingParticlePrinter._hits, ntupleDataFormat._Collection._tree, ntupleDataFormat._Object._tree, python.cmstools.EventTree._tree, ntupleDataFormat.TrackingNtuple._tree, ntupleDataFormat.Event._tree, and ntupleDataFormat.BeamSpot._tree.

214  def hits(self):
215  """Returns generator for hits.
216 
217  Generator returns PixelHit/StripHit/GluedHit/Phase2OT depending on the
218  hit type.
219 
220  """
221  for ihit, hitType in self._hits():
222  if hitType == 0:
223  yield PixelHit(self._tree, ihit)
224  elif hitType == 1:
225  yield StripHit(self._tree, ihit)
226  elif hitType == 2:
227  yield GluedHit(self._tree, ihit)
228  elif hitType == 3:
229  yield InvalidHit(self._tree, ihit)
230  elif hitType == 4:
231  yield Phase2OTHit(self._tree, ihit)
232  else:
233  raise Exception("Unknown hit type %d" % hitType)
234 
def ntupleDataFormat._RecoHitAdaptor.invalidHits (   self)
def ntupleDataFormat._RecoHitAdaptor.phase2OTHits (   self)
def ntupleDataFormat._RecoHitAdaptor.pixelHits (   self)
def ntupleDataFormat._RecoHitAdaptor.stripHits (   self)