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
 
PFTrackoperator= (const PFTrack &other)=default
 
std::vector< reco::PFTrajectoryPoint >::const_iterator outermostMeasurement () const
 iterator on outermost tracker measurement More...
 
 PFTrack ()
 
 PFTrack (double charge)
 
 PFTrack (const PFTrack &other)
 
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.

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

13  // prepare vector of trajectory points for propagated positions
15 }
double charge_
charge
Definition: PFTrack.h:118
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:115
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:127
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124

◆ PFTrack() [2/3]

PFTrack::PFTrack ( double  charge)

Definition at line 17 of file PFTrack.cc.

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

18  // prepare vector of trajectory points for propagated positions
20 }
double charge() const
Definition: PFTrack.h:83
double charge_
charge
Definition: PFTrack.h:118
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:115
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:127
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124

◆ 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_) {}
double charge_
charge
Definition: PFTrack.h:118
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:127
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124

Member Function Documentation

◆ addPoint()

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

add a trajectory measurement

Definition at line 28 of file PFTrack.cc.

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

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

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 }
bool isTrackerLayer() const
is this point corresponding to an intersection with a tracker layer ?
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:127
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Log< level::Warning, false > LogWarning

◆ charge()

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

Definition at line 83 of file PFTrack.h.

References charge_.

83 { return charge_; }
double charge_
charge
Definition: PFTrack.h:118

◆ extrapolatedPoint()

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

Definition at line 46 of file PFTrack.cc.

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

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

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 }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
unsigned int nTrajectoryMeasurements() const
Definition: PFTrack.h:89
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124

◆ innermostMeasurement()

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

iterator on innermost tracker measurement

Definition at line 104 of file PFTrack.h.

References indexInnermost_, and trajectoryPoints_.

104  {
105  return trajectoryPoints_.begin() + indexInnermost_;
106  }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124

◆ nTrajectoryMeasurements()

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

Definition at line 89 of file PFTrack.h.

References indexInnermost_, and indexOutermost_.

Referenced by extrapolatedPoint().

89  {
90  return (indexOutermost_ ? indexOutermost_ - indexInnermost_ + 1 : 0);
91  }
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:127
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124

◆ nTrajectoryPoints()

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

Definition at line 86 of file PFTrack.h.

References trajectoryPoints_.

86 { return trajectoryPoints_.size(); }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121

◆ operator=()

PFTrack& reco::PFTrack::operator= ( const PFTrack other)
default

◆ outermostMeasurement()

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

iterator on outermost tracker measurement

Definition at line 109 of file PFTrack.h.

References indexOutermost_, and trajectoryPoints_.

109  {
110  return trajectoryPoints_.begin() + indexOutermost_;
111  }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:127

◆ setPoint()

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

set a trajectory point

Definition at line 78 of file PFTrack.h.

References trajectoryPoints_.

78  {
79  trajectoryPoints_[index] = measurement;
80  }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121

◆ trajectoryPoint()

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

Definition at line 97 of file PFTrack.h.

References trajectoryPoints_.

97 { return trajectoryPoints_[index]; }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121

◆ trajectoryPoints()

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

Definition at line 94 of file PFTrack.h.

References trajectoryPoints_.

94 { return trajectoryPoints_; }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121

Member Data Documentation

◆ charge_

double reco::PFTrack::charge_
protected

charge

Definition at line 118 of file PFTrack.h.

Referenced by charge().

◆ indexInnermost_

unsigned int reco::PFTrack::indexInnermost_
protected

index innermost tracker measurement

Definition at line 124 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 127 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 115 of file PFTrack.h.

Referenced by PFTrack().

◆ trajectoryPoints_

std::vector<reco::PFTrajectoryPoint> reco::PFTrack::trajectoryPoints_
protected