LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
trkf::KHitsTrack Class Reference

#include "KHitsTrack.h"

Inheritance diagram for trkf::KHitsTrack:
trkf::KFitTrack trkf::KETrack trkf::KTrack

Public Types

enum  FitStatus {
  INVALID, UNKNOWN, FORWARD, FORWARD_PREDICTED,
  BACKWARD, BACKWARD_PREDICTED, OPTIMAL, OPTIMAL_PREDICTED
}
 Fit status enum. More...
 

Public Member Functions

 KHitsTrack ()
 Default constructor. More...
 
 KHitsTrack (const KFitTrack &trf)
 Initializing constructor - KFitTrack. More...
 
 KHitsTrack (const KETrack &tre)
 Initializing constructor - KETrack. More...
 
virtual ~KHitsTrack ()
 Destructor. More...
 
const std::vector< std::shared_ptr< const KHitBase > > & getHits ()
 Measurement collection. More...
 
void addHit (const std::shared_ptr< const KHitBase > &hit)
 Add a measurement. More...
 
virtual std::ostream & Print (std::ostream &out, bool doTitle=true) const
 Printout. More...
 
double getPath () const
 Propagation distance. More...
 
double getChisq () const
 Fit chisquare. More...
 
FitStatus getStat () const
 Fit status. More...
 
void setPath (double path)
 Set propagation distance. More...
 
void setChisq (double chisq)
 Set chisquare. More...
 
void setStat (FitStatus stat)
 Set fit status. More...
 
bool combineFit (const KFitTrack &trf)
 Combine two tracks. More...
 
const TrackErrorgetError () const
 Track error matrix. More...
 
TrackErrorgetError ()
 Modifiable error matrix. More...
 
double PointingError () const
 Pointing error (radians). More...
 
void setError (const TrackError &err)
 Set error matrix. More...
 
boost::optional< double > combineTrack (const KETrack &tre)
 Combine two tracks. More...
 
const std::shared_ptr< const Surface > & getSurface () const
 Surface. More...
 
const TrackVectorgetVector () const
 Track state vector. More...
 
TrackVectorgetVector ()
 Modifiable state vector. More...
 
Surface::TrackDirection getDirection () const
 Track direction. More...
 
int PdgCode () const
 Pdg code. More...
 
double Mass () const
 Based on pdg code. More...
 
void setSurface (const std::shared_ptr< const Surface > &psurf)
 Set surface. More...
 
void setVector (const TrackVector &vec)
 Set state vector. More...
 
void setDirection (Surface::TrackDirection dir)
 Set direction. More...
 
void setPdgCode (int pdg)
 Set pdg code. More...
 
bool isValid () const
 Test if track is valid. More...
 
void getPosition (double xyz[3]) const
 Get position of track. More...
 
void getMomentum (double mom[3]) const
 Get momentum vector of track. More...
 
double XLatitude () const
 Get x-latitude. More...
 
double XLongitude () const
 Get x-longitude. More...
 

Private Attributes

std::vector< std::shared_ptr< const KHitBase > > fHits
 Measurement collection. More...
 

Detailed Description

Definition at line 35 of file KHitsTrack.h.

Member Enumeration Documentation

Fit status enum.

Enumerator
INVALID 
UNKNOWN 
FORWARD 
FORWARD_PREDICTED 
BACKWARD 
BACKWARD_PREDICTED 
OPTIMAL 
OPTIMAL_PREDICTED 

Definition at line 41 of file KFitTrack.h.

41  {
42  INVALID, // No valid fit information.
43  UNKNOWN, // Unknown.
44  FORWARD, // Fit based on past measurements, including current surface.
45  FORWARD_PREDICTED, // Fit based on past measurements, not including current surface.
46  BACKWARD, // Fit based on future measurements, including current surface.
47  BACKWARD_PREDICTED, // Fit based on future measurements, not including current surface.
48  OPTIMAL, // Fit based on all measurements, including current surface.
49  OPTIMAL_PREDICTED // Fit based on all measurements, except current surface.
50  };

Constructor & Destructor Documentation

trkf::KHitsTrack::KHitsTrack ( )

Default constructor.

Definition at line 16 of file KHitsTrack.cxx.

17  {}
trkf::KHitsTrack::KHitsTrack ( const KFitTrack trf)

