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

Classes

class  CCTrackMaker
 
class  CosmicTracker
 
class  CosmicTrackerAlg
 
class  FeatureTracker
 
class  Geometric3DVertexFitter
 3D vertex fitter based on the geometric properties (start position, direction, covariance) of the tracks. More...
 
class  HitState
 Class for a measurement on a recob::tracking::Plane (plane defined by a wire and the drift direction). More...
 
class  InteractGeneral
 
class  Interactor
 
class  InteractPlane
 
class  KalmanFilterAlg
 
class  KalmanFilterFinalTrackFitter
 
class  KalmanFilterTrajectoryFitter
 
struct  KalmanInput
 
struct  KalmanOutput
 
class  KETrack
 
class  KFitTrack
 
class  KFTrackState
 Extension of a TrackState to perform KalmanFilter calculations. More...
 
struct  KGMatrix
 Kalman gain matrix, dimension 5xN. More...
 
class  KGTrack
 
class  KHit
 
class  KHitBase
 
class  KHitContainer
 
class  KHitContainerWireLine
 
class  KHitContainerWireX
 
class  KHitGroup
 
class  KHitMulti
 
class  KHitsTrack
 
class  KHitTrack
 
class  KHitWireLine
 
class  KHitWireX
 
struct  KHMatrix
 Kalman H-matrix, dimension Nx5. More...
 
struct  KMatrix
 General matrix, dimension NxM. More...
 
struct  KSymMatrix
 Symmetric matrix, dimension NxN. More...
 
class  KTrack
 
struct  KVector
 Define a shortened alias for ublas namespace. More...
 
class  LinFitAlg
 
class  MCSFitProducer
 Producer for TrajectoryMCSFitter. More...
 
class  PMAlgTrackMaker
 
class  PMAlgTrajFitter
 
class  Propagator
 
class  PropAny
 
class  PropXYZPlane
 
class  PropYZLine
 
class  PropYZPlane
 
class  SeedAna
 
class  SeedFinderAlgorithm
 
class  SeedFinderModule
 
struct  SortByWire
 
class  SpacePointAlg
 
class  SpacePointAna
 
class  SpacePointCheater
 
class  SpacePointFinder
 
class  SpacePts
 
class  StitchAlg
 
class  Surface
 
class  SurfLine
 
class  SurfPlane
 
class  SurfWireLine
 
class  SurfWireX
 
class  SurfXYZPlane
 
class  SurfYZLine
 
class  SurfYZPlane
 
class  TCTrack
 
class  Track3DKalman
 
class  Track3DKalmanHit
 
class  Track3DKalmanHitAlg
 
class  Track3DKalmanSPS
 
class  Track3Dreco
 
class  TrackAna
 
class  TrackCheater
 
class  TrackKalmanCheater
 
class  TrackKalmanFitter
 Fit tracks using Kalman Filter fit+smooth. More...
 
class  TrackLineFitAlg
 
class  TrackMomentumCalculator
 
class  TrackState
 Class for track parameters (and errors) defined on a recob::tracking::Plane. More...
 
class  TrackStatePropagator
 Class for propagation of a trkf::TrackState to a recob::tracking::Plane. More...
 
class  TrackStitcher
 
class  TrackTrajectoryAlg
 
class  TrajectoryMCSFitter
 Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Track or Trajectory. More...
 
class  VertexFitAlg
 
class  VertexFitter
 Module for fitting a vertex using the Geometric3DVertexFitter. More...
 
class  VertexWrapper
 Wrapper class to facilitate vertex production. More...
 

Typedefs

typedef KVector< 5 >::type TrackVector
 Track state vector, dimension 5. More...
 
typedef KSymMatrix< 5 >::type TrackError
 Track error matrix, dimension 5x5. More...
 
typedef KMatrix< 5, 5 >::type TrackMatrix
 General 5x5 matrix. More...
 
using SVector5 = recob::tracking::SVector5
 
using SVector6 = recob::tracking::SVector6
 
using SMatrix55 = recob::tracking::SMatrix55
 
using SMatrixSym55 = recob::tracking::SMatrixSym55
 
using SMatrixSym66 = recob::tracking::SMatrixSym66
 
using Plane = recob::tracking::Plane
 
using Point_t = recob::tracking::Point_t
 
using Vector_t = recob::tracking::Vector_t
 
using PropDirection = TrackStatePropagator::PropDirection
 
using SMatrixSym22 = recob::tracking::SMatrixSym22
 
