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

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

Member Function Documentation

◆ __call__()

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

Definition at line 868 of file ntuplePrintersDiff.py.

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

References ntuplePrintersDiff.SeedPrinter.printSeed().

◆ diff()

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

Definition at line 881 of file ntuplePrintersDiff.py.

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

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(), TkAccumulatingSensitiveDetector.printHits, HGCalEgammaIDHelper.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 835 of file ntuplePrintersDiff.py.

835  def printHeader(self, seed):
836  lst = []
837  track = seed.track()
838  if track.isValid():
839  madeTrack = "made track %d" % track.index()
840  else:
841  madeTrack = "did not make a track, stopReason %s" % SeedStopReason.toString(seed.stopReason())
842  if seed.stopReason() == SeedStopReason.NOT_STOPPED:
843  madeTrack += " (usually this means that the track was reconstructed, but rejected by the track selection)"
844 
845  lst.append(self._prefix+"Seed %d algo %s %s" % (seed.indexWithinAlgo(), Algo.toString(seed.algo()), madeTrack))
846  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()))
847  return lst
848 

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:174
ntuplePrintersDiff._makediff
def _makediff(list1, list2, equalPrefix=" ")
Definition: ntuplePrintersDiff.py:167
ntuplePrintersDiff._formatHitDiffForTwiki
def _formatHitDiffForTwiki(diffHits, prefix)
Definition: ntuplePrintersDiff.py:620
ntuplePrintersDiff._hitPatternSummary
def _hitPatternSummary(hits)
Definition: ntuplePrintersDiff.py:703