CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Static Protected Attributes
reco::PFTrack Class Reference

Base class for particle flow input reconstructed tracks and simulated particles. More...

#include <PFTrack.h>

Inheritance diagram for reco::PFTrack:
reco::PFRecTrack reco::PFSimParticle reco::GsfPFRecTrack reco::PFBrem

Public Member Functions

void addPoint (const reco::PFTrajectoryPoint &trajPt)
 
double charge () const
 
const reco::PFTrajectoryPointextrapolatedPoint (unsigned layerid) const
 
std::vector< reco::PFTrajectoryPoint >::const_iterator innermostMeasurement () const
 iterator on innermost tracker measurement More...
 
unsigned int nTrajectoryMeasurements () const
 
unsigned int nTrajectoryPoints () const
 
std::vector< reco::PFTrajectoryPoint >::const_iterator outermostMeasurement () const
 iterator on outermost tracker measurement More...
 
 PFTrack ()
 
 PFTrack (const PFTrack &other)
 
 PFTrack (double charge)
 
void setPoint (unsigned int index, const reco::PFTrajectoryPoint &measurement)
 set a trajectory point More...
 
const reco::PFTrajectoryPointtrajectoryPoint (unsigned index) const
 
const std::vector< reco::PFTrajectoryPoint > & trajectoryPoints () const
 

Protected Attributes

double charge_
 charge More...
 
unsigned int indexInnermost_
 index innermost tracker measurement More...
 
unsigned int indexOutermost_
 index outermost tracker measurement More...
 
std::vector< reco::PFTrajectoryPointtrajectoryPoints_
 vector of trajectory points More...
 

Static Protected Attributes

static const unsigned int nMaxTrackingLayers_ = 17
 maximal number of tracking layers More...
 

Detailed Description

Base class for particle flow input reconstructed tracks and simulated particles.

A PFTrack contains a vector of PFTrajectoryPoint objects. These points are stored in a vector to benefit from the random access. One must take care of storing the points in the right order, and it might even be necessary to insert dummy points.

For a PFRecTrack, the ordering of the points is the following:

For a PFSimParticle, the ordering of the points is the following.

PFRecTracks and PFSimParticles are created in the PFTrackProducer module.

Author
Renaud Bruneliere
Date
July 2006

Definition at line 63 of file PFTrack.h.

Constructor & Destructor Documentation

◆ PFTrack() [1/3]

PFTrack::PFTrack ( )

Definition at line 12 of file PFTrack.cc.

13  // prepare vector of trajectory points for propagated positions
15 }

References reco::PFTrajectoryPoint::NLayers, nMaxTrackingLayers_, and trajectoryPoints_.

◆ PFTrack() [2/3]

PFTrack::PFTrack ( double  charge)

Definition at line 17 of file PFTrack.cc.

18  // prepare vector of trajectory points for propagated positions
20 }

References reco::PFTrajectoryPoint::NLayers, nMaxTrackingLayers_, and trajectoryPoints_.

◆ PFTrack() [3/3]

PFTrack::PFTrack ( const PFTrack other)

Definition at line 22 of file PFTrack.cc.

23  : charge_(other.charge_),
24  trajectoryPoints_(other.trajectoryPoints_),
25  indexInnermost_(other.indexInnermost_),
26  indexOutermost_(other.indexOutermost_) {}

Member Function Documentation

◆ addPoint()

void PFTrack::addPoint ( const reco::PFTrajectoryPoint trajPt)

add a trajectory measurement

Definition at line 28 of file PFTrack.cc.

28  {
29  if (trajPt.isTrackerLayer()) {
30  if (!indexOutermost_) { // first time a measurement is added
32  PFTrajectoryPoint dummyPt;
33  for (unsigned iPt = trajectoryPoints_.size(); iPt < PFTrajectoryPoint::BeamPipeOrEndVertex + 1; iPt++)
34  trajectoryPoints_.push_back(dummyPt);
36  edm::LogWarning("PFTrack") << "trajectoryPoints_.size() is too large = " << trajectoryPoints_.size();
37  }
39  } else
41  }
42  // Use push_back instead of insert in order to gain time
43  trajectoryPoints_.push_back(trajPt);
44 }

References reco::PFTrajectoryPoint::BeamPipeOrEndVertex, indexInnermost_, indexOutermost_, reco::PFTrajectoryPoint::isTrackerLayer(), and trajectoryPoints_.

Referenced by PFTrackTransformer::addPoints(), and PFTrackTransformer::addPointsAndBrems().

◆ charge()

double reco::PFTrack::charge ( ) const
inline
Returns
electric charge

Definition at line 81 of file PFTrack.h.

81 { return charge_; }

References charge_.

◆ extrapolatedPoint()

const reco::PFTrajectoryPoint & PFTrack::extrapolatedPoint ( unsigned  layerid) const
Returns
an extrapolated point

Definition at line 46 of file PFTrack.cc.

46  {
47  const unsigned offset_layerid = nTrajectoryMeasurements() + layerid;
48  if (layerid >= reco::PFTrajectoryPoint::NLayers || offset_layerid >= trajectoryPoints_.size()) {
49  throw cms::Exception("SizeError") << "PFRecTrack::extrapolatedPoint: cannot access " << layerid
50  << " #traj meas = " << nTrajectoryMeasurements()
51  << " #traj points = " << trajectoryPoints_.size() << endl
52  << (*this);
53  }
54  if (layerid < indexInnermost_)
55  return trajectoryPoints_[layerid];
56  else
57  return trajectoryPoints_[offset_layerid];
58 }

