Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-31 23:46:30

0001 #ifndef RecoParticleFlow_PFTracking_CollinearFitAtTM_h_
0002 #define RecoParticleFlow_PFTracking_CollinearFitAtTM_h_
0003 
0004 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0005 #include "DataFormats/Math/interface/Vector.h"
0006 #include "DataFormats/Math/interface/Error.h"
0007 
0008 // #include "Workspace/TrajectoryMeasurementFits/interface/RandomVector.h"
0009 
0010 /** Constrained fit at a TrajectoryMeasurement assuming collinearity 
0011  *  of incoming / outgoing momenta. The result of the fit is a vector
0012  *  of 6 variables: the first five correspond to local trajectory
0013  *  parameters for the incoming momentum, the 6th is the estimated 
0014  *  remaining energy fraction (p_out / p_in). The NDF are 6 (4)
0015  *  for a valid (invalid) RecHit. **/
0016 
0017 class CollinearFitAtTM {
0018 public:
0019   /// parameter indices in the result vector / covariance matrix
0020   enum { ParQpIn = 0, ParQpOut, ParDxDz, ParDyDz, ParX, ParY };
0021 
0022   CollinearFitAtTM();
0023 
0024   typedef ROOT::Math::SVector<double, 6> ResultVector;
0025   typedef ROOT::Math::SMatrix<double, 6, 6, ROOT::Math::MatRepSym<double, 6> > ResultMatrix;
0026   /// Fit for one TM. Return value "true" for success.
0027   bool fit(const TrajectoryMeasurement& tm, ResultVector& parameters, ResultMatrix& covariance, double& chi2);
0028   /// Fit with explicit input parameters. Return value "true" for success.
0029   bool fit(const AlgebraicVector5& fwdParameters,
0030            const AlgebraicSymMatrix55& fwdCovariance,
0031            const AlgebraicVector5& bwdParameters,
0032            const AlgebraicSymMatrix55& bwdCovariance,
0033            const LocalPoint& hitPosition,
0034            const LocalError& hitErrors,
0035            ResultVector& parameters,
0036            ResultMatrix& covariance,
0037            double& chi2);
0038 
0039 private:
0040   ROOT::Math::SMatrix<double, 12, 6> jacobian_;
0041   ROOT::Math::SVector<double, 12> measurements_;
0042   ROOT::Math::SMatrix<double, 12, 12, ROOT::Math::MatRepSym<double, 12> > weightMatrix_;
0043   ROOT::Math::SVector<double, 6> projectedMeasurements_;
0044   //   RandomVector randomGenerator;
0045 };
0046 
0047 #endif