Weighted Fit
This is to make it possible to perform linear regression taking into account the resolution of each data point.
The effect is as follows: Suppose there is a hit in MM05, MM06 and ST11 with a resolution of 0.06 mm, 0.05 mm and 0.8 mm respectively, and suppose the particle has a direction of (0,0,1). For simplicity, suppose the position in MM05 and MM06 was measured as (0,0) in the 2D plane, and in ST11 as (10,0). This is an exaggerated scenario to demonstrate the introduced deviation of the trajectory that logically should be (0,0,1). Then a linear regression would return following fitted values at the respective z positions for the following two scenarios:
-
Currently (all points have weight 1):
One sees directly an implied direction that is far from (0,0,1). -
With the new initialiser, where each hit is weighted by
1/resTracker^2(works without disturbing established code):
It is not realistic to treat the ST11 hit with the same weight as the other two hits from MM05 and MM06 due to a difference in resolution of a factor ~10. Introducing the weights (standard 1/res^2 approach), the fit is much more robust against treating hits from different tracker types and more likely to reproduce the true trajectory.
How to invoke
Simply use the vector<pair<TVector3,double>> vector used in all of tracking to initialise PCALinReg instead of vector<Eigen::Vector3d> object.
Why this is important
In muon mode, this class is used to perform the pre-fit, with which we obtain the seeds for initial direction and momentum and also use to perform a rudimentary identification of physical track candidates. Fits that are heavily biased due to not considering respective hit resolutions will lead to incompatibilities with the reconstructed tracks as obtained by GenFit.