Initializing constructor - KFitTrack.

Initializing constructor - KFitTrack.

Arguments:

trf - KFitTrack.

Definition at line 25 of file KHitsTrack.cxx.

25  :
26  KFitTrack(trf)
27  {}
KFitTrack()
Default constructor.
Definition: KFitTrack.cxx:17
trkf::KHitsTrack::KHitsTrack ( const KETrack tre)

Initializing constructor - KETrack.

Initializing constructor - KETrack.

Arguments:

tre - KETrack.

Definition at line 35 of file KHitsTrack.cxx.

35  :
36  KFitTrack(tre)
37  {}
KFitTrack()
Default constructor.
Definition: KFitTrack.cxx:17
trkf::KHitsTrack::~KHitsTrack ( )
virtual

Destructor.

Definition at line 40 of file KHitsTrack.cxx.

41  {}

Member Function Documentation

void trkf::KHitsTrack::addHit ( const std::shared_ptr< const KHitBase > &  hit)
inline

Add a measurement.

Definition at line 59 of file KHitsTrack.h.

References fHits, and Print().

59 {fHits.push_back(hit);}
Detector simulation of raw signals on wires.
std::vector< std::shared_ptr< const KHitBase > > fHits
Measurement collection.
Definition: KHitsTrack.h:69
bool trkf::KFitTrack::combineFit ( const KFitTrack trf)
inherited

Combine two tracks.

Combine two tracks.

Arguments:

trf - Another track.

Returns: True if success.

This method updates the current track to be the weighted average of itself and another track. Track parameters and error matrix are updated by method KETrack::combineTrack. The updated chissquare is the sum of the original chisquare, the chisquare from the other track, and the chisquare of the combination. The path distance is not updated.

The updated status is derived from the input status according to the following table.

FORWARD + BACKWARD_PREDICTED = OPTIMAL FORWARD_PREDICTED + BACKWARD = OPTIMAL FORWARD_PREDICTED + BACKWARD_PREDICTED = OPTIMAL_PREDICTED

Any other combination of input statuses will cause this method to return failure. This method can also return failure because of singular error matrices. In case of failure, the original track is not updated.

The two tracks being combined should be on the same surface (throw exception if not).

Definition at line 76 of file KFitTrack.cxx.

References trkf::KFitTrack::BACKWARD, trkf::KFitTrack::BACKWARD_PREDICTED, trkf::KETrack::combineTrack(), trkf::KFitTrack::fChisq, trkf::KFitTrack::FORWARD, trkf::KFitTrack::FORWARD_PREDICTED, trkf::KFitTrack::fStat, trkf::KFitTrack::getChisq(), trkf::KFitTrack::getStat(), trkf::KTrack::getSurface(), trkf::KFitTrack::OPTIMAL, trkf::KFitTrack::OPTIMAL_PREDICTED, and trkf::KFitTrack::UNKNOWN.

Referenced by trkf::KFitTrack::setStat(), and trkf::KalmanFilterAlg::smoothTrack().

77  {
78  // Make sure that the two track surfaces are the same.
79  // Throw an exception if they are not.
80 
81  if(!getSurface()->isEqual(*trf.getSurface()))
82  throw cet::exception("KFitTrack") << "Track combination surfaces are not the same.\n";
83 
84  // Default result failure.
85 
86  bool result = false;
87 
88  // Make sure input statuses are compatible and figure out the
89  // updated status.
90 
91  FitStatus stat1 = getStat();
92  FitStatus stat2 = trf.getStat();
93  FitStatus statu = UNKNOWN;
94  if((stat1 == FORWARD && stat2 == BACKWARD_PREDICTED) ||
95  (stat1 == FORWARD_PREDICTED && stat2 == BACKWARD) ||
96  (stat1 == BACKWARD && stat2 == FORWARD_PREDICTED) ||
97  (stat1 == BACKWARD_PREDICTED && stat2 == FORWARD))
98  statu = OPTIMAL;
99  else if(stat1 == FORWARD_PREDICTED && stat2 == BACKWARD_PREDICTED)
100  statu = OPTIMAL_PREDICTED;
101  else
102  statu = UNKNOWN;
103  if(statu != UNKNOWN) {
104 
105  // Update track parameters and error matrix.
106 
107  boost::optional<double> chisq = combineTrack(trf);
108 
109  // Update status and chisquare.
110 
111  if(!!chisq) {
112  result = true;
113  fStat = statu;
114  fChisq = fChisq + trf.getChisq() + *chisq;
115  }
116  }
117 
118  // Done.
119 
120  return result;
121  }
const std::shared_ptr< const Surface > & getSurface() const
Surface.
Definition: KTrack.h:55
FitStatus
Fit status enum.
Definition: KFitTrack.h:41
boost::optional< double > combineTrack(const KETrack &tre)
Combine two tracks.
Definition: KETrack.cxx:95
FitStatus fStat
Fit status.
Definition: KFitTrack.h:88
double fChisq
Fit chisquare.
Definition: KFitTrack.h:87
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
FitStatus getStat() const
Fit status.
Definition: KFitTrack.h:68
boost::optional< double > trkf::KETrack::combineTrack ( const KETrack tre)
inherited

