LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
trkf::KHitTrack Class Reference

#include "KHitTrack.h"

Inheritance diagram for trkf::KHitTrack:
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

 KHitTrack ()
 Default constructor. More...
 
 KHitTrack (const KFitTrack &trf, const std::shared_ptr< const KHitBase > &hit)
 Initializing constructor - KFitTrack + measurement. More...
 
 KHitTrack (const KETrack &tre)
 Initializing constructor - KETrack. More...
 
virtual ~KHitTrack ()
 Destructor. More...
 
const std::shared_ptr< const KHitBase > & getHit () const
 Measurement. More...
 
void setHit (const std::shared_ptr< const KHitBase > &hit)
 Set 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...
 
std::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::shared_ptr< const KHitBasefHit
 Measurement. More...
 

Detailed Description

Definition at line 34 of file KHitTrack.h.

Member Enumeration Documentation

Fit status enum.

Enumerator
INVALID 
UNKNOWN 
FORWARD 
FORWARD_PREDICTED 
BACKWARD 
BACKWARD_PREDICTED 
OPTIMAL 
OPTIMAL_PREDICTED 

Definition at line 39 of file KFitTrack.h.

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

Constructor & Destructor Documentation

trkf::KHitTrack::KHitTrack ( )

Default constructor.

Definition at line 16 of file KHitTrack.cxx.

16 {}
trkf::KHitTrack::KHitTrack ( const KFitTrack trf,
const std::shared_ptr< const KHitBase > &  hit 
)

Initializing constructor - KFitTrack + measurement.

Initializing constructor - KFitTrack + measurement.

Arguments:

trf - KFitTrack. hit - Measurement.

Definition at line 25 of file KHitTrack.cxx.

26  : KFitTrack(trf), fHit(hit)
27  {}
std::shared_ptr< const KHitBase > fHit
Measurement.
Definition: KHitTrack.h:65
Detector simulation of raw signals on wires.
KFitTrack()
Default constructor.
Definition: KFitTrack.cxx:17
trkf::KHitTrack::KHitTrack ( const KETrack tre)

Initializing constructor - KETrack.

Initializing constructor - KETrack.

Arguments:

tre - KETrack.

Definition at line 35 of file KHitTrack.cxx.

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

Destructor.

Definition at line 38 of file KHitTrack.cxx.

38 {}

Member Function Documentation

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

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

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

65  {
67  if (fSurf.get() != 0) result = fSurf->getDirection(fVec, fDir);
68  return result;
69  }
TrackVector fVec
Track state vector.
Definition: KTrack.h:91
TrackDirection
Track direction enum.
Definition: Surface.h:54
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:90
Surface::TrackDirection fDir
Track direction.
Definition: KTrack.h:92
TrackError& trkf::KETrack::getError ( )
inlineinherited

Modifiable error matrix.

Definition at line 57 of file KETrack.h.

References trkf::KETrack::fErr.

const std::shared_ptr<const KHitBase>& trkf::KHitTrack::getHit ( ) const
inline
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 201 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().

202  {
203  if (!isValid())
204  throw cet::exception("KTrack") << "Momentum vector requested for invalid track.\n";
206  fSurf->getMomentum(fVec, mom, dir);
207  }
TrackVector fVec
Track state vector.
Definition: KTrack.h:91
TrackDirection
Track direction enum.
Definition: Surface.h:54
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:90
TDirectory * dir
Definition: macro.C:5
Surface::TrackDirection getDirection() const
Track direction.
Definition: KTrack.cxx:64
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:81
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 157 of file KTrack.cxx.

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

Referenced by trkf::KGTrack::fillTrack(), trkf::InteractGeneral::noise(), trkf::PropYZLine::origin_vec_prop(), trkf::PropXYZPlane::origin_vec_prop(), trkf::PropYZPlane::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().

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

Modifiable state vector.

Definition at line 61 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 81 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().

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

Based on pdg code.

Particle mass based on pdg code.

Definition at line 116 of file KTrack.cxx.

References util::abs(), and 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().

117  {
118  double mass = 0.;
119  int apdg = std::abs(fPdgCode);
120 
121  // Muon
122 
123  if (apdg == 13) mass = mumass;
124 
125  // Charged pion
126 
127  else if (apdg == 211)
128  mass = pimass;
129 
130  // Charged kaon
131 
132  else if (apdg == 321)
133  mass = kmass;
134 
135  // (Anti)proton
136 
137  else if (apdg == 2212)
138  mass = pmass;
139 
140  // Anything else throw exception
141 
142  else
143  throw cet::exception("KTrack") << "Mass requested for invalid pdg id = " << fPdgCode << "\n";
144 
145  // Done.
146 
147  return mass;
148  }
constexpr auto abs(T v)
Returns the absolute value of the argument.
int fPdgCode
Pdg id. hypothesis.
Definition: KTrack.h:93
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
int trkf::KTrack::PdgCode ( ) const
inlineinherited

Pdg code.

Definition at line 56 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 66 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().

67  {
68  if (!isValid())
69  throw cet::exception("KETrack") << "Pointing error requested for invalid track.\n";
70  return getSurface()->PointingError(getVector(), fErr);
71  }
const std::shared_ptr< const Surface > & getSurface() const
Surface.
Definition: KTrack.h:53
const TrackVector & getVector() const
Track state vector.
Definition: KTrack.h:54
TrackError fErr
Track error matrix.
Definition: KETrack.h:69
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:81
std::ostream & trkf::KHitTrack::Print ( std::ostream &  out,
bool  doTitle = true 
) const
virtual

Printout.

Reimplemented from trkf::KFitTrack.

Definition at line 41 of file KHitTrack.cxx.

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

Referenced by setHit().

42  {
43  if (doTitle) out << "KHitTrack:\n";
44 
45  // Print base class.
46 
47  KFitTrack::Print(out, false);
48 
49  // Print information specific to this class.
50 
51  if (fHit.get() != 0) out << " " << *fHit;
52  return out;
53  }
std::shared_ptr< const KHitBase > fHit
Measurement.
Definition: KHitTrack.h:65
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Definition: KFitTrack.cxx:113
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::KHitTrack::setHit ( const std::shared_ptr< const KHitBase > &  hit)
inline

Set measurement.

Definition at line 56 of file KHitTrack.h.

References fHit, and Print().

56 { fHit = hit; }
std::shared_ptr< const KHitBase > fHit
Measurement.
Definition: KHitTrack.h:65
Detector simulation of raw signals on wires.
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 169 of file KTrack.cxx.

References trkf::KTrack::getMomentum().

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

170  {
171  double mom[3];
172  getMomentum(mom);
173  double ptx = std::sqrt(mom[1] * mom[1] + mom[2] * mom[2]);
174  double result = 0.;
175  if (ptx > 0. || mom[0] > 0.) result = atan2(mom[0], ptx);
176  return result;
177  }
void getMomentum(double mom[3]) const
Get momentum vector of track.
Definition: KTrack.cxx:201
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 185 of file KTrack.cxx.

References trkf::KTrack::getMomentum().

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

186  {
187  double mom[3];
188  getMomentum(mom);
189  double result = 0.;
190  if (mom[1] != 0. || mom[2] != 0.) result = atan2(mom[1], mom[2]);
191  return result;
192  }
void getMomentum(double mom[3]) const
Get momentum vector of track.
Definition: KTrack.cxx:201

Member Data Documentation

std::shared_ptr<const KHitBase> trkf::KHitTrack::fHit
private

Measurement.

Definition at line 65 of file KHitTrack.h.

Referenced by getHit(), Print(), and setHit().


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