CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ntupleDataFormat.TrackingParticleMatchInfo Class Reference
Inheritance diagram for ntupleDataFormat.TrackingParticleMatchInfo:
ntupleDataFormat._Object

Public Member Functions

def __getattr__ (self, attr)
 
def __init__ (self, tree, index, tpindex, prefix)
 
def trackingParticle (self)
 
- Public Member Functions inherited from ntupleDataFormat._Object
def __getattr__ (self, attr)
 
def __init__ (self, tree, index, prefix)
 
def index (self)
 
def isValid (self)
 

Private Attributes

 _tpindex
 

Detailed Description

Class representing a match to a TrackingParticle.

The point of this class is to provide, in addition to the matched
TrackingParticle, also other information about the match (e.g.
shared hit fraction for tracks/seeds).

Definition at line 576 of file ntupleDataFormat.py.

Constructor & Destructor Documentation

def ntupleDataFormat.TrackingParticleMatchInfo.__init__ (   self,
  tree,
  index,
  tpindex,
  prefix 
)
Constructor.

Arguments:
tree    -- TTree object
index   -- Index of the object (track/seed) matched to TrackingParticle
tpindex -- Index of the TrackingParticle match (second index in _simTrkIdx branch)
prefix  -- String for prefix of the object (track/seed) matched to TrackingParticle

Definition at line 584 of file ntupleDataFormat.py.

584  def __init__(self, tree, index, tpindex, prefix):
585  """Constructor.
586 
587  Arguments:
588  tree -- TTree object
589  index -- Index of the object (track/seed) matched to TrackingParticle
590  tpindex -- Index of the TrackingParticle match (second index in _simTrkIdx branch)
591  prefix -- String for prefix of the object (track/seed) matched to TrackingParticle
592  """
593  super(TrackingParticleMatchInfo, self).__init__(tree, index, prefix)
594  self._tpindex = tpindex
595 
def __init__(self, tree, index, tpindex, prefix)

Member Function Documentation

def ntupleDataFormat.TrackingParticleMatchInfo.__getattr__ (   self,
  attr 
)
Custom __getattr__ because of the second index needed to access the branch.

Note that when mapping the 'attr' to a branch, a 'simTrk' is
prepended and the first letter of 'attr' is turned to upper
case.

Definition at line 596 of file ntupleDataFormat.py.

References ntupleDataFormat.TrackingParticleMatchInfo._tpindex, and pileupCalc.upper.

596  def __getattr__(self, attr):
597  """Custom __getattr__ because of the second index needed to access the branch.
598 
599  Note that when mapping the 'attr' to a branch, a 'simTrk' is
600  prepended and the first letter of 'attr' is turned to upper
601  case.
602  """
603  val = super(TrackingParticleMatchInfo, self).__getattr__("simTrk"+attr[0].upper()+attr[1:])()[self._tpindex]
604  return lambda: val
605 
def ntupleDataFormat.TrackingParticleMatchInfo.trackingParticle (   self)

Member Data Documentation

ntupleDataFormat.TrackingParticleMatchInfo._tpindex
private