CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ntuplePrintersDiff._TrackingParticleMatchPrinter Class Reference
Inheritance diagram for ntuplePrintersDiff._TrackingParticleMatchPrinter:

Public Member Functions

def __init__ (self, trackingParticles, trackingParticlePrinter, bestMatchingTrackingParticle)
 
def bestMatchingTrackingParticle (self)
 
def printMatchedTrackingParticles (self, prefix, track)
 

Private Member Functions

def _printTrackingParticles (self, prefix, tps, header)
 

Private Attributes

 _bestMatchingTrackingParticle
 
 _trackingParticlePrinter
 
 _trackingParticles
 

Detailed Description

Definition at line 782 of file ntuplePrintersDiff.py.

Constructor & Destructor Documentation

def ntuplePrintersDiff._TrackingParticleMatchPrinter.__init__ (   self,
  trackingParticles,
  trackingParticlePrinter,
  bestMatchingTrackingParticle 
)

Definition at line 783 of file ntuplePrintersDiff.py.

783  def __init__(self, trackingParticles, trackingParticlePrinter, bestMatchingTrackingParticle):
784  self._trackingParticles = trackingParticles
785  self._trackingParticlePrinter = trackingParticlePrinter
786  self._bestMatchingTrackingParticle = bestMatchingTrackingParticle
787 
def __init__(self, trackingParticles, trackingParticlePrinter, bestMatchingTrackingParticle)

Member Function Documentation

def ntuplePrintersDiff._TrackingParticleMatchPrinter._printTrackingParticles (   self,
  prefix,
  tps,
  header 
)
private

Definition at line 791 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackingParticleMatchPrinter._trackingParticlePrinter, join(), and str.

Referenced by ntuplePrintersDiff._TrackingParticleMatchPrinter.printMatchedTrackingParticles().

791  def _printTrackingParticles(self, prefix, tps, header):
792  lst = []
793  if self._trackingParticlePrinter is None:
794  lst.append(prefix+header+" "+",".join([str(tp.index()) for tp in tps]))
795  else:
796  lst.append(prefix+header)
797  for tp in tps:
798  lst.extend(self._trackingParticlePrinter.printTrackingParticle(tp))
799  lst.extend(self._trackingParticlePrinter.printHits(tp))
800  lst.extend(self._trackingParticlePrinter.printMatchedTracks(tp, useTrackPrinter=False))
801  return lst
802 
def _printTrackingParticles(self, prefix, tps, header)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
#define str(s)
def ntuplePrintersDiff._TrackingParticleMatchPrinter.bestMatchingTrackingParticle (   self)
def ntuplePrintersDiff._TrackingParticleMatchPrinter.printMatchedTrackingParticles (   self,
  prefix,
  track 
)

Definition at line 803 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackingParticleMatchPrinter._bestMatchingTrackingParticle, ntuplePrintersDiff._TrackingParticleMatchPrinter._printTrackingParticles(), ntuplePrintersDiff._TrackingParticleMatchPrinter._trackingParticlePrinter, and ntuplePrintersDiff._TrackingParticleMatchPrinter._trackingParticles.

Referenced by ntuplePrintersDiff.SeedPrinter.diff(), ntuplePrintersDiff.TrackPrinter.diff(), ntuplePrintersDiff.SeedPrinter.printSeed(), and ntuplePrintersDiff.TrackPrinter.printTrackAndMatchedTrackingParticles().

803  def printMatchedTrackingParticles(self, prefix, track):
804  lst = []
805  if not self._trackingParticles:
806  return lst
807 
808  pfx = prefix+" "
809  if self._trackingParticlePrinter is not None:
810  self._trackingParticlePrinter.indent(len(pfx)+1)
811 
812  if track.nMatchedTrackingParticles() == 0:
814  bestTP = track.bestMatchingTrackingParticle()
815  if bestTP is not None:
816  lst.extend(self._printTrackingParticles(pfx, [bestTP], "not matched to any TP, but a following TP with >= 3 matched hits is found (shared hit fraction %.2f)" % track.bestMatchingTrackingParticleShareFrac()))
817  else:
818  lst.append(prefix+"not matched to any TP")
819  else:
820  lst.append(prefix+"not matched to any TP")
821  else:
822  lst.extend(self._printTrackingParticles(pfx, [tpInfo.trackingParticle() for tpInfo in track.matchedTrackingParticleInfos()], "matched to TPs"))
823 
824  if self._trackingParticlePrinter is not None:
825  self._trackingParticlePrinter.restoreIndent()
826 
827  return lst
828 
def _printTrackingParticles(self, prefix, tps, header)

Member Data Documentation

ntuplePrintersDiff._TrackingParticleMatchPrinter._bestMatchingTrackingParticle
private
ntuplePrintersDiff._TrackingParticleMatchPrinter._trackingParticlePrinter
private
ntuplePrintersDiff._TrackingParticleMatchPrinter._trackingParticles
private