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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 744 of file ntuplePrintersDiff.py.

744  def __init__(self, indent=0):
745  super(_RecHitPrinter, self).__init__(indent)
746 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ _printHits()

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

Definition at line 747 of file ntuplePrintersDiff.py.

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

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

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