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

Constructor & Destructor Documentation

◆ __init__()

def ntuplePrintersDiff._TrackAssociation.__init__ (   self)

Definition at line 286 of file ntuplePrintersDiff.py.

286  def __init__(self):
287  super(_TrackAssociation, self).__init__()
288  self._trks1 = []
289  self._trks2 = []
290  self._trks1OutsideList = []
291  self._trks2OutsideList = []
292 
293  self._trks1Ind = set()
294  self._trks2Ind = set()
295  self._trks1OutsideListInd = set()
296  self._trks2OutsideListInd = set()
297 
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

◆ __str__()

def ntuplePrintersDiff._TrackAssociation.__str__ (   self)

Definition at line 367 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._trks1, ntuplePrintersDiff._TrackAssociation._trks1OutsideList, ntuplePrintersDiff._TrackAssociation._trks2, ntuplePrintersDiff._TrackAssociation._trks2OutsideList, alignCSCRings.s, and str.

367  def __str__(self):
368  s = lambda l: str([t.index() for t in l])
369  return s(self._trks1)+" "+s(self._trks2)+" "+s(self._trks1OutsideList)+" "+s(self._trks2OutsideList)
370 
#define str(s)

◆ _extend()

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

Definition at line 298 of file ntuplePrintersDiff.py.

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

298  def _extend(self, trks, name):
299  lst = getattr(self, name)
300  ind = getattr(self, name+"Ind")
301  for t in trks:
302  if not t.index() in ind:
303  lst.append(t)
304  ind.add(t.index())
305 

◆ extend()

def ntuplePrintersDiff._TrackAssociation.extend (   self,
  trks1 = [],
  trks2 = [],
  trks1OutsideList = [],
  trks2OutsideList = [] 
)

Definition at line 306 of file ntuplePrintersDiff.py.

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

Referenced by MatrixUtil.WF.__init__().

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

◆ extendTrks1()

def ntuplePrintersDiff._TrackAssociation.extendTrks1 (   self,
  trks 
)

Definition at line 312 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._extend().

Referenced by ntuplePrintersDiff._TrackAssociation.extend(), and ntuplePrintersDiff._TrackAssociation.merge().

312  def extendTrks1(self, trks):
313  self._extend(trks, "_trks1")
314 

◆ extendTrks1OutsideList()

def ntuplePrintersDiff._TrackAssociation.extendTrks1OutsideList (   self,
  trks 
)

Definition at line 318 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._extend().

Referenced by ntuplePrintersDiff._TrackAssociation.extend(), and ntuplePrintersDiff._TrackAssociation.merge().

318  def extendTrks1OutsideList(self, trks):
319  self._extend(trks, "_trks1OutsideList")
320 

◆ extendTrks2()

def ntuplePrintersDiff._TrackAssociation.extendTrks2 (   self,
  trks 
)

Definition at line 315 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._extend().

Referenced by ntuplePrintersDiff._TrackAssociation.extend(), and ntuplePrintersDiff._TrackAssociation.merge().

315  def extendTrks2(self, trks):
316  self._extend(trks, "_trks2")
317 

◆ extendTrks2OutsideList()

def ntuplePrintersDiff._TrackAssociation.extendTrks2OutsideList (   self,
  trks 
)

Definition at line 321 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._extend().

Referenced by ntuplePrintersDiff._TrackAssociation.extend(), and ntuplePrintersDiff._TrackAssociation.merge().

321  def extendTrks2OutsideList(self, trks):
322  self._extend(trks, "_trks2OutsideList")
323 

◆ hasCommonTrackingParticle()

def ntuplePrintersDiff._TrackAssociation.hasCommonTrackingParticle (   self)

Definition at line 329 of file ntuplePrintersDiff.py.

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

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

◆ merge()

def ntuplePrintersDiff._TrackAssociation.merge (   self,
  other 
)

Definition at line 348 of file ntuplePrintersDiff.py.

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

348  def merge(self, other):
349  self.extendTrks1(other._trks1)
350  self.extendTrks2(other._trks2)
351  self.extendTrks1OutsideList(other._trks1OutsideList)
352  self.extendTrks2OutsideList(other._trks2OutsideList)
353 
def merge(dictlist, TELL=False)
Definition: MatrixUtil.py:205

◆ minEta()

def ntuplePrintersDiff._TrackAssociation.minEta (   self)

Definition at line 354 of file ntuplePrintersDiff.py.

References ntuplePrintersDiff._TrackAssociation._trks1, ntuplePrintersDiff._TrackAssociation._trks1OutsideList, ntuplePrintersDiff._TrackAssociation._trks2, ntuplePrintersDiff._TrackAssociation._trks2OutsideList, and SiStripPI.min.

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

◆ trks1()

def ntuplePrintersDiff._TrackAssociation.trks1 (   self)

Definition at line 324 of file ntuplePrintersDiff.py.

324  def trks1(self): return self._trks1

◆ trks1OutsideList()

def ntuplePrintersDiff._TrackAssociation.trks1OutsideList (   self)

Definition at line 326 of file ntuplePrintersDiff.py.

326  def trks1OutsideList(self): return self._trks1OutsideList

◆ trks2()

def ntuplePrintersDiff._TrackAssociation.trks2 (   self)

Definition at line 325 of file ntuplePrintersDiff.py.

325  def trks2(self): return self._trks2

◆ trks2OutsideList()

def ntuplePrintersDiff._TrackAssociation.trks2OutsideList (   self)

Definition at line 327 of file ntuplePrintersDiff.py.

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

Member Data Documentation

◆ _trks1

ntuplePrintersDiff._TrackAssociation._trks1
private

◆ _trks1Ind

ntuplePrintersDiff._TrackAssociation._trks1Ind
private

Definition at line 293 of file ntuplePrintersDiff.py.

◆ _trks1OutsideList

ntuplePrintersDiff._TrackAssociation._trks1OutsideList
private

◆ _trks1OutsideListInd

ntuplePrintersDiff._TrackAssociation._trks1OutsideListInd
private

Definition at line 295 of file ntuplePrintersDiff.py.

◆ _trks2

ntuplePrintersDiff._TrackAssociation._trks2
private

◆ _trks2Ind

ntuplePrintersDiff._TrackAssociation._trks2Ind
private

Definition at line 294 of file ntuplePrintersDiff.py.

◆ _trks2OutsideList

ntuplePrintersDiff._TrackAssociation._trks2OutsideList
private

◆ _trks2OutsideListInd

ntuplePrintersDiff._TrackAssociation._trks2OutsideListInd
private

Definition at line 296 of file ntuplePrintersDiff.py.