using SVector2 = recob::tracking::SVector2
 
using SMatrixSym33 = recob::tracking::SMatrixSym33
 
using SVector3 = recob::tracking::SVector3
 
typedef std::vector< KalmanInputKalmanInputs
 
typedef art::PtrVector< recob::HitHits
 
typedef std::vector< std::reference_wrapper< const recob::Track > > TrackRefVec
 

Functions

template<class T , class TRI , class L , class A >
bool syminvert (ublas::symmetric_matrix< T, TRI, L, A > &m)
 
template<class T , class L , class A >
bool invert (ublas::matrix< T, L, A > &m)
 
template<class M >
M::value_type trace (const M &m)
 
std::ostream & operator<< (std::ostream &out, const KGTrack &trg)
 Output operator. More...
 
std::ostream & operator<< (std::ostream &out, const KHitBase &trk)
 Output operator. More...
 
void fill (const art::PtrVector< recob::Hit > &hits, int only_plane)
 
std::ostream & operator<< (std::ostream &out, const KTrack &trk)
 Output operator. More...
 
std::ostream & operator<< (std::ostream &out, const Surface &surf)
 Output operator. More...
 

Detailed Description

LinFitAlg class

Bruce Baller, balle.nosp@m.r@fn.nosp@m.al.go.nosp@m.v

Algorithm for fitting a 2D line

TrackLineFitAlg class

Bruce Baller, balle.nosp@m.r@fn.nosp@m.al.go.nosp@m.v

Algorithm for fitting a 3D line given a number of points in 3 wire planes

TrackTrajectoryAlg class

Bruce Baller, balle.nosp@m.r@fn.nosp@m.al.go.nosp@m.v

Algorithm fitting a 3D trajectory through a set of hits

VertexFitAlg class

Bruce Baller, balle.nosp@m.r@fn.nosp@m.al.go.nosp@m.v

Algorithm for fitting a 3D vertex given a set of track hits

Typedef Documentation

Definition at line 42 of file Track3DKalmanHit.h.

typedef std::vector<KalmanInput> trkf::KalmanInputs

Definition at line 41 of file Track3DKalmanHit.h.

Definition at line 17 of file TrackState.h.

Definition at line 18 of file TrackState.h.

Definition at line 14 of file TrackState.h.

Definition at line 15 of file TrackState.h.

Definition at line 16 of file TrackState.h.

Definition at line 30 of file Geometric3DVertexFitter.h.

Definition at line 32 of file Geometric3DVertexFitter.h.

Definition at line 12 of file TrackState.h.

Definition at line 13 of file TrackState.h.

Track error matrix, dimension 5x5.

Definition at line 92 of file KalmanLinearAlgebra.h.

typedef KMatrix<5, 5>::type trkf::TrackMatrix

General 5x5 matrix.

Definition at line 95 of file KalmanLinearAlgebra.h.

typedef std::vector<std::reference_wrapper<const recob::Track> > trkf::TrackRefVec

Definition at line 26 of file VertexWrapper.h.

Track state vector, dimension 5.

Definition at line 89 of file KalmanLinearAlgebra.h.

Definition at line 19 of file TrackState.h.

Function Documentation

template<class T , class L , class A >
bool trkf::invert ( ublas::matrix< T, L, A > &  m)

Invert general square matrix by LU decomposition with partial pivoting. Return false if singular or not square.

Definition at line 189 of file KalmanLinearAlgebra.h.

Referenced by util::flags::Bits_t< Storage_t >::clear(), export_G4RotationMatrix(), and trkf::InteractGeneral::noise().

190  {
191  // Make sure matrix is square.
192 
193  if (m.size1() != m.size2()) return false;
194 
195  // Create permutation matrix for pivoting.
196 
197  ublas::permutation_matrix<std::size_t> pm(m.size1());
198 
199  // Make temp copy of input matrix.
200 
201  ublas::matrix<T, L, A> mcopy(m);
202 
203  // Do LU factorization with partial pivoting.
204  // This step will fail if matrix is singular.
205 
206  int res = lu_factorize(mcopy, pm);
207  if (res != 0) return false;
208 
209  // Set original matrix to the identity matrix.
210 
211  m.assign(ublas::identity_matrix<T>(m.size1()));
212 
213  // Do backsubstitution.
214 
215  lu_substitute(mcopy, pm, m);
216 
217  // Done (success).
218 
219  return true;
220  }
std::ostream & trkf::operator<< ( std::ostream &  out,
const Surface surf 
)