Combine two tracks.

Combine two tracks.

Arguments:

tre - Another track.

Returns: Chisquare + success flag.

This method updates the current track to be the weighted average of itself and another track. The chisquare of the combination is returned as the result value. The combination can fail because the sum of the two error matrices is singular, in which case the success flag embedded in the return value is false.

Definition at line 95 of file KETrack.cxx.

References trkf::KETrack::getError(), trkf::KTrack::getSurface(), trkf::KTrack::getVector(), trkf::KTrack::isValid(), trkf::KETrack::setError(), trkf::KTrack::setVector(), and trkf::syminvert().

Referenced by trkf::KFitTrack::combineFit(), and trkf::KETrack::setError().

96  {
97  // Make sure that the two track surfaces are the same.
98  // Throw an exception if they are not.
99 
100  if(!getSurface()->isEqual(*tre.getSurface()))
101  throw cet::exception("KETrack") << "Track combination surfaces are not the same.\n";
102 
103  // Default result is failure.
104 
105  boost::optional<double> result(false, 0.);
106 
107  // We will use asymmetric versions of the updating formulas, such
108  // that the result is calculated as a perturbation on the
109  // better-measured track. We define the better measured track as
110  // the one with the smaller error matrix trace.
111 
112  // Extract the two state vectors and error matrices as pointers.
113 
114  const TrackVector* vec1 = &getVector();
115  const TrackError* err1 = &getError();
116  const TrackVector* vec2 = &tre.getVector();
117  const TrackError* err2 = &tre.getError();
118 
119  // Calculate the traces of the error matrices.
120 
121  double tr1 = 0;
122  for(unsigned int i=0; i<err1->size1(); ++i)
123  tr1 += (*err1)(i,i);
124 
125  double tr2 = 0;
126  for(unsigned int i=0; i<err2->size1(); ++i)
127  tr2 += (*err2)(i,i);
128 
129  // Define vec1, err1 as belong to the better measured track.
130  // Swap if necessary.
131 
132  if(tr1 > tr2) {
133  const TrackVector* tvec = vec1;
134  vec1 = vec2;
135  vec2 = tvec;
136  const TrackError* terr = err1;
137  err1 = err2;
138  err2 = terr;
139  }
140 
141  // Calculate the difference vector and difference error matrix.
142 
143  TrackVector dvec = *vec1 - *vec2;
144  TrackError derr = *err1 + *err2;
145 
146  // Invert the difference error matrix.
147  // This is the only place where a detectable failure can occur.
148 
149  bool ok = syminvert(derr);
150  if(ok) {
151 
152  // Calculate updated state vector.
153  // vec1 = vec1 - err1 * derr * dvec
154 
155  TrackVector tvec1 = prod(derr, dvec);
156  TrackVector tvec2 = prod(*err1, tvec1);
157  TrackVector tvec3 = *vec1 - tvec2;
158  setVector(tvec3);
159 
160  // Calculate updated error matrix.
161  // err1 = err1 - err1 * derr * err1
162 
163  TrackMatrix terr1 = prod(derr, *err1);
164  TrackMatrix terr2 = prod(*err1, terr1);
165  TrackError terr2s = ublas::symmetric_adaptor<TrackMatrix>(terr2);
166  TrackError terr3 = *err1 - terr2s;
167  setError(terr3);
168 
169  // Calculate chisquare.
170  // chisq = dvec^T * derr * dvec
171 
172  TrackVector dvec1 = prod(derr, dvec);
173  double chisq = inner_prod(dvec, dvec1);
174  result = boost::optional<double>(true, chisq);
175  }
176 
177  // Final validity check.
178 
179  if(!isValid())
180  result = boost::optional<double>(false, 0.);
181 
182  // Done.
183 
184  return result;
185  }
const TrackError & getError() const
Track error matrix.
Definition: KETrack.h:54
const std::shared_ptr< const Surface > & getSurface() const
Surface.
Definition: KTrack.h:55
KSymMatrix< 5 >::type TrackError
Track error matrix, dimension 5x5.
void setVector(const TrackVector &vec)
Set state vector.
Definition: KTrack.h:67
void setError(const TrackError &err)
Set error matrix.
Definition: KETrack.h:60
bool syminvert(ublas::symmetric_matrix< T, TRI, L, A > &m)
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
const TrackVector & getVector() const
Track state vector.
Definition: KTrack.h:56
KMatrix< 5, 5 >::type TrackMatrix
General 5x5 matrix.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:90
Surface::TrackDirection trkf::KTrack::getDirection ( ) const
inherited

