CMS 3D CMS Logo

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

Public Member Functions

def __getattr__ (self, attr)
 
def __init__ (self, tree, index, trkindex, prefix)
 
def track (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

 _trkindex
 

Detailed Description

Class representing a match to a Track.

The point of this class is to provide, in addition to the matched
Track, also other information about the match (e.g. shared hit fraction.

Definition at line 610 of file ntupleDataFormat.py.

Constructor & Destructor Documentation

def ntupleDataFormat.TrackMatchInfo.__init__ (   self,
  tree,
  index,
  trkindex,
  prefix 
)
Constructor.

Arguments:
tree     -- TTree object
index    -- Index of the object (TrackingParticle) matched to track
trkindex -- Index of the track match (second index in _trkIdx branch)
prefix   -- String for prefix of the object (TrackingParticle) matched to track

Definition at line 616 of file ntupleDataFormat.py.

616  def __init__(self, tree, index, trkindex, prefix):
617  """Constructor.
618 
619  Arguments:
620  tree -- TTree object
621  index -- Index of the object (TrackingParticle) matched to track
622  trkindex -- Index of the track match (second index in _trkIdx branch)
623  prefix -- String for prefix of the object (TrackingParticle) matched to track
624  """
625  super(TrackMatchInfo, self).__init__(tree, index, prefix)
626  self._trkindex = trkindex
627 
def __init__(self, tree, index, trkindex, prefix)

Member Function Documentation

def ntupleDataFormat.TrackMatchInfo.__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 'trk' is
prepended and the first letter of 'attr' is turned to upper
case.

Definition at line 628 of file ntupleDataFormat.py.

References ntupleDataFormat.TrackMatchInfo._trkindex, and pileupCalc.upper.

628  def __getattr__(self, attr):
629  """Custom __getattr__ because of the second index needed to access the branch.
630 
631  Note that when mapping the 'attr' to a branch, a 'trk' is
632  prepended and the first letter of 'attr' is turned to upper
633  case.
634  """
635  val = super(TrackMatchInfo, self).__getattr__("trk"+attr[0].upper()+attr[1:])()[self._trkindex]
636  return lambda: val
637 
def ntupleDataFormat.TrackMatchInfo.track (   self)

Member Data Documentation

ntupleDataFormat.TrackMatchInfo._trkindex
private

Definition at line 626 of file ntupleDataFormat.py.

Referenced by ntupleDataFormat.TrackMatchInfo.__getattr__().