File indexing completed on 2024-04-06 12:31:33
0001 #ifndef CollinearFitAtTM2_h_
0002 #define CollinearFitAtTM2_h_
0003
0004 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0005 #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h"
0006 #include "DataFormats/Math/interface/Vector.h"
0007 #include "DataFormats/Math/interface/Error.h"
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 class CollinearFitAtTM2 {
0019 public:
0020
0021 enum { ParQpIn = 0, ParQpOut, ParDxDz, ParDyDz, ParX, ParY };
0022
0023 CollinearFitAtTM2(const TrajectoryMeasurement& tm);
0024 CollinearFitAtTM2(const AlgebraicVector5& fwdParameters,
0025 const AlgebraicSymMatrix55& fwdCovariance,
0026 const AlgebraicVector5& bwdParameters,
0027 const AlgebraicSymMatrix55& bwdCovariance,
0028 const LocalPoint& hitPosition,
0029 const LocalError& hitErrors);
0030
0031 typedef ROOT::Math::SVector<double, 6> ResultVector;
0032 typedef ROOT::Math::SMatrix<double, 6, 6, ROOT::Math::MatRepSym<double, 6> > ResultMatrix;
0033
0034 bool valid() const { return valid_; }
0035
0036 double chi2() const { return chi2_; }
0037
0038 int ndof() const { return ndof_; }
0039
0040 const ResultVector& parameters() const { return parameters_; }
0041
0042 const ResultMatrix& covariance() const { return covariance_; }
0043
0044 Measurement1D deltaP() const;
0045
0046 private:
0047
0048 void initJacobian();
0049
0050 bool fit(const AlgebraicVector5& fwdParameters,
0051 const AlgebraicSymMatrix55& fwdCovariance,
0052 const AlgebraicVector5& bwdParameters,
0053 const AlgebraicSymMatrix55& bwdCovariance,
0054 const LocalPoint& hitPosition,
0055 const LocalError& hitErrors);
0056
0057 private:
0058 ROOT::Math::SMatrix<double, 12, 6> jacobian_;
0059 ROOT::Math::SVector<double, 12> measurements_;
0060 ROOT::Math::SMatrix<double, 12, 12, ROOT::Math::MatRepSym<double, 12> > weightMatrix_;
0061 ROOT::Math::SVector<double, 6> projectedMeasurements_;
0062
0063
0064 bool valid_;
0065 ResultVector parameters_;
0066 ResultMatrix covariance_;
0067 double chi2_;
0068 int ndof_;
0069 };
0070
0071 #endif