CMS 3D CMS Logo

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__ (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 153 of file ntuple.py.

Constructor & Destructor Documentation

def ntuple._RecoHitAdaptor.__init__ (   self)

Definition at line 155 of file ntuple.py.

155  def __init__(self):
156  super(_RecoHitAdaptor, self).__init__()
157 
def __init__(self)
Definition: ntuple.py:155

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.phase2OTHits(), ntuple._RecoHitAdaptor.pixelHits(), and ntuple._RecoHitAdaptor.stripHits().

158  def _hits(self):
159  """Internal method to generate pairs of hit index and type."""
160  for ihit, hitType in zip(self.hitIdx(), self.hitType()):
161  yield (ihit, hitType)
162 
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 200 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.

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

Generator returns PixelHit/StripHit/GluedHit/Phase2OT 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.

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

Definition at line 208 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.

208  def invalidHits(self):
209  """Returns generator for invalid hits."""
210  self._checkIsValid()
211  for ihit, hitType in self._hits():
212  if hitType != 3:
213  continue
214  yield InvalidHit(self._tree, ihit)
215 
def invalidHits(self)
Definition: ntuple.py:208
def ntuple._RecoHitAdaptor.phase2OTHits (   self)
Returns generator for phase2 outer tracker hits.

Definition at line 216 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.

216  def phase2OTHits(self):
217  """Returns generator for phase2 outer tracker hits."""
218  self._checkIsValid()
219  for ihit, hitType in self._hits():
220  if hitType != 4:
221  continue
222  yield Phase2OTHit(self._tree, ihit)
223 
def phase2OTHits(self)
Definition: ntuple.py:216
def ntuple._RecoHitAdaptor.pixelHits (   self)
Returns generator for pixel hits.

Definition at line 184 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.

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

Definition at line 192 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.

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