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

Constructor & Destructor Documentation

◆ __init__()

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

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

Member Function Documentation

◆ __getattr__()

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.

Reimplemented from ntupleDataFormat._Object.

Definition at line 598 of file ntupleDataFormat.py.

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

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

◆ trackingParticle()

def ntupleDataFormat.TrackingParticleMatchInfo.trackingParticle (   self)

Member Data Documentation

◆ _tpindex

ntupleDataFormat.TrackingParticleMatchInfo._tpindex
private
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition: TrackingParticle.h:29
pileupCalc.upper
upper
Definition: pileupCalc.py:214