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 __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 611 of file ntupleDataFormat.py.

Constructor & Destructor Documentation

◆ __init__()

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 617 of file ntupleDataFormat.py.

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

Member Function Documentation

◆ __getattr__()

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.

Reimplemented from ntupleDataFormat._Object.

Definition at line 629 of file ntupleDataFormat.py.

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

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

◆ track()

def ntupleDataFormat.TrackMatchInfo.track (   self)

Member Data Documentation

◆ _trkindex

ntupleDataFormat.TrackMatchInfo._trkindex
private

Definition at line 627 of file ntupleDataFormat.py.

Referenced by ntupleDataFormat.TrackMatchInfo.__getattr__().

HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
pileupCalc.upper
upper
Definition: pileupCalc.py:213