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 781 of file ntuplePrintersDiff.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 782 of file ntuplePrintersDiff.py.

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

Member Function Documentation

◆ _printTrackingParticles()

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

Definition at line 790 of file ntuplePrintersDiff.py.

790  def _printTrackingParticles(self, prefix, tps, header):
791  lst = []
792  if self._trackingParticlePrinter is None:
793  lst.append(prefix+header+" "+",".join([str(tp.index()) for tp in tps]))
794  else:
795  lst.append(prefix+header)
796  for tp in tps:
797  lst.extend(self._trackingParticlePrinter.printTrackingParticle(tp))
798  lst.extend(self._trackingParticlePrinter.printHits(tp))
799  lst.extend(self._trackingParticlePrinter.printMatchedTracks(tp, useTrackPrinter=False))
800  return lst
801 

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

Referenced by ntuplePrintersDiff._TrackingParticleMatchPrinter.printMatchedTrackingParticles().

◆ bestMatchingTrackingParticle()

def ntuplePrintersDiff._TrackingParticleMatchPrinter.bestMatchingTrackingParticle (   self)

Definition at line 787 of file ntuplePrintersDiff.py.

787  def bestMatchingTrackingParticle(self):
788  return self._bestMatchingTrackingParticle
789 

References ntuplePrintersDiff._TrackingParticleMatchPrinter._bestMatchingTrackingParticle.

◆ printMatchedTrackingParticles()

def ntuplePrintersDiff._TrackingParticleMatchPrinter.printMatchedTrackingParticles (   self,
  prefix,
  track 
)

Definition at line 802 of file ntuplePrintersDiff.py.

802  def printMatchedTrackingParticles(self, prefix, track):
803  lst = []
804  if not self._trackingParticles:
805  return lst
806 
807  pfx = prefix+" "
808  if self._trackingParticlePrinter is not None:
809  self._trackingParticlePrinter.indent(len(pfx)+1)
810 
811  if track.nMatchedTrackingParticles() == 0:
812  if self._bestMatchingTrackingParticle:
813  bestTP = track.bestMatchingTrackingParticle()
814  if bestTP is not None:
815  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()))
816  else:
817  lst.append(prefix+"not matched to any TP")
818  else:
819  lst.append(prefix+"not matched to any TP")
820  else:
821  lst.extend(self._printTrackingParticles(pfx, [tpInfo.trackingParticle() for tpInfo in track.matchedTrackingParticleInfos()], "matched to TPs"))
822 
823  if self._trackingParticlePrinter is not None:
824  self._trackingParticlePrinter.restoreIndent()
825 
826  return lst
827 

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

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

Member Data Documentation

◆ _bestMatchingTrackingParticle

ntuplePrintersDiff._TrackingParticleMatchPrinter._bestMatchingTrackingParticle
private

◆ _trackingParticlePrinter

ntuplePrintersDiff._TrackingParticleMatchPrinter._trackingParticlePrinter
private

◆ _trackingParticles

ntuplePrintersDiff._TrackingParticleMatchPrinter._trackingParticles
private
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
str
#define str(s)
Definition: TestProcessor.cc:53
util.rrClient.indent
indent
Definition: rrClient.py:41