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

Constructor & Destructor Documentation

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

Definition at line 745 of file ntuplePrintersDiff.py.

745  def __init__(self, indent=0):
746  super(_RecHitPrinter, self).__init__(indent)
747 

Member Function Documentation

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

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

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