Output operator.

Definition at line 22 of file Surface.cxx.

References trkf::Surface::Print().

23  {
24  return surf.Print(out);
25  }
std::ostream & trkf::operator<< ( std::ostream &  out,
const KHitBase trk 
)

Output operator.

Definition at line 44 of file KHitBase.cxx.

References trkf::KHitBase::Print().

45  {
46  return trk.Print(out);
47  }
std::ostream & trkf::operator<< ( std::ostream &  out,
const KTrack trk 
)

Output operator.

Definition at line 244 of file KTrack.cxx.

References trkf::KTrack::Print().

245  {
246  return trk.Print(out);
247  }
std::ostream & trkf::operator<< ( std::ostream &  out,
const KGTrack trg 
)

Output operator.

Definition at line 300 of file KGTrack.cxx.

References trkf::KGTrack::Print().

Referenced by trkf::Surface::getDirection().

301  {
302  return trg.Print(out);
303  }
template<class T , class TRI , class L , class A >
bool trkf::syminvert ( ublas::symmetric_matrix< T, TRI, L, A > &  m)

Invert symmetric matrix (return false if singular).

The method used is Cholesky decomposition. This method is efficient and stable for positive-definite matrices. In case the matrix is not positive-definite, this method will usually work, but there can be some numerical pathologies, including "false singular" failures, and numerical instability. In the Kalman filter, we expect that this method will be used exclusively for positive-definite matrices.

Definition at line 108 of file KalmanLinearAlgebra.h.

References sum.

Referenced by trkf::KETrack::combineTrack(), trkf::Track3DKalmanHitAlg::makeSeed(), trkf::KHitMulti::predict(), and trkf::KHit< N >::predict().

109  {
110  typedef typename ublas::symmetric_matrix<T, TRI, L, A>::size_type size_type;
111  typedef typename ublas::symmetric_matrix<T, TRI, L, A>::value_type value_type;
112 
113  // In situ Cholesky decomposition m = LDL^T.
114  // D is diagonal matrix.
115  // L is lower triangular with ones on the diagonal (ones not stored).
116 
117  for (size_type i = 0; i < m.size1(); ++i) {
118  for (size_type j = 0; j <= i; ++j) {
119 
120  value_type ele = m(i, j);
121 
122  for (size_type k = 0; k < j; ++k)
123  ele -= m(k, k) * m(i, k) * m(j, k);
124 
125  // Diagonal elements (can't have zeroes).
126 
127  if (i == j) {
128  if (ele == 0.) return false;
129  }
130 
131  // Off-diagonal elements.
132 
133  else
134  ele = ele / m(j, j);
135 
136  // Replace element.
137 
138  m(i, j) = ele;
139  }
140  }
141 
142  // In situ inversion of D by simple division.
143  // In situ inversion of L by back-substitution.
144 
145  for (size_type i = 0; i < m.size1(); ++i) {
146  for (size_type j = 0; j <= i; ++j) {
147 
148  value_type ele = m(i, j);
149 
150  // Diagonal elements.
151 
152  if (i == j) m(i, i) = 1. / ele;
153 
154  // Off diagonal elements.
155 
156  else {
157  value_type sum = -ele;
158  for (size_type k = j + 1; k < i; ++k)
159  sum -= m(i, k) * m(k, j);
160  m(i, j) = sum;
161  }
162  }
163  }
164 
165  // Recompose the inverse matrix in situ by matrix multiplication m = L^T DL.
166 
167  for (size_type i = 0; i < m.size1(); ++i) {
168  for (size_type j = 0; j <= i; ++j) {
169 
170  value_type sum = m(i, i);
171  if (i != j) sum *= m(i, j);
172 
173  for (size_type k = i + 1; k < m.size1(); ++k)
174  sum += m(k, k) * m(k, i) * m(k, j);
175 
176  m(i, j) = sum;
177  }
178  }
179 
180  // Done (success).
181 
182  return true;
183  }
Double_t sum
Definition: plot.C:31
template<class M >
M::value_type trkf::trace ( const M &  m)

Trace of matrix.

Definition at line 225 of file KalmanLinearAlgebra.h.

References n.

Referenced by trkf::KalmanFilterAlg::setTrace().

226  {
227  typename M::size_type n = std::min(m.size1(), m.size2());
228  typename M::value_type result = 0.;
229 
230  for (typename M::size_type i = 0; i < n; ++i)
231  result += m(i, i);
232 
233  return result;
234  }
Char_t n[5]