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 | 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 (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::PFTrajectoryPoint
trajectoryPoints_
 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::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:116
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:113
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:125
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122
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_
charge
Definition: PFTrack.h:116
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:113
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:125
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122
double charge() const
Definition: PFTrack.h:81
PFTrack::PFTrack ( const PFTrack other)

Definition at line 22 of file PFTrack.cc.

23  : charge_(other.charge_),
double charge_
charge
Definition: PFTrack.h:116
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:125
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122

Member Function Documentation

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:119
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:125
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Log< level::Warning, false > LogWarning
double reco::PFTrack::charge ( ) const
inline
Returns
electric charge

Definition at line 81 of file PFTrack.h.

References charge_.

Referenced by reco::operator<<().

81 { return charge_; }
double charge_
charge
Definition: PFTrack.h:116
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(), ConvBremPFTrackFinder::runConvBremFinder(), GSFAndHCALLinker::testLink(), HGCalAndBREMLinker::testLink(), HCALAndBREMLinker::testLink(), GSFAndHGCalLinker::testLink(), ECALAndBREMLinker::testLink(), GSFAndECALLinker::testLink(), and LinkByRecHit::testTrackAndClusterByRecHit().

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:119
unsigned int nTrajectoryMeasurements() const
Definition: PFTrack.h:87
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122
std::vector<reco::PFTrajectoryPoint>::const_iterator reco::PFTrack::innermostMeasurement ( ) const
inline

iterator on innermost tracker measurement

Definition at line 102 of file PFTrack.h.

References indexInnermost_, and trajectoryPoints_.

102  {
103  return trajectoryPoints_.begin() + indexInnermost_;
104  }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122
unsigned int reco::PFTrack::nTrajectoryMeasurements ( ) const
inline
Returns
number of trajectory measurements in tracker

Definition at line 87 of file PFTrack.h.

References indexInnermost_, and indexOutermost_.

Referenced by extrapolatedPoint(), and reco::operator<<().

87  {
88  return (indexOutermost_ ? indexOutermost_ - indexInnermost_ + 1 : 0);
89  }
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:125
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:122
unsigned int reco::PFTrack::nTrajectoryPoints ( ) const
inline
Returns
number of trajectory points

Definition at line 84 of file PFTrack.h.

References trajectoryPoints_.

84 { return trajectoryPoints_.size(); }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
std::vector<reco::PFTrajectoryPoint>::const_iterator reco::PFTrack::outermostMeasurement ( ) const
inline

iterator on outermost tracker measurement

Definition at line 107 of file PFTrack.h.

References indexOutermost_, and trajectoryPoints_.

107  {
108  return trajectoryPoints_.begin() + indexOutermost_;
109  }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:125
void reco::PFTrack::setPoint ( unsigned int  index,
const reco::PFTrajectoryPoint measurement 
)
inline

set a trajectory point

Definition at line 76 of file PFTrack.h.

References trajectoryPoints_.

76  {
77  trajectoryPoints_[index] = measurement;
78  }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
const reco::PFTrajectoryPoint& reco::PFTrack::trajectoryPoint ( unsigned  index) const
inline
Returns
a trajectory point

Definition at line 95 of file PFTrack.h.

References trajectoryPoints_.

Referenced by reco::operator<<().

95 { return trajectoryPoints_[index]; }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:119
const std::vector<reco::PFTrajectoryPoint>& reco::PFTrack::trajectoryPoints ( ) const
inline
Returns
vector of trajectory points

Definition at line 92 of file PFTrack.h.

References trajectoryPoints_.

Referenced by reco::operator<<().

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

Member Data Documentation

double reco::PFTrack::charge_
protected

charge

Definition at line 116 of file PFTrack.h.

Referenced by charge().

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().

unsigned int reco::PFTrack::indexOutermost_
protected

index outermost tracker measurement

Definition at line 125 of file PFTrack.h.

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

const unsigned PFTrack::nMaxTrackingLayers_ = 17
staticprotected

maximal number of tracking layers

Definition at line 113 of file PFTrack.h.

Referenced by PFTrack().

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