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 __init__ (self, indent=0)
 
def indent (self, num)
 
def restoreIndent (self)
 
def setIndentFrom (self, printer, adjust=0)
 

Private Attributes

 _hits
 
 _trackingParticleMatchPrinter
 

Detailed Description

Definition at line 827 of file ntuplePrintersDiff.py.

Constructor & Destructor Documentation

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

Definition at line 828 of file ntuplePrintersDiff.py.

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

Member Function Documentation

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

Definition at line 866 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff.SeedPrinter.printSeed().

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

Definition at line 879 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._formatHitDiffForTwiki(), ntuplePrintersDiff._makediff(), ntuplePrintersDiff._mapdiff(), CommonAnalyzer._prefix, ntupleDataFormat._Object._prefix, html.PageSet._prefix, ntupleDataFormat.BeamSpot._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().

879  def diff(self, seed1, seed2, diffForTwiki=False, diffTrackingParticles=False):
880  if seed1 is None:
881  return _makediff([], self.printSeed(seed2))
882  if seed2 is None:
883  return _makediff(self.printSeed(seed1), [])
884 
885  ret = _DiffResult()
886  ret.extend(_mapdiff(self.printHeader, seed1, seed2))
887  diffHits = _mapdiff(self.printHits, seed1, seed2)
888  ret.extend(diffHits)
889  if diffForTwiki:
890  ret.extend(_formatHitDiffForTwiki(diffHits, self._prefix))
891  if diffTrackingParticles:
892  ret.extend(_mapdiff(self.printMatchedTrackingParticles, seed1, seed2))
893  return ret
894 
def _mapdiff(func, obj1, obj2)
def _makediff(list1, list2, equalPrefix=" ")
def _formatHitDiffForTwiki(diffHits, prefix)
def diff(self, seed1, seed2, diffForTwiki=False, diffTrackingParticles=False)
def printMatchedTrackingParticles(self, seed)
def ntuplePrintersDiff.SeedPrinter.printHeader (   self,
  seed 
)

Definition at line 833 of file ntuplePrintersDiff.py.

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

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

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

Definition at line 847 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._hitPatternSummary(), FP420HitsObject._hits, TrackerHitsObject._hits, DTBtiChip._hits, ntuplePrintersDiff.SeedPrinter._hits, CommonAnalyzer._prefix, ntupleDataFormat._Object._prefix, html.PageSet._prefix, ntupleDataFormat.BeamSpot._prefix, ntuplePrintersDiff._IndentPrinter._prefix, ntuplePrintersDiff._RecHitPrinter._printHits(), Mixins.PrintOptions.indent(), FWLayoutBuilder.indent(), edm::DocFormatHelper.indent(), Json::StyledWriter.indent(), FWDialogBuilder.indent(), edm::service::ELdestination.indent, Json::StyledStreamWriter.indent(), JsonOutputProducer.indent(), ntuplePrintersDiff._IndentPrinter.indent(), and ntuplePrintersDiff._IndentPrinter.restoreIndent().

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

847  def printHits(self, seed):
848  lst = []
849  if self._hits:
850  lst.append(self._prefix+" hits"+_hitPatternSummary(seed.hits()))
851  self.indent(2)
852  lst.extend(self._printHits(seed.hits()))
853  self.restoreIndent()
854  return lst
855 
def ntuplePrintersDiff.SeedPrinter.printMatchedTrackingParticles (   self,
  seed 
)
def ntuplePrintersDiff.SeedPrinter.printSeed (   self,
  seed 
)

Member Data Documentation

ntuplePrintersDiff.SeedPrinter._hits
private
ntuplePrintersDiff.SeedPrinter._trackingParticleMatchPrinter
private

Definition at line 831 of file ntuplePrintersDiff.py.