CMS 3D CMS Logo

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

Public Member Functions

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 Member Functions

def _printHits (self, hits)
 

Detailed Description

Definition at line 742 of file ntuplePrintersDiff.py.

Constructor & Destructor Documentation

def ntuplePrintersDiff._RecHitPrinter.__init__ (   self,
  indent = 0 
)

Definition at line 743 of file ntuplePrintersDiff.py.

743  def __init__(self, indent=0):
744  super(_RecHitPrinter, self).__init__(indent)
745 

Member Function Documentation

def ntuplePrintersDiff._RecHitPrinter._printHits (   self,
  hits 
)
private

Definition at line 746 of file ntuplePrintersDiff.py.

References CommonAnalyzer._prefix, ntupleDataFormat._Object._prefix, html.PageSet._prefix, ntupleDataFormat.BeamSpot._prefix, ntuplePrintersDiff._IndentPrinter._prefix, join(), hit.x, hit.y, and hit.z.

Referenced by ntuplePrintersDiff.SeedPrinter.printHits(), and ntuplePrintersDiff.TrackPrinter.printHits().

746  def _printHits(self, hits):
747  lst = []
748  for hit in hits:
749  matched = ""
750  glued = ""
751  coord = ""
752  if hit.isValidHit():
753  if hasattr(hit, "matchedSimHitInfos"):
754  matched = " from %s " % HitSimType.toString(hit.simType())
755  matches = []
756  hasChargeFraction = False
757  for shInfo in hit.matchedSimHitInfos():
758  m = "%d:%d" % (shInfo.simHit().trackingParticle().index(), shInfo.simHit().index())
759  if hasattr(shInfo, "chargeFraction"):
760  m += "(%.1f)"%(shInfo.chargeFraction()*100)
761  hasChargeFraction = True
762  matches.append(m)
763  if len(matches) == 0:
764  matched += "not matched to any TP/SimHit"
765  else:
766  matched += "matched to TP:SimHit"
767  if hasChargeFraction:
768  matched += "(%)"
769  matched += " "+",".join(matches)
770 
771  coord = "x,y,z %f,%f,%f" % (hit.x(), hit.y(), hit.z())
772  if isinstance(hit, GluedHit):
773  glued = "monoHit %d stereoHit %d " % (hit.monoHit().index(), hit.stereoHit().index())
774 
775  lst.append(self._prefix+"{layer} {hit} detid {detid} {detidStr} {glued}{coord}{matched}".format(layer=hit.layerStr(), hit=hit.index(),
776  detid=hit.detId(), detidStr=hit.detIdStr(),
777  glued=glued, coord=coord, matched=matched))
778  return lst
779 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18