Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-24 04:45:12

0001 #ifndef LinearizedTrackState_H
0002 #define LinearizedTrackState_H
0003 
0004 //#include "CommonReco/CommonVertex/interface/ImpactPointMeasurement.h"
0005 
0006 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0008 #include "DataFormats/TrajectoryState/interface/TrackCharge.h"
0009 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0010 
0011 #define SMATRIX_USE_CONSTEXPR
0012 #include "Math/SMatrix.h"
0013 
0014 #include "RecoVertex/VertexPrimitives/interface/RefittedTrackState.h"
0015 #include <vector>
0016 
0017 /**
0018  *
0019  *  Abstract base class for all kind of linearizedtrack like objects.
0020  *  Calculates and stores the ImpactPointMeasurement of the
0021  *  impact point (point of closest approach in 3D) to the
0022  *  given linearization point.
0023  *  (see V.Karimaki, HIP-1997-77 / EXP)
0024  *
0025  *  Computes the parameters of the trajectory at the transverse
0026  *  point of closest approach (in the global transverse plane) to
0027  *  the linearization point, and the jacobiam matrices.
0028  *  (see R.Fruehwirth et al. Data Analysis Techniques in HEP Experiments
0029  *  Second Edition, Cambridge University Press 2000, or
0030  *  R.Fruehwirth et al. Vertex reconstruction and track bundling at the LEP
0031  *  collider using robust algorithms. Computer Physics Communications 96
0032  *  (1996) 189-208).
0033  */
0034 
0035 template <unsigned int N>
0036 class LinearizedTrackState : public ReferenceCounted {
0037 public:
0038   typedef ROOT::Math::SVector<double, N> AlgebraicVectorN;
0039   typedef ROOT::Math::SVector<double, N - 2> AlgebraicVectorM;
0040   typedef ROOT::Math::SMatrix<double, N, 3, ROOT::Math::MatRepStd<double, N, 3> > AlgebraicMatrixN3;
0041   typedef ROOT::Math::SMatrix<double, N, N - 2, ROOT::Math::MatRepStd<double, N, N - 2> > AlgebraicMatrixNM;
0042   typedef ROOT::Math::SMatrix<double, N - 2, 3, ROOT::Math::MatRepStd<double, N - 2, 3> > AlgebraicMatrixM3;
0043   typedef ROOT::Math::SMatrix<double, N, N, ROOT::Math::MatRepSym<double, N> > AlgebraicSymMatrixNN;
0044   typedef ROOT::Math::SMatrix<double, N - 2, N - 2, ROOT::Math::MatRepSym<double, N - 2> > AlgebraicSymMatrixMM;
0045   typedef ROOT::Math::SMatrix<double, N + 1, N + 1, ROOT::Math::MatRepSym<double, N + 1> > AlgebraicSymMatrixOO;
0046 
0047   typedef ReferenceCountingPointer<RefittedTrackState<N> > RefCountedRefittedTrackState;
0048 
0049   ~LinearizedTrackState() override {}
0050 
0051   /**
0052    * Returns a new linearized state with respect to a new linearization point.
0053    * A new object of the same type is returned, without change to the existing one.
0054    */
0055   virtual ReferenceCountingPointer<LinearizedTrackState<N> > stateWithNewLinearizationPoint(
0056       const GlobalPoint& newLP) const = 0;
0057 
0058   /** Access methods
0059    */
0060   virtual const GlobalPoint& linearizationPoint() const = 0;
0061 
0062   /** Method returning the constant term of the Taylor expansion
0063    *  of the measurement equation
0064    */
0065   virtual const AlgebraicVectorN& constantTerm() const = 0;
0066 
0067   /** Method returning the Position Jacobian from the Taylor expansion
0068    *  (Matrix A)
0069    */
0070   virtual const AlgebraicMatrixN3& positionJacobian() const = 0;
0071 
0072   /** Method returning the Momentum Jacobian from the Taylor expansion
0073    *  (Matrix B)
0074    */
0075   virtual const AlgebraicMatrixNM& momentumJacobian() const = 0;
0076 
0077   /** Method returning the parameters of the Taylor expansion
0078    */
0079   virtual const AlgebraicVectorN& parametersFromExpansion() const = 0;
0080 
0081   /** Method returning the parameters of the track state at the
0082    *  linearization point.
0083    */
0084   virtual AlgebraicVectorN predictedStateParameters() const = 0;
0085 
0086   /** Method returning the momentum part of the parameters of the track state
0087    *  at the linearization point.
0088    */
0089   virtual AlgebraicVectorM predictedStateMomentumParameters() const = 0;
0090 
0091   /** Method returning the weight matrix of the track state at the
0092    *  linearization point.
0093    * The error variable is 0 in case of success.
0094    */
0095   virtual AlgebraicSymMatrixNN predictedStateWeight(int& error) const = 0;
0096 
0097   /** Method returning the momentum covariance matrix of the track state at the
0098    *  transverse impact point.
0099    */
0100   virtual AlgebraicSymMatrixMM predictedStateMomentumError() const = 0;
0101 
0102   /** Method returning the covariance matrix of the track state at the
0103    *  linearization point.
0104    */
0105   virtual AlgebraicSymMatrixNN predictedStateError() const = 0;
0106 
0107   virtual bool hasError() const = 0;
0108 
0109   virtual TrackCharge charge() const = 0;
0110 
0111   /** Method returning the impact point measurement
0112    */
0113   //   virtual ImpactPointMeasurement impactPointMeasurement() const = 0;
0114 
0115   virtual bool operator==(const LinearizedTrackState<N>& other) const = 0;
0116 
0117   /** Creates the correct refitted state according to the results of the
0118    *  track refit.
0119    */
0120   virtual RefCountedRefittedTrackState createRefittedTrackState(const GlobalPoint& vertexPosition,
0121                                                                 const AlgebraicVectorM& vectorParameters,
0122                                                                 const AlgebraicSymMatrixOO& covarianceMatrix) const = 0;
0123 
0124   /** Method returning the parameters of the Taylor expansion evaluated with the
0125    *  refitted state.
0126    */
0127   virtual AlgebraicVectorN refittedParamFromEquation(const RefCountedRefittedTrackState& theRefittedState) const = 0;
0128 
0129   virtual inline void checkParameters(AlgebraicVectorN& parameters) const {}
0130 
0131   virtual double weightInMixture() const = 0;
0132 
0133   virtual std::vector<ReferenceCountingPointer<LinearizedTrackState<N> > > components() const = 0;
0134 
0135   virtual reco::TransientTrack track() const = 0;
0136 
0137   virtual bool isValid() const { return true; }
0138 };
0139 
0140 #endif