How to fit a Trajectory




To fit a trajectory we should make sure that the fitting service has been properly initialized by selecting the appropriate fitting method and fitting representation.

// select the Kalman Filter fitter
manager.fitting_svc().select_fitter(RP::kalman);

// select the slopes_curv_z fitting representation (x,y,x,dx/z,dy/dz,q/p)
manager.fitting_svc().set_fitting_representation(RP::slopes_curv_z);


Some fitters as the Kalman Filter have also some options that can be changed. The code below fits a Trajectory provided the Trajectory and a seed State

// fit a trajectory provided a seed state
bool ok = manager.fitting_svc().fit(seed, traj);


where the seed State and the Trajectory has been created previously.