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.TrackMatchInfo Class Reference
Inheritance diagram for ntupleDataFormat.TrackMatchInfo:
ntupleDataFormat._Object

Public Member Functions

def __getattr__
 
def __init__
 
def track
 
- Public Member Functions inherited from ntupleDataFormat._Object
def __getattr__
 
def __init__
 
def index
 
def isValid
 

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

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.

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

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

References ntupleDataFormat.TrackMatchInfo._trkindex.

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

Definition at line 639 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().

640  def track(self):
641  """Returns matched Track."""
642  return Track(self._tree, self.idx())

Member Data Documentation

ntupleDataFormat.TrackMatchInfo._trkindex
private

Definition at line 627 of file ntupleDataFormat.py.

Referenced by ntupleDataFormat.TrackMatchInfo.__getattr__().