Code optimizing Kalman Filter used for particle tracking.
Optimized parameters are Q and P matrices. Process Noise Covariance Matrix (Q) describes the uncertainty in the system model.
Measurement Noise Covariance Matrix (R) represents the uncertainty in the measurements.
There are two cases: linear movement (no magnetic filed present) and curve (magnetic field switched on).