CMS 3D CMS Logo

PFTrack.h
Go to the documentation of this file.
1 #ifndef DataFormats_ParticleFlowReco_PFTrack_h
2 #define DataFormats_ParticleFlowReco_PFTrack_h
3 
5 
6 #include <iostream>
7 #include <vector>
8 
9 namespace reco {
10 
63  class PFTrack {
64  public:
65  PFTrack();
66 
67  PFTrack(double charge);
68 
69  PFTrack(const PFTrack& other);
70 
71  PFTrack& operator=(const PFTrack& other) = default;
72 
75  void addPoint(const reco::PFTrajectoryPoint& trajPt);
76 
78  void setPoint(unsigned int index, const reco::PFTrajectoryPoint& measurement) {
79  trajectoryPoints_[index] = measurement;
80  }
81 
83  double charge() const { return charge_; }
84 
86  unsigned int nTrajectoryPoints() const { return trajectoryPoints_.size(); }
87 
89  unsigned int nTrajectoryMeasurements() const {
90  return (indexOutermost_ ? indexOutermost_ - indexInnermost_ + 1 : 0);
91  }
92 
94  const std::vector<reco::PFTrajectoryPoint>& trajectoryPoints() const { return trajectoryPoints_; }
95 
98 
101  const reco::PFTrajectoryPoint& extrapolatedPoint(unsigned layerid) const;
102 
104  std::vector<reco::PFTrajectoryPoint>::const_iterator innermostMeasurement() const {
105  return trajectoryPoints_.begin() + indexInnermost_;
106  }
107 
109  std::vector<reco::PFTrajectoryPoint>::const_iterator outermostMeasurement() const {
110  return trajectoryPoints_.begin() + indexOutermost_;
111  }
112 
113  protected:
115  static const unsigned int nMaxTrackingLayers_;
116 
118  double charge_;
119 
121  std::vector<reco::PFTrajectoryPoint> trajectoryPoints_;
122 
124  unsigned int indexInnermost_;
125 
127  unsigned int indexOutermost_;
128  };
129  std::ostream& operator<<(std::ostream& out, const PFTrack& track);
130 
131 } // namespace reco
132 
133 #endif
std::vector< reco::PFTrajectoryPoint >::const_iterator outermostMeasurement() const
iterator on outermost tracker measurement
Definition: PFTrack.h:109
Base class for particle flow input reconstructed tracks and simulated particles.
Definition: PFTrack.h:63
const std::vector< reco::PFTrajectoryPoint > & trajectoryPoints() const
Definition: PFTrack.h:94
PFTrack & operator=(const PFTrack &other)=default
double charge() const
Definition: PFTrack.h:83
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
double charge_
charge
Definition: PFTrack.h:118
void addPoint(const reco::PFTrajectoryPoint &trajPt)
Definition: PFTrack.cc:28
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:121
void setPoint(unsigned int index, const reco::PFTrajectoryPoint &measurement)
set a trajectory point
Definition: PFTrack.h:78
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:46
unsigned int nTrajectoryMeasurements() const
Definition: PFTrack.h:89
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 nTrajectoryPoints() const
Definition: PFTrack.h:86
fixed size matrix
std::vector< reco::PFTrajectoryPoint >::const_iterator innermostMeasurement() const
iterator on innermost tracker measurement
Definition: PFTrack.h:104
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:124
const reco::PFTrajectoryPoint & trajectoryPoint(unsigned index) const
Definition: PFTrack.h:97
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...