Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PerigeeMultiLTS_H
0002 #define PerigeeMultiLTS_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/LinearizedTrackState.h"
0005 #include "RecoVertex/VertexTools/interface/LinearizedTrackStateFactory.h"
0006 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0007 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0008 #include <vector>
0009 
0010 /**
0011  * Multi-state version of PerigeeLinearizedTrackState
0012  */
0013 
0014 class PerigeeMultiLTS : public LinearizedTrackState<5> {
0015 public:
0016   typedef ReferenceCountingPointer<LinearizedTrackState<5> > RefCountedLinearizedTrackState;
0017 
0018   /** Friend class properly dealing with creation
0019    *  of reference-counted pointers to LinearizedTrack objects
0020    */
0021   friend class MultiPerigeeLTSFactory;
0022 
0023   /**
0024    * Returns a new linearized state with respect to a new linearization point.
0025    * A new object of the same type is returned, without change to the existing one.
0026    */
0027 
0028   RefCountedLinearizedTrackState stateWithNewLinearizationPoint(const GlobalPoint& newLP) const override;
0029 
0030   /**
0031    * The point at which the track state has been linearized
0032    */
0033   const GlobalPoint& linearizationPoint() const override { return theLinPoint; }
0034 
0035   reco::TransientTrack track() const override { return theTrack; }
0036 
0037   /**
0038    * Returns theoriginal (multi-state) TrajectoryStateOnSurface whith which
0039    * this instance has been created with.
0040    */
0041   const TrajectoryStateOnSurface state() const { return theTSOS; }
0042 
0043   /** Method returning the constant term of the Taylor expansion
0044    *  of the measurement equation for the collapsed track state
0045    */
0046   const AlgebraicVectorN& constantTerm() const override;
0047 
0048   /** Method returning the Position Jacobian from the Taylor expansion
0049    *  (Matrix A) for the collapsed track state
0050    */
0051   const AlgebraicMatrixN3& positionJacobian() const override;
0052 
0053   /** Method returning the Momentum Jacobian from the Taylor expansion
0054    *  (Matrix B) for the collapsed track state
0055    */
0056   const AlgebraicMatrixNM& momentumJacobian() const override;
0057 
0058   /** Method returning the parameters of the Taylor expansion for
0059    *  the collapsed track state
0060    */
0061   const AlgebraicVectorN& parametersFromExpansion() const override;
0062 
0063   /** Method returning the track state at the point of closest approach
0064    *  to the linearization point, in the transverse plane (a.k.a.
0065    *  transverse impact point),  for the collapsed track state
0066    */
0067   const TrajectoryStateClosestToPoint& predictedState() const;
0068 
0069   /** Method returning the parameters of the track state at the
0070    *  transverse impact point, for the collapsed track state
0071    */
0072   AlgebraicVectorN predictedStateParameters() const override;
0073 
0074   /** Method returning the momentum part of the parameters of the track state
0075    *  at the linearization point, for the collapsed track state
0076    */
0077   AlgebraicVectorM predictedStateMomentumParameters() const override;
0078 
0079   /** Method returning the weight matrix of the track state at the
0080    *  transverse impact point, for the collapsed track state
0081    * The error variable is 0 in case of success.
0082    */
0083   AlgebraicSymMatrixNN predictedStateWeight(int& error) const override;
0084 
0085   /** Method returning the covariance matrix of the track state at the
0086    *  transverse impact point, for the collapsed track state
0087    */
0088   AlgebraicSymMatrixNN predictedStateError() const override;
0089 
0090   /** Method returning the momentum covariance matrix of the track state at the
0091    *  transverse impact point, for the collapsed track state
0092    */
0093   AlgebraicSymMatrixMM predictedStateMomentumError() const override;
0094 
0095   TrackCharge charge() const override { return theCharge; }
0096 
0097   bool hasError() const override;
0098 
0099   bool operator==(const LinearizedTrackState<5>& other) const override;
0100 
0101   /** Creates the correct refitted state according to the results of the
0102    *  track refit.
0103    */
0104   RefCountedRefittedTrackState createRefittedTrackState(const GlobalPoint& vertexPosition,
0105                                                         const AlgebraicVectorM& vectorParameters,
0106                                                         const AlgebraicSymMatrixOO& covarianceMatrix) const override;
0107 
0108   AlgebraicVector5 refittedParamFromEquation(const RefCountedRefittedTrackState& theRefittedState) const override;
0109 
0110   void inline checkParameters(AlgebraicVector5& parameters) const override;
0111   /**
0112    * The weight of this state. It will be the sum of the weights of the
0113    * individual components in the mixture.
0114    */
0115 
0116   double weightInMixture() const override { return theTSOS.weight(); }
0117 
0118   /**
0119    * Vector of individual components in the mixture.
0120    */
0121 
0122   std::vector<ReferenceCountingPointer<LinearizedTrackState<5> > > components() const override { return ltComp; }
0123 
0124 private:
0125   /** Constructor with the linearization point and the track.
0126    *  Private, can only be used by LinearizedTrackFactory.
0127    * \param linP    The linearization point
0128    * \param track   The RecTrack
0129    * \param tsos    The original (multi-state) TrajectoryStateOnSurface
0130    */
0131   PerigeeMultiLTS(const GlobalPoint& linP, const reco::TransientTrack& track, const TrajectoryStateOnSurface& tsos);
0132 
0133   /** Linearize the collapsed track state.
0134    */
0135   void prepareCollapsedState() const;
0136 
0137   GlobalPoint theLinPoint;
0138   reco::TransientTrack theTrack;
0139 
0140   const TrajectoryStateOnSurface theTSOS;
0141   std::vector<RefCountedLinearizedTrackState> ltComp;
0142   mutable RefCountedLinearizedTrackState collapsedStateLT;
0143   LinearizedTrackStateFactory theLTSfactory;
0144   TrackCharge theCharge;
0145   mutable bool collapsedStateAvailable;
0146 };
0147 
0148 #endif