# Project CMSSW displayed by LXR

File indexing completed on 2024-04-06 12:21:48

```0001 #ifndef L1Trigger_TrackFindingTMTT_KFParamsComb_h
0002 #define L1Trigger_TrackFindingTMTT_KFParamsComb_h
0003
0004 #include "L1Trigger/TrackFindingTMTT/interface/KFbase.h"
0005 #include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h"
0006
0007 ///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm.
0008 ///===
0009 ///=== All variable names & equations come from Fruhwirth KF paper
0010 ///=== http://dx.doi.org/10.1016/0168-9002%2887%2990887-4
0011 ///===
0012 ///=== Summary of variables:
0013 ///=== m = hit position (phi,z)
0014 ///=== V = hit position 2x2 covariance matrix in (phi,z).
0015 ///=== x = helix params
0016 ///=== C = helix params 4x4 covariance matrix
0017 ///=== r = residuals
0018 ///=== H = 2x4 derivative matrix (expected stub position w.r.t. helix params)
0019 ///=== K = KF gain 2x2 matrix
0020 ///=== x' & C': Updated values of x & C after KF iteration
0021 ///=== Boring: F = unit matrix; pxcov = C
0022 ///===
0023 ///=== Summary of equations:
0024 ///=== S = H*C (2x4 matrix); St = Transpose S
0025 ///=== R = V + H*C*Ht (KF paper) = V + H*St (used here at simpler): 2x2 matrix
0026 ///=== Rinv = Inverse R
0027 ///=== K = St * Rinv : 2x2 Kalman gain matrix * det(R)
0028 ///=== r = m - H*x
0029 ///=== x' = x + K*r
0030 ///=== C' = C - K*H*C (KF paper) = C - K*S (used here as simpler)
0031 ///=== delta(chi2) = r(transpose) * Rinv * r : Increase in chi2 from new stub added during iteration.
0032
0033 namespace tmtt {
0034
0035   class KFParamsComb : public KFbase {
0036   public:
0037     KFParamsComb(const Settings* settings, const uint nHelixPar, const std::string& fitterName);
0038
0039     ~KFParamsComb() override = default;
0040
0041   protected:
0042     //--- Input data
0043
0044     // Seed track helix params & covariance matrix
0045     TVectorD seedX(const L1track3D& l1track3D) const override;
0046     TMatrixD seedC(const L1track3D& l1track3D) const override;
0047
0048     // Stub coordinate measurements & resolution
0049     TVectorD vectorM(const Stub* stub) const override;
0050     TMatrixD matrixV(const Stub* stub, const KalmanState* state) const override;
0051
0052     //--- KF maths matrix multiplications
0053
0054     // Derivate of helix intercept point w.r.t. helix params.
0055     TMatrixD matrixH(const Stub* stub) const override;
0056     // Kalman helix ref point extrapolation matrix
0057     TMatrixD matrixF(const Stub* stub, const KalmanState* state) const override;
0058
0059     // Convert to physical helix params instead of local ones used by KF
0060     TVectorD trackParams(const KalmanState* state) const override;
0061     TVectorD trackParams_BeamConstr(const KalmanState* state, double& chi2rphi) const override;
0062
0063     // Does helix state pass cuts?
0064     bool isGoodState(const KalmanState& state) const override;
0065
0066   protected:
0067     std::vector<double> kfLayerVsPtToler_;
0068     std::vector<double> kfLayerVsD0Cut5_;
0069     std::vector<double> kfLayerVsZ0Cut5_;
0070     std::vector<double> kfLayerVsZ0Cut4_;
0071     std::vector<double> kfLayerVsChiSq5_;
0072     std::vector<double> kfLayerVsChiSq4_;
0073   };
0074
0075 }  // namespace tmtt
0076
0077 #endif```