CMS 3D CMS Logo

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

Public Member Functions

def __call__ (self, seed, out=sys.stdout)
 
def __init__ (self, indent=0, hits=True, trackingParticles=False, trackingParticlePrinter=None, bestMatchingTrackingParticle=True)
 
def diff (self, seed1, seed2, diffForTwiki=False, diffTrackingParticles=False)
 
def printHeader (self, seed)
 
def printHits (self, seed)
 
def printMatchedTrackingParticles (self, seed)
 
def printSeed (self, seed)
 
- Public Member Functions inherited from ntuplePrintersDiff._RecHitPrinter
def __init__ (self, indent=0)
 
- Public Member Functions inherited from ntuplePrintersDiff._IndentPrinter
def indent (self, num)
 
def restoreIndent (self)
 
def setIndentFrom (self, printer, adjust=0)
 

Private Attributes

 _hits
 
 _trackingParticleMatchPrinter
 

Detailed Description

Definition at line 828 of file ntuplePrintersDiff.py.

Constructor & Destructor Documentation

◆ __init__()

def ntuplePrintersDiff.SeedPrinter.__init__ (   self,
  indent = 0,
  hits = True,
  trackingParticles = False,
  trackingParticlePrinter = None,
  bestMatchingTrackingParticle = True 
)

Definition at line 829 of file ntuplePrintersDiff.py.

829  def __init__(self, indent=0, hits=True, trackingParticles=False, trackingParticlePrinter=None, bestMatchingTrackingParticle=True):
830  super(SeedPrinter, self).__init__(indent)
831  self._hits = hits
832  self._trackingParticleMatchPrinter = _TrackingParticleMatchPrinter(trackingParticles, trackingParticlePrinter, bestMatchingTrackingParticle)
833 

Member Function Documentation

◆ __call__()

def ntuplePrintersDiff.SeedPrinter.__call__ (   self,
  seed,
  out = sys.stdout 
)

Definition at line 867 of file ntuplePrintersDiff.py.

867  def __call__(self, seed, out=sys.stdout):
868  if isinstance(out, list):
869  lst = out
870  else:
871  lst = []
872 
873  lst.extend(self.printSeed(seed))
874 
875  if not isinstance(out, list):
876  for line in lst:
877  out.write(line),
878  out.write("\n")
879 

References ntuplePrintersDiff.SeedPrinter.printSeed().

◆ diff()

def ntuplePrintersDiff.SeedPrinter.diff (   self,
  seed1,
  seed2,
  diffForTwiki = False,
  diffTrackingParticles = False 
)

Definition at line 880 of file ntuplePrintersDiff.py.

880  def diff(self, seed1, seed2, diffForTwiki=False, diffTrackingParticles=False):
881  if seed1 is None:
882  return _makediff([], self.printSeed(seed2))
883  if seed2 is None:
884  return _makediff(self.printSeed(seed1), [])
885 
886  ret = _DiffResult()
887  ret.extend(_mapdiff(self.printHeader, seed1, seed2))
888  diffHits = _mapdiff(self.printHits, seed1, seed2)
889  ret.extend(diffHits)
890  if diffForTwiki:
891  ret.extend(_formatHitDiffForTwiki(diffHits, self._prefix))
892  if diffTrackingParticles:
893  ret.extend(_mapdiff(self.printMatchedTrackingParticles, seed1, seed2))
894  return ret
895 

References ntuplePrintersDiff._formatHitDiffForTwiki(), ntuplePrintersDiff._makediff(), ntuplePrintersDiff._mapdiff(), CommonAnalyzer._prefix, ntupleDataFormat._Object._prefix, ntupleDataFormat.BeamSpot._prefix, html.PageSet._prefix, ntuplePrintersDiff._IndentPrinter._prefix, L1GctLut< NAddressBits, NDataBits >.printHeader(), EcalSelectiveReadout.printHeader(), FastTimerService.printHeader(), ntuplePrintersDiff.SeedPrinter.printHeader(), HGCalEgammaIDHelper.printHits(), TkAccumulatingSensitiveDetector.printHits, hgcal::EGammaPCAHelper.printHits(), MuonSensitiveDetector.printHits, GlobalTrajectoryBuilderBase.printHits(), GlobalMuonRefitter.printHits(), ntuplePrintersDiff.SeedPrinter.printHits(), ntuplePrintersDiff._TrackingParticleMatchPrinter.printMatchedTrackingParticles(), ntuplePrintersDiff.SeedPrinter.printMatchedTrackingParticles(), and ntuplePrintersDiff.SeedPrinter.printSeed().

◆ printHeader()

def ntuplePrintersDiff.SeedPrinter.printHeader (   self,
  seed 
)

Definition at line 834 of file ntuplePrintersDiff.py.

834  def printHeader(self, seed):
835  lst = []
836  track = seed.track()
837  if track.isValid():
838  madeTrack = "made track %d" % track.index()
839  else:
840  madeTrack = "did not make a track, stopReason %s" % SeedStopReason.toString(seed.stopReason())
841  if seed.stopReason() == SeedStopReason.NOT_STOPPED:
842  madeTrack += " (usually this means that the track was reconstructed, but rejected by the track selection)"
843 
844  lst.append(self._prefix+"Seed %d algo %s %s" % (seed.indexWithinAlgo(), Algo.toString(seed.algo()), madeTrack))
845  lst.append(self._prefix+" starting state: pT %f local pos x,y %f,%f mom x,y,z %f,%f,%f" % (seed.statePt(), seed.stateTrajX(), seed.stateTrajY(), seed.stateTrajPx(), seed.stateTrajPy(), seed.stateTrajPz()))
846  return lst
847 

References CommonAnalyzer._prefix, ntupleDataFormat._Object._prefix, ntupleDataFormat.BeamSpot._prefix, html.PageSet._prefix, and ntuplePrintersDiff._IndentPrinter._prefix.

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

◆ printHits()

def ntuplePrintersDiff.SeedPrinter.printHits (   self,
  seed 
)

◆ printMatchedTrackingParticles()

def ntuplePrintersDiff.SeedPrinter.printMatchedTrackingParticles (   self,
  seed 
)

◆ printSeed()

def ntuplePrintersDiff.SeedPrinter.printSeed (   self,
  seed 
)

Member Data Documentation

◆ _hits

ntuplePrintersDiff.SeedPrinter._hits
private

◆ _trackingParticleMatchPrinter

ntuplePrintersDiff.SeedPrinter._trackingParticleMatchPrinter
private
change_name.diff
diff
Definition: change_name.py:13
ntuplePrintersDiff._mapdiff
def _mapdiff(func, obj1, obj2)
Definition: ntuplePrintersDiff.py:173
ntuplePrintersDiff._makediff
def _makediff(list1, list2, equalPrefix=" ")
Definition: ntuplePrintersDiff.py:166
ntuplePrintersDiff._formatHitDiffForTwiki
def _formatHitDiffForTwiki(diffHits, prefix)
Definition: ntuplePrintersDiff.py:619
ntuplePrintersDiff._hitPatternSummary
def _hitPatternSummary(hits)
Definition: ntuplePrintersDiff.py:702