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

References ntuplePrintersDiff.SeedPrinter.printSeed().

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 
def __call__(self, seed, out=sys.stdout)
def ntuplePrintersDiff.SeedPrinter.diff (   self,
  seed1,
  seed2,
  diffForTwiki = False,
  diffTrackingParticles = False 
)

Definition at line 881 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().

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 
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 835 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().

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 
def ntuplePrintersDiff.SeedPrinter.printHits (   self,
  seed 
)

Definition at line 849 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._hitPatternSummary(), TrackerHitsObject._hits, FP420HitsObject._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().

849  def printHits(self, seed):
850  lst = []
851  if self._hits:
852  lst.append(self._prefix+" hits"+_hitPatternSummary(seed.hits()))
853  self.indent(2)
854  lst.extend(self._printHits(seed.hits()))
855  self.restoreIndent()
856  return lst
857 
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 833 of file ntuplePrintersDiff.py.