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)
 
void calculatePositionREP ()
 
double charge () const
 
int color () 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 setColor (int color)
 
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...
 
int color_
 color (transient) 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 11 of file PFTrack.cc.

11  : charge_(0.), indexInnermost_(0), indexOutermost_(0), color_(1) {
12  // prepare vector of trajectory points for propagated positions
14 }

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

◆ PFTrack() [2/3]

PFTrack::PFTrack ( double  charge)

Definition at line 16 of file PFTrack.cc.

17  // prepare vector of trajectory points for propagated positions
19 }

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

◆ PFTrack() [3/3]

PFTrack::PFTrack ( const PFTrack other)

Definition at line 21 of file PFTrack.cc.

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

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  // cout<<"adding "<<trajPt<<endl;
30 
31  if (trajPt.isTrackerLayer()) {
32  if (!indexOutermost_) { // first time a measurement is added
34  PFTrajectoryPoint dummyPt;
35  for (unsigned iPt = trajectoryPoints_.size(); iPt < PFTrajectoryPoint::BeamPipeOrEndVertex + 1; iPt++)
36  trajectoryPoints_.push_back(dummyPt);
38  // throw an exception here
39  // edm::LogError("PFTrack")<<"trajectoryPoints_.size() is too large = "
40  // <<trajectoryPoints_.size()<<"\n";
41  }
43  } else
45  }
46  // Use push_back instead of insert in order to gain time
47  trajectoryPoints_.push_back(trajPt);
48 
49  // cout<<"adding point "<<*this<<endl;
50 }

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

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

◆ calculatePositionREP()

void PFTrack::calculatePositionREP ( )

calculate posrep_ once and for all for each point

Definition at line 52 of file PFTrack.cc.

52  {
53  //for(unsigned i=0; i<trajectoryPoints_.size(); i++) {
54  // trajectoryPoints_[i].calculatePositionREP();
55  //}
56 }

Referenced by PFTrackTransformer::addPointsAndBrems(), reco::GsfPFRecTrack::calculateBremPositionREP(), and ConvBremPFTrackFinder::runConvBremFinder().

◆ charge()

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

Definition at line 85 of file PFTrack.h.

85 { return charge_; }

References charge_.

◆ color()

int reco::PFTrack::color ( ) const
inline

Definition at line 117 of file PFTrack.h.

117 { return color_; }

References color_.

Referenced by setColor().

◆ extrapolatedPoint()

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

Definition at line 58 of file PFTrack.cc.

58  {
59  const unsigned offset_layerid = nTrajectoryMeasurements() + layerid;
60  if (layerid >= reco::PFTrajectoryPoint::NLayers || offset_layerid >= trajectoryPoints_.size()) {
61  throw cms::Exception("SizeError") << "PFRecTrack::extrapolatedPoint: cannot access " << layerid
62  << " #traj meas = " << nTrajectoryMeasurements()
63  << " #traj points = " << trajectoryPoints_.size() << endl
64  << (*this);
65  // assert(0);
66  }
67  if (layerid < indexInnermost_)
68  return trajectoryPoints_[layerid];
69  else
70  return trajectoryPoints_[offset_layerid];
71 }

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 106 of file PFTrack.h.

106  {
107  return trajectoryPoints_.begin() + indexInnermost_;
108  }

References indexInnermost_, and trajectoryPoints_.

◆ nTrajectoryMeasurements()

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

Definition at line 91 of file PFTrack.h.

91  {
92  return (indexOutermost_ ? indexOutermost_ - indexInnermost_ + 1 : 0);
93  }

References indexInnermost_, and indexOutermost_.

Referenced by extrapolatedPoint().

◆ nTrajectoryPoints()

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

Definition at line 88 of file PFTrack.h.

88 { 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 111 of file PFTrack.h.

111  {
112  return trajectoryPoints_.begin() + indexOutermost_;
113  }

References indexOutermost_, and trajectoryPoints_.

◆ setColor()

void reco::PFTrack::setColor ( int  color)
inline

Definition at line 115 of file PFTrack.h.

115 { color_ = color; }

References color(), and color_.

◆ 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 99 of file PFTrack.h.

99 { return trajectoryPoints_[index]; }

References trajectoryPoints_.

◆ trajectoryPoints()

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

Definition at line 96 of file PFTrack.h.

96 { return trajectoryPoints_; }

References trajectoryPoints_.

Member Data Documentation

◆ charge_

double reco::PFTrack::charge_
protected

charge

Definition at line 124 of file PFTrack.h.

Referenced by charge().

◆ color_

int reco::PFTrack::color_
protected

color (transient)

Definition at line 136 of file PFTrack.h.

Referenced by color(), and setColor().

◆ indexInnermost_

unsigned int reco::PFTrack::indexInnermost_
protected

index innermost tracker measurement

Definition at line 130 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 133 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 121 of file PFTrack.h.

Referenced by PFTrack().

◆ trajectoryPoints_

std::vector<reco::PFTrajectoryPoint> reco::PFTrack::trajectoryPoints_
protected
reco::PFTrajectoryPoint::NLayers
Definition: PFTrajectoryPoint.h:56
reco::PFTrajectoryPoint::BeamPipeOrEndVertex
Definition: PFTrajectoryPoint.h:37
reco::PFTrack::color
int color() const
Definition: PFTrack.h:117
reco::PFTrack::color_
int color_
color (transient)
Definition: PFTrack.h:136
trackingPlots.other
other
Definition: trackingPlots.py:1465
reco::PFTrack::charge
double charge() const
Definition: PFTrack.h:85
reco::PFTrack::nTrajectoryMeasurements
unsigned int nTrajectoryMeasurements() const
Definition: PFTrack.h:91
reco::PFTrack::charge_
double charge_
charge
Definition: PFTrack.h:124
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:127
Exception
Definition: hltDiff.cc:246
reco::PFTrack::indexOutermost_
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:133
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
reco::PFTrack::indexInnermost_
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:130
reco::PFTrack::nMaxTrackingLayers_
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:121
reco::PFTrajectoryPoint::isTrackerLayer
bool isTrackerLayer() const
is this point corresponding to an intersection with a tracker layer ?
Definition: PFTrajectoryPoint.h:92