References Exception, indexInnermost_, reco::PFTrajectoryPoint::NLayers, nTrajectoryMeasurements(), and trajectoryPoints_.

Referenced by PFElecTkProducer::isSharingEcalEnergyWithEgSC(), and ConvBremPFTrackFinder::runConvBremFinder().

◆ innermostMeasurement()

std::vector<reco::PFTrajectoryPoint>::const_iterator reco::PFTrack::innermostMeasurement ( ) const
inline

iterator on innermost tracker measurement

Definition at line 102 of file PFTrack.h.

102  {
103  return trajectoryPoints_.begin() + indexInnermost_;
104  }

References indexInnermost_, and trajectoryPoints_.

◆ nTrajectoryMeasurements()

unsigned int reco::PFTrack::nTrajectoryMeasurements ( ) const
inline
Returns
number of trajectory measurements in tracker

Definition at line 87 of file PFTrack.h.

87  {
88  return (indexOutermost_ ? indexOutermost_ - indexInnermost_ + 1 : 0);
89  }

References indexInnermost_, and indexOutermost_.

Referenced by extrapolatedPoint().

◆ nTrajectoryPoints()

unsigned int reco::PFTrack::nTrajectoryPoints ( ) const
inline
Returns
number of trajectory points

Definition at line 84 of file PFTrack.h.

84 { return trajectoryPoints_.size(); }

References trajectoryPoints_.

◆ outermostMeasurement()

std::vector<reco::PFTrajectoryPoint>::const_iterator reco::PFTrack::outermostMeasurement ( ) const
inline

iterator on outermost tracker measurement

Definition at line 107 of file PFTrack.h.

107  {
108  return trajectoryPoints_.begin() + indexOutermost_;
109  }

References indexOutermost_, and trajectoryPoints_.

◆ setPoint()

void reco::PFTrack::setPoint ( unsigned int  index,
const reco::PFTrajectoryPoint measurement 
)
inline

set a trajectory point

Definition at line 76 of file PFTrack.h.

76  {
77  trajectoryPoints_[index] = measurement;
78  }

References trajectoryPoints_.

◆ trajectoryPoint()

const reco::PFTrajectoryPoint& reco::PFTrack::trajectoryPoint ( unsigned  index) const
inline
Returns
a trajectory point

Definition at line 95 of file PFTrack.h.

95 { return trajectoryPoints_[index]; }

References trajectoryPoints_.

◆ trajectoryPoints()

const std::vector<reco::PFTrajectoryPoint>& reco::PFTrack::trajectoryPoints ( ) const
inline
Returns
vector of trajectory points

Definition at line 92 of file PFTrack.h.

92 { return trajectoryPoints_; }

References trajectoryPoints_.

Member Data Documentation

◆ charge_

double reco::PFTrack::charge_
protected

charge

Definition at line 116 of file PFTrack.h.

Referenced by charge().

◆ indexInnermost_

unsigned int reco::PFTrack::indexInnermost_
protected

index innermost tracker measurement

Definition at line 122 of file PFTrack.h.

Referenced by addPoint(), extrapolatedPoint(), innermostMeasurement(), and nTrajectoryMeasurements().

◆ indexOutermost_

unsigned int reco::PFTrack::indexOutermost_
protected

index outermost tracker measurement

Definition at line 125 of file PFTrack.h.

Referenced by addPoint(), nTrajectoryMeasurements(), and outermostMeasurement().

◆ nMaxTrackingLayers_

const unsigned PFTrack::nMaxTrackingLayers_ = 17
staticprotected

maximal number of tracking layers

Definition at line 113 of file PFTrack.h.

Referenced by PFTrack().

◆ trajectoryPoints_

std::vector<reco::PFTrajectoryPoint> reco::PFTrack::trajectoryPoints_
protected
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
reco::PFTrajectoryPoint::NLayers
Definition: PFTrajectoryPoint.h:56
reco::PFTrajectoryPoint::BeamPipeOrEndVertex
Definition: PFTrajectoryPoint.h:37
trackingPlots.other
other
Definition: trackingPlots.py:1460
reco::PFTrack::charge
double charge() const
Definition: PFTrack.h:81
reco::PFTrack::nTrajectoryMeasurements
unsigned int nTrajectoryMeasurements() const
Definition: PFTrack.h:87
reco::PFTrack::charge_
double charge_
charge
Definition: PFTrack.h:116
reco::PFTrajectoryPoint
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: PFTrajectoryPoint.h:26
reco::PFTrack::trajectoryPoints_
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
Exception
Definition: hltDiff.cc:245
reco::PFTrack::indexOutermost_
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:125
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
reco::PFTrack::indexInnermost_
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122
reco::PFTrack::nMaxTrackingLayers_
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:113
reco::PFTrajectoryPoint::isTrackerLayer
bool isTrackerLayer() const
is this point corresponding to an intersection with a tracker layer ?
Definition: PFTrajectoryPoint.h:92