CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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__
 
def __init__
 
def trackingParticle
 
- Public Member Functions inherited from ntupleDataFormat._Object
def __getattr__
 
def __init__
 
def index
 
def isValid
 

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 577 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 585 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

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

References ntupleDataFormat.TrackingParticleMatchInfo._tpindex.

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
def ntupleDataFormat.TrackingParticleMatchInfo.trackingParticle (   self)
Returns matched TrackingParticle.

Definition at line 607 of file ntupleDataFormat.py.

References ntupleDataFormat._Collection._tree, ntupleDataFormat._Object._tree, python.cmstools.EventTree._tree, SingularMode.idx, ME0SegmentAlgorithmBase::HitAndPosition.idx, TriggerOutputBranches::NamedBranchPtr.idx, GE0SegAlgoRU::HitAndPosition.idx, MuonAssociatorByHitsHelper::IndexMatch.idx, reco::VertexCompositeCandidate.idx(), RPCLinkSynchroStat::ShortLinkInfo.idx, HcalLogicalMapGenerator.idx, reco::VertexCompositePtrCandidate.idx(), npstat::Element1D< Container, Result >.idx, npstat::Element1DAt< Container, Result >.idx, and reco::Vertex.idx().

608  def trackingParticle(self):
609  """Returns matched TrackingParticle."""
610  return TrackingParticle(self._tree, self.idx())

Member Data Documentation

ntupleDataFormat.TrackingParticleMatchInfo._tpindex
private

Definition at line 595 of file ntupleDataFormat.py.

Referenced by ntupleDataFormat.TrackingParticleMatchInfo.__getattr__().