Track direction.

Track direction accessor. Track direction implied by track parameters has precedence over track direction attribute. If the surface pointer is null, return UNKNOWN.

Definition at line 72 of file KTrack.cxx.

References trkf::KTrack::fDir, trkf::KTrack::fSurf, trkf::KTrack::fVec, and trkf::Surface::UNKNOWN.

Referenced by trkf::KTrack::getMomentum(), trkf::KTrack::getVector(), trkf::KTrack::isValid(), trkf::Propagator::lin_prop(), trkf::InteractPlane::noise(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::PropXYZPlane::short_vec_prop().

73  {
75  if(fSurf.get() != 0)
76  result = fSurf->getDirection(fVec, fDir);
77  return result;
78  }
TrackVector fVec
Track state vector.
Definition: KTrack.h:94
TrackDirection
Track direction enum.
Definition: Surface.h:56
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:93
Surface::TrackDirection fDir
Track direction.
Definition: KTrack.h:95
TrackError& trkf::KETrack::getError ( )
inlineinherited

Modifiable error matrix.

Definition at line 59 of file KETrack.h.

References trkf::KETrack::fErr.

const std::vector<std::shared_ptr<const KHitBase> >& trkf::KHitsTrack::getHits ( )
inline

Measurement collection.

Definition at line 54 of file KHitsTrack.h.

References fHits.

54 {return fHits;}
std::vector< std::shared_ptr< const KHitBase > > fHits
Measurement collection.
Definition: KHitsTrack.h:69
void trkf::KTrack::getMomentum ( double  mom[3]) const
inherited

Get momentum vector of track.

Get momentum vector of track. Throw an exception if track is not valid.

Arguments:

mom - Momentum vector of track.

Definition at line 217 of file KTrack.cxx.

References dir, trkf::KTrack::fSurf, trkf::KTrack::fVec, trkf::KTrack::getDirection(), and trkf::KTrack::isValid().

Referenced by trkf::KGTrack::fillTrack(), trkf::InteractGeneral::noise(), trkf::KTrack::Print(), trkf::KGTrack::Print(), trkf::Track3DKalmanHitAlg::qualityCutsOnSeedTrack(), trkf::KTrack::setPdgCode(), trkf::Propagator::vec_prop(), trkf::KTrack::XLatitude(), and trkf::KTrack::XLongitude().

218  {
219  if(!isValid())
220  throw cet::exception("KTrack") << "Momentum vector requested for invalid track.\n";
222  fSurf->getMomentum(fVec, mom, dir);
223  }
TrackVector fVec
Track state vector.
Definition: KTrack.h:94
TrackDirection
Track direction enum.
Definition: Surface.h:56
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:93
TDirectory * dir
Definition: macro.C:5
Surface::TrackDirection getDirection() const
Track direction.
Definition: KTrack.cxx:72
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:90
double trkf::KFitTrack::getPath ( ) const
inlineinherited
void trkf::KTrack::getPosition ( double  xyz[3]) const
inherited

Get position of track.

Get position of track. Throw an exception if track is not valid.

Arguments:

xyz - Position vector.

Definition at line 170 of file KTrack.cxx.

References trkf::KTrack::fSurf, trkf::KTrack::fVec, and trkf::KTrack::isValid().

Referenced by trkf::KGTrack::fillTrack(), trkf::InteractGeneral::noise(), trkf::PropYZPlane::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::KTrack::Print(), trkf::KGTrack::Print(), trkf::KTrack::setPdgCode(), trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), and trkf::Propagator::vec_prop().

