#include <DataFormats/ParticleFlowReco/interface/PFTrack.h>
Public Member Functions | |
void | addPoint (const reco::PFTrajectoryPoint &trajPt) |
add a trajectory measurement | |
void | calculatePositionREP () |
calculate posrep_ once and for all for each point | |
double | charge () const |
| |
int | color () const |
const reco::PFTrajectoryPoint & | extrapolatedPoint (unsigned layerid) const |
| |
std::vector < reco::PFTrajectoryPoint > ::const_iterator | innermostMeasurement () const |
iterator on innermost tracker measurement | |
unsigned int | nTrajectoryMeasurements () const |
| |
unsigned int | nTrajectoryPoints () const |
| |
std::vector < reco::PFTrajectoryPoint > ::const_iterator | outermostMeasurement () const |
iterator on outermost tracker measurement | |
PFTrack (const PFTrack &other) | |
PFTrack (double charge) | |
PFTrack () | |
void | setColor (int color) |
void | setPoint (unsigned int index, const reco::PFTrajectoryPoint &measurement) |
set a trajectory point | |
const reco::PFTrajectoryPoint & | trajectoryPoint (unsigned index) const |
| |
const std::vector < reco::PFTrajectoryPoint > & | trajectoryPoints () const |
| |
Protected Attributes | |
double | charge_ |
charge | |
int | color_ |
color (transient) | |
unsigned int | indexInnermost_ |
index innermost tracker measurement | |
unsigned int | indexOutermost_ |
index outermost tracker measurement | |
std::vector < reco::PFTrajectoryPoint > | trajectoryPoints_ |
vector of trajectory points | |
Static Protected Attributes | |
static const unsigned int | nMaxTrackingLayers_ = 17 |
maximal number of tracking layers | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const PFTrack &track) |
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.
Definition at line 63 of file PFTrack.h.
PFTrack::PFTrack | ( | ) |
Definition at line 11 of file PFTrack.cc.
References reco::PFTrajectoryPoint::NLayers, nMaxTrackingLayers_, and trajectoryPoints_.
00011 : 00012 charge_(0.), 00013 indexInnermost_(0), 00014 indexOutermost_(0), 00015 color_(1) { 00016 00017 // prepare vector of trajectory points for propagated positions 00018 trajectoryPoints_.reserve(PFTrajectoryPoint::NLayers + nMaxTrackingLayers_); 00019 }
PFTrack::PFTrack | ( | double | charge | ) |
Definition at line 22 of file PFTrack.cc.
References reco::PFTrajectoryPoint::NLayers, nMaxTrackingLayers_, and trajectoryPoints_.
00022 : 00023 charge_(charge), 00024 indexInnermost_(0), 00025 indexOutermost_(0), 00026 color_(1) { 00027 00028 // prepare vector of trajectory points for propagated positions 00029 trajectoryPoints_.reserve(PFTrajectoryPoint::NLayers + nMaxTrackingLayers_); 00030 }
PFTrack::PFTrack | ( | const PFTrack & | other | ) |
Definition at line 33 of file PFTrack.cc.
00033 : 00034 charge_(other.charge_), 00035 trajectoryPoints_(other.trajectoryPoints_), 00036 indexInnermost_(other.indexInnermost_), 00037 indexOutermost_(other.indexOutermost_), 00038 color_(other.color_) 00039 {}
void PFTrack::addPoint | ( | const reco::PFTrajectoryPoint & | trajPt | ) |
add a trajectory measurement
Definition at line 42 of file PFTrack.cc.
References reco::PFTrajectoryPoint::BeamPipeOrEndVertex, indexInnermost_, indexOutermost_, reco::PFTrajectoryPoint::isTrackerLayer(), and trajectoryPoints_.
Referenced by PFTrackTransformer::addPoints(), and PFTrackTransformer::addPointsAndBrems().
00042 { 00043 00044 // cout<<"adding "<<trajPt<<endl; 00045 00046 if (trajPt.isTrackerLayer()) { 00047 if (!indexOutermost_) { // first time a measurement is added 00048 if (trajectoryPoints_.size() < PFTrajectoryPoint::BeamPipeOrEndVertex + 1) { 00049 PFTrajectoryPoint dummyPt; 00050 for (unsigned iPt = trajectoryPoints_.size(); iPt < PFTrajectoryPoint::BeamPipeOrEndVertex + 1; iPt++) 00051 trajectoryPoints_.push_back(dummyPt); 00052 } else if (trajectoryPoints_.size() > PFTrajectoryPoint::BeamPipeOrEndVertex + 1) { 00053 // throw an exception here 00054 // edm::LogError("PFTrack")<<"trajectoryPoints_.size() is too large = " 00055 // <<trajectoryPoints_.size()<<"\n"; 00056 } 00057 indexOutermost_ = indexInnermost_ = PFTrajectoryPoint::BeamPipeOrEndVertex + 1; 00058 } else 00059 indexOutermost_++; 00060 } 00061 // Use push_back instead of insert in order to gain time 00062 trajectoryPoints_.push_back(trajPt); 00063 00064 // cout<<"adding point "<<*this<<endl; 00065 }
void PFTrack::calculatePositionREP | ( | ) |
calculate posrep_ once and for all for each point
Definition at line 68 of file PFTrack.cc.
References i, and trajectoryPoints_.
00068 { 00069 00070 for(unsigned i=0; i<trajectoryPoints_.size(); i++) { 00071 trajectoryPoints_[i].calculatePositionREP(); 00072 } 00073 }
double reco::PFTrack::charge | ( | ) | const [inline] |
Definition at line 87 of file PFTrack.h.
References charge_.
Referenced by PFRootEventManager::countChargedAndPhotons(), reco::operator<<(), and PFRootEventManagerColin::processHIGH_E_TAUS().
00087 { return charge_; }
int reco::PFTrack::color | ( | ) | const [inline] |
const reco::PFTrajectoryPoint & PFTrack::extrapolatedPoint | ( | unsigned | layerid | ) | const |
Definition at line 76 of file PFTrack.cc.
References lat::endl(), Exception, indexInnermost_, reco::PFTrajectoryPoint::NLayers, nTrajectoryMeasurements(), and trajectoryPoints_.
Referenced by PFRootEventManager::closestParticle(), PFRootEventManager::fillOutEventWithSimParticles(), PFAlgo::isSatelliteCluster(), DisplayManager::loadGSimParticles(), PFBlockAlgo::testLinkByRecHit(), PFBlockAlgo::testTrackAndECAL(), PFBlockAlgo::testTrackAndHCAL(), and PFBlockAlgo::testTrackAndPS().
00076 { 00077 00078 if( layerid >= reco::PFTrajectoryPoint::NLayers || 00079 nTrajectoryMeasurements() + layerid >= trajectoryPoints_.size() ) { 00080 00081 // cout<<(*this)<<endl; 00082 // cout<<"lid "<<layerid<<" "<<nTrajectoryMeasurements()<<" "<<trajectoryPoints_.size()<<endl; 00083 00084 throw cms::Exception("SizeError")<<"PFRecTrack::extrapolatedPoint: cannot access " 00085 <<layerid 00086 <<" #traj meas = "<<nTrajectoryMeasurements() 00087 <<" #traj points = "<<trajectoryPoints_.size() 00088 <<endl 00089 <<(*this); 00090 // assert(0); 00091 } 00092 if (layerid < indexInnermost_) 00093 return trajectoryPoints_[ layerid ]; 00094 else 00095 return trajectoryPoints_[ nTrajectoryMeasurements() + layerid ]; 00096 }
std::vector< reco::PFTrajectoryPoint >::const_iterator reco::PFTrack::innermostMeasurement | ( | ) | const [inline] |
iterator on innermost tracker measurement
Definition at line 111 of file PFTrack.h.
References indexInnermost_, and trajectoryPoints_.
00112 { return trajectoryPoints_.begin() + indexInnermost_; }
unsigned int reco::PFTrack::nTrajectoryMeasurements | ( | ) | const [inline] |
Definition at line 94 of file PFTrack.h.
References indexInnermost_, and indexOutermost_.
Referenced by PFRootEventManager::closestParticle(), extrapolatedPoint(), and reco::operator<<().
00095 { return (indexOutermost_ ? indexOutermost_ - indexInnermost_ + 1 : 0); }
unsigned int reco::PFTrack::nTrajectoryPoints | ( | ) | const [inline] |
Definition at line 90 of file PFTrack.h.
References trajectoryPoints_.
Referenced by PFRootEventManager::closestParticle(), and PFRootEventManager::fillOutEventWithSimParticles().
00091 { return trajectoryPoints_.size(); }
std::vector< reco::PFTrajectoryPoint >::const_iterator reco::PFTrack::outermostMeasurement | ( | ) | const [inline] |
iterator on outermost tracker measurement
Definition at line 116 of file PFTrack.h.
References indexOutermost_, and trajectoryPoints_.
00117 { return trajectoryPoints_.begin() + indexOutermost_; }
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_.
00080 { trajectoryPoints_[index] = measurement; }
const reco::PFTrajectoryPoint& reco::PFTrack::trajectoryPoint | ( | unsigned | index | ) | const [inline] |
Definition at line 102 of file PFTrack.h.
References trajectoryPoints_.
Referenced by DisplayManager::loadGSimParticles(), and reco::operator<<().
00103 { return trajectoryPoints_[index]; }
const std::vector< reco::PFTrajectoryPoint >& reco::PFTrack::trajectoryPoints | ( | ) | const [inline] |
Definition at line 98 of file PFTrack.h.
References trajectoryPoints_.
Referenced by DisplayManager::loadGSimParticles(), and PFRootEventManager::trackInsideGCut().
00099 { return trajectoryPoints_; }
std::ostream& operator<< | ( | std::ostream & | out, | |
const PFTrack & | track | |||
) | [friend] |
double reco::PFTrack::charge_ [protected] |
int reco::PFTrack::color_ [protected] |
unsigned int reco::PFTrack::indexInnermost_ [protected] |
index innermost tracker measurement
Definition at line 139 of file PFTrack.h.
Referenced by addPoint(), extrapolatedPoint(), innermostMeasurement(), and nTrajectoryMeasurements().
unsigned int reco::PFTrack::indexOutermost_ [protected] |
index outermost tracker measurement
Definition at line 142 of file PFTrack.h.
Referenced by addPoint(), nTrajectoryMeasurements(), and outermostMeasurement().
const unsigned PFTrack::nMaxTrackingLayers_ = 17 [static, protected] |
std::vector< reco::PFTrajectoryPoint > reco::PFTrack::trajectoryPoints_ [protected] |
vector of trajectory points
Definition at line 136 of file PFTrack.h.
Referenced by addPoint(), calculatePositionREP(), extrapolatedPoint(), innermostMeasurement(), nTrajectoryPoints(), reco::operator<<(), outermostMeasurement(), PFTrack(), setPoint(), trajectoryPoint(), and trajectoryPoints().