CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ntuplePrintersDiff._TrackAssociation Class Reference
Inheritance diagram for ntuplePrintersDiff._TrackAssociation:

Public Member Functions

def __init__ (self)
 
def __str__ (self)
 
def extend (self, trks1=[], trks2=[], trks1OutsideList=[], trks2OutsideList=[])
 
def extendTrks1 (self, trks)
 
def extendTrks1OutsideList (self, trks)
 
def extendTrks2 (self, trks)
 
def extendTrks2OutsideList (self, trks)
 
def hasCommonTrackingParticle (self)
 
def merge (self, other)
 
def minEta (self)
 
def trks1 (self)
 
def trks1OutsideList (self)
 
def trks2 (self)
 
def trks2OutsideList (self)
 

Private Member Functions

def _extend (self, trks, name)
 

Private Attributes

 _trks1
 
 _trks1Ind
 
 _trks1OutsideList
 
 _trks1OutsideListInd
 
 _trks2
 
 _trks2Ind
 
 _trks2OutsideList
 
 _trks2OutsideListInd
 

Detailed Description

Definition at line 284 of file ntuplePrintersDiff.py.

Constructor & Destructor Documentation

def ntuplePrintersDiff._TrackAssociation.__init__ (   self)

Member Function Documentation

def ntuplePrintersDiff._TrackAssociation.__str__ (   self)
def ntuplePrintersDiff._TrackAssociation._extend (   self,
  trks,
  name 
)
private

Definition at line 297 of file ntuplePrintersDiff.py.

Referenced by ntuplePrintersDiff._TrackAssociation.extendTrks1(), ntuplePrintersDiff._TrackAssociation.extendTrks1OutsideList(), ntuplePrintersDiff._TrackAssociation.extendTrks2(), and ntuplePrintersDiff._TrackAssociation.extendTrks2OutsideList().

297  def _extend(self, trks, name):
298  lst = getattr(self, name)
299  ind = getattr(self, name+"Ind")
300  for t in trks:
301  if not t.index() in ind:
302  lst.append(t)
303  ind.add(t.index())
304 
def ntuplePrintersDiff._TrackAssociation.extend (   self,
  trks1 = [],
  trks2 = [],
  trks1OutsideList = [],
  trks2OutsideList = [] 
)

Definition at line 305 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation.extendTrks1(), ntuplePrintersDiff._TrackAssociation.extendTrks1OutsideList(), ntuplePrintersDiff._TrackAssociation.extendTrks2(), and ntuplePrintersDiff._TrackAssociation.extendTrks2OutsideList().

Referenced by MatrixUtil.WF.__init__().

305  def extend(self, trks1=[], trks2=[], trks1OutsideList=[], trks2OutsideList=[]):
306  self.extendTrks1(trks1)
307  self.extendTrks2(trks2)
308  self.extendTrks1OutsideList(trks1OutsideList)
309  self.extendTrks2OutsideList(trks2OutsideList)
310 
def extend(self, trks1=[], trks2=[], trks1OutsideList=[], trks2OutsideList=[])
def ntuplePrintersDiff._TrackAssociation.extendTrks1 (   self,
  trks 
)
def ntuplePrintersDiff._TrackAssociation.extendTrks1OutsideList (   self,
  trks 
)
def ntuplePrintersDiff._TrackAssociation.extendTrks2 (   self,
  trks 
)
def ntuplePrintersDiff._TrackAssociation.extendTrks2OutsideList (   self,
  trks 
)
def ntuplePrintersDiff._TrackAssociation.hasCommonTrackingParticle (   self)

Definition at line 328 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._trks1, ntuplePrintersDiff._TrackAssociation._trks2, diffTreeTool.index, and GetRecoTauVFromDQM_MC_cff.next.

329  trkGen = itertools.chain(self._trks1, self._trks2)
330  try:
331  first = next(trkGen)
332  except StopIteration:
333  return False
334  if first.nMatchedTrackingParticles() != 1:
335  return False
336 
337  tpIndex = next(first.matchedTrackingParticleInfos()).trackingParticle().index()
338 
339  for t in trkGen:
340  if t.nMatchedTrackingParticles() != 1:
341  return False
342  if next(t.matchedTrackingParticleInfos()).trackingParticle().index() != tpIndex:
343  return False
344  return True
345 
346 
def ntuplePrintersDiff._TrackAssociation.merge (   self,
  other 
)
def ntuplePrintersDiff._TrackAssociation.minEta (   self)

Definition at line 353 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._trks1, ntuplePrintersDiff._TrackAssociation._trks1OutsideList, ntuplePrintersDiff._TrackAssociation._trks2, ntuplePrintersDiff._TrackAssociation._trks2OutsideList, and min().

353  def minEta(self):
354  _min = lambda lst: min([t.eta() for t in lst])
355 
356  if len(self._trks1) > 0:
357  return _min(self._trks1)
358  if len(self._trks1OutsideList) > 0:
359  return _min(self._trks1OutsideList)
360  if len(self._trks2) > 0:
361  return _min(self._trks2)
362  if len(self._trks2_outsideList) > 0:
363  return _min(self._trks2OutsideList)
364  raise Exception("This _TrackAssociation is empty, minEta() makes no sense")
365 
T min(T a, T b)
Definition: MathUtil.h:58
def ntuplePrintersDiff._TrackAssociation.trks1 (   self)

Definition at line 323 of file ntuplePrintersDiff.py.

323  def trks1(self): return self._trks1
def ntuplePrintersDiff._TrackAssociation.trks1OutsideList (   self)

Definition at line 325 of file ntuplePrintersDiff.py.

325  def trks1OutsideList(self): return self._trks1OutsideList
def ntuplePrintersDiff._TrackAssociation.trks2 (   self)

Definition at line 324 of file ntuplePrintersDiff.py.

324  def trks2(self): return self._trks2
def ntuplePrintersDiff._TrackAssociation.trks2OutsideList (   self)

Definition at line 326 of file ntuplePrintersDiff.py.

326  def trks2OutsideList(self): return self._trks2OutsideList
327 

Member Data Documentation

ntuplePrintersDiff._TrackAssociation._trks1
private
ntuplePrintersDiff._TrackAssociation._trks1Ind
private

Definition at line 292 of file ntuplePrintersDiff.py.

ntuplePrintersDiff._TrackAssociation._trks1OutsideList
private
ntuplePrintersDiff._TrackAssociation._trks1OutsideListInd
private

Definition at line 294 of file ntuplePrintersDiff.py.

ntuplePrintersDiff._TrackAssociation._trks2
private
ntuplePrintersDiff._TrackAssociation._trks2Ind
private

Definition at line 293 of file ntuplePrintersDiff.py.

ntuplePrintersDiff._TrackAssociation._trks2OutsideList
private
ntuplePrintersDiff._TrackAssociation._trks2OutsideListInd
private

Definition at line 295 of file ntuplePrintersDiff.py.