171  {
172  if(!isValid())
173  throw cet::exception("KTrack") << "Position requested for invalid track.\n";
174  fSurf->getPosition(fVec, xyz);
175  }
TrackVector fVec
Track state vector.
Definition: KTrack.h:94
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:93
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:90
TrackVector& trkf::KTrack::getVector ( )
inlineinherited

Modifiable state vector.

Definition at line 63 of file KTrack.h.

References trkf::KTrack::fVec.

bool trkf::KTrack::isValid ( ) const
inherited

Test if track is valid.

Test if track is valid.

A default-constructed or partially-constructed track, is invalid by virtue of having an unknown propagation direction or a null surface pointer.

Tracks can become invaliddynamically for other reasons. This method also does the following checks: a) Check for invalid floating point values (inf and nan). b) Surface-dependent checks via virtual method Surface::isTrackValid.

Definition at line 90 of file KTrack.cxx.

References trkf::KTrack::fSurf, trkf::KTrack::fVec, trkf::KTrack::getDirection(), geo::vect::isfinite(), and trkf::Surface::UNKNOWN.

Referenced by trkf::KGTrack::addTrack(), trkf::KalmanFilterAlg::buildTrack(), trkf::KETrack::combineTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KTrack::getMomentum(), trkf::KTrack::getPosition(), trkf::Propagator::lin_prop(), trkf::PropYZLine::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZPlane::origin_vec_prop(), trkf::KETrack::PointingError(), trkf::KTrack::setPdgCode(), and trkf::KalmanFilterAlg::smoothTrack().

91  {
92  bool result = true;
93 
94  // Check for valid direction.
95 
97  result = false;
98 
99  // Check for non-null surface pointer (for safety, should be redundant
100  // with previous check.
101 
102  if(result && fSurf.get() == 0)
103  result = false;
104 
105  // Check for track parameters containing invalid floating point
106  // values.
107 
108  if(result) {
109  for(unsigned int i=0; i<fVec.size(); ++i) {
110  if(!std::isfinite(fVec(i))) {
111  result = false;
112  break;
113  }
114  }
115  }
116 
117  // Surface-dependent check on track validity.
118 
119  if(result && !fSurf->isTrackValid(fVec))
120  result = false;
121 
122  // Done.
123 
124  return result;
125  }
TrackVector fVec
Track state vector.
Definition: KTrack.h:94
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:93
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
Surface::TrackDirection getDirection() const
Track direction.
Definition: KTrack.cxx:72
double trkf::KTrack::Mass ( ) const
inherited

Based on pdg code.

Particle mass based on pdg code.

Definition at line 128 of file KTrack.cxx.

References trkf::KTrack::fPdgCode.

Referenced by trkf::KalmanFilterAlg::fitMomentumMS(), trkf::InteractPlane::noise(), trkf::KTrack::PdgCode(), trkf::PropYZLine::short_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::Propagator::vec_prop().

129  {
130  double mass = 0.;
131  int apdg = std::abs(fPdgCode);
132 
133  // Muon
134 
135  if(apdg == 13)
136  mass = mumass;
137 
138  // Charged pion
139 
140  else if(apdg == 211)
141  mass = pimass;
142 
143  // Charged kaon
144 
145  else if(apdg == 321)
146  mass = kmass;
147 
148  // (Anti)proton
149 
150  else if(apdg == 2212)
151  mass = pmass;
152 
153  // Anything else throw exception
154 
155  else
156  throw cet::exception("KTrack") << "Mass requested for invalid pdg id = " << fPdgCode << "\n";
157 
158  // Done.
159 
160  return mass;
161  }
int fPdgCode
Pdg id. hypothesis.
Definition: KTrack.h:96
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
int trkf::KTrack::PdgCode ( ) const
inlineinherited

Pdg code.

Definition at line 58 of file KTrack.h.

References trkf::KTrack::fPdgCode, and trkf::KTrack::Mass().

