CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
trackingPlots.TrackingIterationOrder Class Reference

Public Member Functions

def __call__ (self, tdirectory, labels)
 
def __init__ (self)
 

Private Member Functions

def _findOrder (self, f)
 

Private Attributes

 _cache
 

Detailed Description

Definition at line 1732 of file trackingPlots.py.

Constructor & Destructor Documentation

◆ __init__()

def trackingPlots.TrackingIterationOrder.__init__ (   self)

Definition at line 1733 of file trackingPlots.py.

1733  def __init__(self):
1734  self._cache = {}
1735 

Member Function Documentation

◆ __call__()

def trackingPlots.TrackingIterationOrder.__call__ (   self,
  tdirectory,
  labels 
)

Definition at line 1747 of file trackingPlots.py.

1747  def __call__(self, tdirectory, labels):
1748  ret = list(range(0, len(labels)))
1749  f = tdirectory.GetFile()
1750  if not f:
1751  return ret
1752 
1753  if not f.GetName() in self._cache:
1754  r = self._findOrder(f)
1755  if r is None:
1756  return ret
1757  self._cache[f.GetName()] = r
1758  order = self._cache[f.GetName()]
1759 
1760  # O(N^2) I know, but we're talking about O(10) elements...
1761  orderIndices = []
1762  for l in order:
1763  try:
1764  orderIndices.append(labels.index(l))
1765  except ValueError:
1766  pass
1767  ret = []
1768  for i, l in enumerate(labels):
1769  if l in order:
1770  try:
1771  found = orderIndices.index(i)
1772  if found == 0:
1773  ret.append(i)
1774  else:
1775  ret.append(orderIndices[0])
1776  except ValueError:
1777  ret.append(orderIndices[0])
1778  orderIndices.pop(0)
1779  else:
1780  ret.append(i)
1781  return ret
1782 

References DTCache< T, Coll >._cache, tkal_create_file_lists.FileListCreator._cache, L1MuDTTrackFinder._cache, L1MuBMTrackFinder._cache, DTTrig._cache, trackingPlots.TimePerEventPlot._cache, trackingPlots.TrackingIterationOrder._cache, trackingPlots.TrackingIterationOrder._findOrder(), list(), and FastTimerService_cff.range.

◆ _findOrder()

def trackingPlots.TrackingIterationOrder._findOrder (   self,
  f 
)
private

Definition at line 1736 of file trackingPlots.py.

1736  def _findOrder(self, f):
1737  h = f.Get(_trackingIterationOrderHistogram)
1738  if not h:
1739  return None
1740  xaxis = h.GetXaxis()
1741  def _edit(s):
1742  # remove "Tracks" from the track producer name to get the iteration name
1743  # muonSeeded iterations do not have "Step" in the producer name, so add it here
1744  return s.replace("Tracks", "").replace("muonSeeded", "muonSeededStep")
1745  return [_edit(xaxis.GetBinLabel(i)) for i in range(1, h.GetNbinsX()+1)]
1746 

References FastTimerService_cff.range, and python.rootplot.root2matplotlib.replace().

Referenced by trackingPlots.TrackingIterationOrder.__call__().

Member Data Documentation

◆ _cache

trackingPlots.TrackingIterationOrder._cache
private

Definition at line 1734 of file trackingPlots.py.

Referenced by trackingPlots.TrackingIterationOrder.__call__().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444