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

◆ __init__()

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 

Member Function Documentation

◆ _printTrackingParticles()

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

Definition at line 791 of file ntuplePrintersDiff.py.

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 

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

Referenced by ntuplePrintersDiff._TrackingParticleMatchPrinter.printMatchedTrackingParticles().

◆ bestMatchingTrackingParticle()

def ntuplePrintersDiff._TrackingParticleMatchPrinter.bestMatchingTrackingParticle (   self)

Definition at line 788 of file ntuplePrintersDiff.py.

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

References ntuplePrintersDiff._TrackingParticleMatchPrinter._bestMatchingTrackingParticle.

◆ printMatchedTrackingParticles()

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

Definition at line 803 of file ntuplePrintersDiff.py.

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:
813  if self._bestMatchingTrackingParticle:
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 

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:51
util.rrClient.indent
indent
Definition: rrClient.py:41