double trkf::KETrack::PointingError ( ) const
inherited

Pointing error (radians).

Calculate track pointing error (sigma, in radians).

This method calculates a single pointing error (sigma, in radians) based on the track parameters and error matrix. The actual calculation is done by the similarly names method of the surface class, since this class doesn't know what the track parameters mean.

Definition at line 74 of file KETrack.cxx.

References trkf::KETrack::fErr, trkf::KTrack::getSurface(), trkf::KTrack::getVector(), and trkf::KTrack::isValid().

Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KETrack::getError(), and trkf::KETrack::Print().

75  {
76  if(!isValid())
77  throw cet::exception("KETrack") << "Pointing error requested for invalid track.\n";
78  return getSurface()->PointingError(getVector(), fErr);
79  }
const std::shared_ptr< const Surface > & getSurface() const
Surface.
Definition: KTrack.h:55
const TrackVector & getVector() const
Track state vector.
Definition: KTrack.h:56
TrackError fErr
Track error matrix.
Definition: KETrack.h:72
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:90
std::ostream & trkf::KHitsTrack::Print ( std::ostream &  out,
bool  doTitle = true 
) const
virtual

Printout.

Reimplemented from trkf::KFitTrack.

Definition at line 44 of file KHitsTrack.cxx.

References fHits, and trkf::KFitTrack::Print().

Referenced by addHit().

45  {
46  if(doTitle)
47  out << "KHitsTrack:\n";
48 
49  // Print information specific to this class.
50 
51  out << " " << fHits.size() << " hits.\n";
52 
53  // Print base class.
54 
55  KFitTrack::Print(out, false);
56  return out;
57  }
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Definition: KFitTrack.cxx:124
std::vector< std::shared_ptr< const KHitBase > > fHits
Measurement collection.
Definition: KHitsTrack.h:69
void trkf::KFitTrack::setChisq ( double  chisq)
inlineinherited
void trkf::KTrack::setDirection ( Surface::TrackDirection  dir)
inlineinherited
void trkf::KETrack::setError ( const TrackError err)
inlineinherited
void trkf::KFitTrack::setPath ( double  path)
inlineinherited
void trkf::KTrack::setPdgCode ( int  pdg)
inlineinherited
void trkf::KFitTrack::setStat ( FitStatus  stat)
inlineinherited
void trkf::KTrack::setSurface ( const std::shared_ptr< const Surface > &  psurf)
inlineinherited
double trkf::KTrack::XLatitude ( ) const
inherited

Get x-latitude.

Get x-latitude.

The x-latitude is the latitude defined with respect to the x-axis. The x-latitude is zero of the track is traveling parallel to the wire planes.

Definition at line 183 of file KTrack.cxx.

References trkf::KTrack::getMomentum().

Referenced by trkf::KTrack::Print(), and trkf::KTrack::setPdgCode().

184  {
185  double mom[3];
186  getMomentum(mom);
187  double ptx = std::sqrt(mom[1]*mom[1] + mom[2]*mom[2]);
188  double result = 0.;
189  if(ptx > 0. || mom[0] > 0.)
190  result = atan2(mom[0], ptx);
191  return result;
192  }
void getMomentum(double mom[3]) const
Get momentum vector of track.
Definition: KTrack.cxx:217
double trkf::KTrack::XLongitude ( ) const
inherited

Get x-longitude.

Get x-longitude.

The x-longitude is the longitude defined with respect to the y- and z-axes. The x-longitude is zero of the track is parallel to the z-axis in the yz-plane.

Definition at line 200 of file KTrack.cxx.

References trkf::KTrack::getMomentum().

Referenced by trkf::KTrack::Print(), and trkf::KTrack::setPdgCode().

201  {
202  double mom[3];
203  getMomentum(mom);
204  double result = 0.;
205  if(mom[1] != 0. || mom[2] != 0.)
206  result = atan2(mom[1], mom[2]);
207  return result;
208  }
void getMomentum(double mom[3]) const
Get momentum vector of track.
Definition: KTrack.cxx:217

Member Data Documentation

std::vector<std::shared_ptr<const KHitBase> > trkf::KHitsTrack::fHits
private

Measurement collection.

Definition at line 69 of file KHitsTrack.h.

Referenced by addHit(), getHits(), and Print().


The documentation for this class was generated from the following files: