CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes | Static Protected Attributes | Friends
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 (double charge)
 
 PFTrack (const PFTrack &other)
 
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::PFTrajectoryPoint
trajectoryPoints_
 vector of trajectory points More...
 

Static Protected Attributes

static const unsigned int nMaxTrackingLayers_ = 17
 maximal number of tracking layers More...
 

Friends

std::ostream & operator<< (std::ostream &out, const PFTrack &track)
 

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 11 of file PFTrack.cc.

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

11  :
12  charge_(0.),
13  indexInnermost_(0),
14  indexOutermost_(0),
15  color_(1) {
16 
17  // prepare vector of trajectory points for propagated positions
19 }
int color_
color (transient)
Definition: PFTrack.h:145
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:136
double charge_
charge
Definition: PFTrack.h:133
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:130
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:142
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:139
PFTrack::PFTrack ( double  charge)

Definition at line 22 of file PFTrack.cc.

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

22  :
23  charge_(charge),
24  indexInnermost_(0),
25  indexOutermost_(0),
26  color_(1) {
27 
28  // prepare vector of trajectory points for propagated positions
30 }
int color_
color (transient)
Definition: PFTrack.h:145
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:136
double charge_
charge
Definition: PFTrack.h:133
static const unsigned int nMaxTrackingLayers_
maximal number of tracking layers
Definition: PFTrack.h:130
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:142
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:139
double charge() const
Definition: PFTrack.h:87
PFTrack::PFTrack ( const PFTrack other)

Definition at line 33 of file PFTrack.cc.

33  :
34  charge_(other.charge_),
38  color_(other.color_)
39 {}
int color_
color (transient)
Definition: PFTrack.h:145
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:136
double charge_
charge
Definition: PFTrack.h:133
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:142
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:139

Member Function Documentation

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

42  {
43 
44  // cout<<"adding "<<trajPt<<endl;
45 
46  if (trajPt.isTrackerLayer()) {
47  if (!indexOutermost_) { // first time a measurement is added
49  PFTrajectoryPoint dummyPt;
50  for (unsigned iPt = trajectoryPoints_.size(); iPt < PFTrajectoryPoint::BeamPipeOrEndVertex + 1; iPt++)
51  trajectoryPoints_.push_back(dummyPt);
53  // throw an exception here
54  // edm::LogError("PFTrack")<<"trajectoryPoints_.size() is too large = "
55  // <<trajectoryPoints_.size()<<"\n";
56  }
58  } else
60  }
61  // Use push_back instead of insert in order to gain time
62  trajectoryPoints_.push_back(trajPt);
63 
64  // cout<<"adding point "<<*this<<endl;
65 }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:136
bool isTrackerLayer() const
is this point corresponding to an intersection with a tracker layer ?
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:142
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:139
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
void PFTrack::calculatePositionREP ( )

calculate posrep_ once and for all for each point

Definition at line 68 of file PFTrack.cc.

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

68  {
69 
70  //for(unsigned i=0; i<trajectoryPoints_.size(); i++) {
71  // trajectoryPoints_[i].calculatePositionREP();
72  //}
73 }
double reco::PFTrack::charge ( ) const
inline
Returns
electric charge

Definition at line 87 of file PFTrack.h.

References charge_.

87 { return charge_; }
double charge_
charge
Definition: PFTrack.h:133
int reco::PFTrack::color ( ) const
inline

Definition at line 122 of file PFTrack.h.

References color_.

Referenced by cuy.plotElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), and setColor().

122 { return color_; }
int color_
color (transient)
Definition: PFTrack.h:145
const reco::PFTrajectoryPoint & PFTrack::extrapolatedPoint ( unsigned  layerid) const
Returns
an extrapolated point

Definition at line 76 of file PFTrack.cc.

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

Referenced by PFElecTkProducer::isSharingEcalEnergyWithEgSC(), ConvBremPFTrackFinder::runConvBremFinder(), GSFAndECALLinker::testLink(), HCALAndBREMLinker::testLink(), GSFAndHCALLinker::testLink(), ECALAndBREMLinker::testLink(), and LinkByRecHit::testTrackAndClusterByRecHit().

76  {
77  const unsigned offset_layerid = nTrajectoryMeasurements() + layerid;
78  if( layerid >= reco::PFTrajectoryPoint::NLayers ||
79  offset_layerid >= trajectoryPoints_.size() ) {
80 
81  // cout<<(*this)<<endl;
82  // cout<<"lid "<<layerid<<" "<<nTrajectoryMeasurements()<<" "<<trajectoryPoints_.size()<<endl;
83 
84  throw cms::Exception("SizeError")<<"PFRecTrack::extrapolatedPoint: cannot access "
85  <<layerid
86  <<" #traj meas = "<<nTrajectoryMeasurements()
87  <<" #traj points = "<<trajectoryPoints_.size()
88  <<endl
89  <<(*this);
90  // assert(0);
91  }
92  if (layerid < indexInnermost_)
93  return trajectoryPoints_[ layerid ];
94  else
95  return trajectoryPoints_[ offset_layerid ];
96 }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:136
unsigned int nTrajectoryMeasurements() const
Definition: PFTrack.h:94
unsigned int indexInnermost_
index innermost tracker measurement
Definition: PFTrack.h:139
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_.

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

Definition at line 94 of file PFTrack.h.

References indexInnermost_, and indexOutermost_.

Referenced by extrapolatedPoint().

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

Definition at line 90 of file PFTrack.h.

References trajectoryPoints_.

Referenced by CalibratableTest::analyze().

91  { return trajectoryPoints_.size(); }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:136
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_.

117  { return trajectoryPoints_.begin() + indexOutermost_; }
std::vector< reco::PFTrajectoryPoint > trajectoryPoints_
vector of trajectory points
Definition: PFTrack.h:136
unsigned int indexOutermost_
index outermost tracker measurement
Definition: PFTrack.h:142
void reco::PFTrack::setColor ( int  color)
inline

Definition at line 120 of file PFTrack.h.

References color(), and color_.

120 {color_ = color;}
int color() const
Definition: PFTrack.h:122
int color_
color (transient)
Definition: PFTrack.h:145
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 cmsHarvester::index, and trajectoryPoints_.

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

Definition at line 102 of file PFTrack.h.

References cmsHarvester::index, and trajectoryPoints_.

Referenced by CalibratableTest::analyze(), and CalibratableTest::findCandidatesInDeltaR().

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

Definition at line 98 of file PFTrack.h.

References trajectoryPoints_.

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

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFTrack track 
)
friend

Member Data Documentation

double reco::PFTrack::charge_
protected

charge

Definition at line 133 of file PFTrack.h.

Referenced by charge().

int reco::PFTrack::color_
protected

color (transient)

Definition at line 145 of file PFTrack.h.

Referenced by color(), and setColor().

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
staticprotected

maximal number of tracking layers

Definition at line 130 of file PFTrack.h.

Referenced by PFTrack().

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