Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:23:25

0001 #ifndef ParticleKinematicLinearizedTrackState_H
0002 #define ParticleKinematicLinearizedTrackState_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/LinearizedTrackState.h"
0005 #include "RecoVertex/KinematicFitPrimitives/interface/RefCountedKinematicParticle.h"
0006 #include "RecoVertex/VertexPrimitives/interface/RefittedTrackState.h"
0007 #include "RecoVertex/KinematicFitPrimitives/interface/PerigeeKinematicState.h"
0008 #include "RecoVertex/KinematicFitPrimitives/interface/TransientTrackKinematicStateBuilder.h"
0009 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0010 #include "DataFormats/CLHEP/interface/Migration.h"
0011 #include "RecoVertex/KinematicFitPrimitives/interface/Matrices.h"
0012 
0013 class ParticleKinematicLinearizedTrackState : public LinearizedTrackState<6> {
0014 public:
0015   friend class ParticleKinematicLinearizedTrackStateFactory;
0016   typedef ReferenceCountingPointer<LinearizedTrackState<6> > RefCountedLinearizedTrackState;
0017 
0018   ParticleKinematicLinearizedTrackState() { jacobiansAvailable = false; }
0019 
0020   /**
0021   * Returns a new linearized state with respect to a new linearization point.
0022   * A new object of the same type is returned, without change to the existing one.
0023   */
0024   ReferenceCountingPointer<LinearizedTrackState<6> > stateWithNewLinearizationPoint(
0025       const GlobalPoint& newLP) const override;
0026 
0027   /**
0028   * The point at which the track state has been linearized
0029   */
0030   const GlobalPoint& linearizationPoint() const override { return theLinPoint; }
0031 
0032   /** Method returning the constant term of the Taylor expansion
0033  *  of measurement equation
0034  */
0035   const AlgebraicVector6& constantTerm() const override;
0036 
0037   /** Method returning the Position Jacobian from the Taylor expansion 
0038  *  (Matrix A)
0039  */
0040   const AlgebraicMatrix63& positionJacobian() const override;
0041 
0042   /** Method returning the Momentum Jacobian from the Taylor expansion 
0043  *  (Matrix B)
0044  */
0045   const AlgebraicMatrix64& momentumJacobian() const override;
0046 
0047   /** Method returning the parameters of the Taylor expansion
0048  */
0049   const AlgebraicVector6& parametersFromExpansion() const override;
0050 
0051   /** Method returning the track state at the point of closest approach 
0052  *  to the linearization point, in the transverse plane (a.k.a. 
0053  *  transverse impact point). 
0054  */
0055 
0056   /**
0057  * extended perigee predicted parameters
0058  */
0059   AlgebraicVector6 predictedStateParameters() const override;
0060 
0061   /**
0062  * returns predicted 4-momentum in extended perigee parametrization
0063  */
0064   AlgebraicVectorM predictedStateMomentumParameters() const override;
0065 
0066   /**
0067  * 4x4 error matrix ofe xtended perigee mometum components
0068  */
0069   AlgebraicSymMatrix44 predictedStateMomentumError() const override;
0070 
0071   /**
0072  * Full predicted weight matrix
0073  */
0074   AlgebraicSymMatrix66 predictedStateWeight(int& error) const override;
0075 
0076   /**
0077  * Full predicted error matrix
0078  */
0079   AlgebraicSymMatrix66 predictedStateError() const override;
0080 
0081   // /**
0082   //  * Method returning the impact point measurement
0083   //  */
0084   //  ImpactPointMeasurement impactPointMeasurement() const;
0085 
0086   TrackCharge charge() const override;
0087 
0088   RefCountedKinematicParticle particle() const;
0089 
0090   bool operator==(LinearizedTrackState<6>& other) const override;
0091 
0092   bool hasError() const override;
0093 
0094   RefCountedRefittedTrackState createRefittedTrackState(const GlobalPoint& vertexPosition,
0095                                                         const AlgebraicVectorM& vectorParameters,
0096                                                         const AlgebraicSymMatrix77& covarianceMatrix) const override;
0097 
0098   /** Method returning the parameters of the Taylor expansion evaluated with the
0099    *  refitted state.
0100    */
0101   AlgebraicVectorN refittedParamFromEquation(const RefCountedRefittedTrackState& theRefittedState) const override;
0102 
0103   inline void checkParameters(AlgebraicVectorN& parameters) const override;
0104 
0105   double weightInMixture() const override;
0106 
0107   std::vector<ReferenceCountingPointer<LinearizedTrackState<6> > > components() const override;
0108 
0109   reco::TransientTrack track() const override;
0110 
0111 private:
0112   /** Constructor with the linearization point and the track. 
0113  *  Private, can only be used by LinearizedTrackFactory.
0114  */
0115   ParticleKinematicLinearizedTrackState(const GlobalPoint& linP, RefCountedKinematicParticle& prt)
0116       : theLinPoint(linP),
0117         part(prt),
0118         jacobiansAvailable(false),
0119         theCharge(prt->currentState().particleCharge()),
0120         impactPointAvailable(false)
0121 
0122   {}
0123 
0124   /** 
0125  * Method calculating the track parameters and the Jacobians.
0126  */
0127   void computeJacobians() const;
0128   /**
0129  * Method calculating the track parameters and the Jacobians for charged particles.
0130  */
0131   void computeChargedJacobians() const;
0132 
0133   /**
0134  * Method calculating the track parameters and the Jacobians for neutral particles.
0135  */
0136   void computeNeutralJacobians() const;
0137 
0138   GlobalPoint theLinPoint;
0139   RefCountedKinematicParticle part;
0140   TransientTrackKinematicStateBuilder builder;
0141 
0142   mutable bool errorAvailable;
0143   mutable bool jacobiansAvailable;
0144   mutable AlgebraicMatrix63 thePositionJacobian;
0145   mutable AlgebraicMatrix64 theMomentumJacobian;
0146   mutable PerigeeKinematicState thePredState;
0147   mutable AlgebraicVector6 theConstantTerm;
0148   mutable AlgebraicVector6 theExpandedParams;
0149 
0150   TrackCharge theCharge;
0151   //   ImpactPointMeasurementExtractor theIPMExtractor;
0152   mutable bool impactPointAvailable;
0153 };
0154 #endif