Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:09

0001 #ifndef MultiRefittedTS_H
0002 #define MultiRefittedTS_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/RefittedTrackState.h"
0005 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0006 #include "RecoVertex/VertexPrimitives/interface/LinearizedTrackState.h"
0007 #include "DataFormats/GeometrySurface/interface/Surface.h"
0008 
0009 /**
0010  * Caching refitted state of the trajectory after the vertex fit is
0011  * done. This is for a multi-state track, where each state is each refitted 
0012  * state is a single RefittedTrackState, of whatever parametrization
0013  */
0014 
0015 class Surface;
0016 
0017 class MultiRefittedTS : public RefittedTrackState<5> {
0018 public:
0019   typedef ReferenceCountingPointer<RefittedTrackState<5> > RefCountedRefittedTrackState;
0020   typedef ReferenceCountingPointer<LinearizedTrackState<5> > RefCountedLinearizedTrackState;
0021 
0022   /**
0023    *   Constructor with a reference surface, to be used to assemble the 
0024    *   TSOS components on one identical surface.
0025    */
0026   MultiRefittedTS(const std::vector<RefCountedRefittedTrackState>& prtsComp, const Surface& referenceSurface);
0027 
0028   /**
0029    *   Constructor with a reference position. The surface which is going to be usedto assemble the 
0030    *   TSOS components will be the surface perpendicular to the PCA of the state with the highest weight
0031    *   to the reference point.
0032    */
0033   MultiRefittedTS(const std::vector<RefCountedRefittedTrackState>& prtsComp, const GlobalPoint& referencePosition);
0034 
0035   ~MultiRefittedTS() override {}
0036 
0037   /**
0038    * Returns a FreeTrajectoryState. It will be the FTS of the single, collapsed
0039    * state.
0040    */
0041 
0042   FreeTrajectoryState freeTrajectoryState() const override;
0043 
0044   /**
0045    * Returns a multi-state TSOS at a given surface
0046    */
0047   TrajectoryStateOnSurface trajectoryStateOnSurface(const Surface& surface) const override;
0048 
0049   /**
0050    * Returns a multi-state TSOS at a given surface, with a given propagator
0051    */
0052 
0053   TrajectoryStateOnSurface trajectoryStateOnSurface(const Surface& surface,
0054                                                     const Propagator& propagator) const override;
0055 
0056   /**
0057    *   Returns a new reco::Track, which can then be made persistent. The parameters are taken
0058    *    from FTS described above.
0059    */
0060 
0061   reco::TransientTrack transientTrack() const override;
0062 
0063   /**
0064    * Vector containing the refitted track parameters. Not possible yet for a
0065    * multi-state, throws an exception.
0066    */
0067 
0068   AlgebraicVectorN parameters() const override;
0069 
0070   /**
0071    * The covariance matrix. Not possible yet for a
0072    * multi-state, throws an exception.
0073    */
0074 
0075   AlgebraicSymMatrixNN covariance() const override;
0076 
0077   /**
0078    * Position at which the momentum is defined. Not possible yet for a
0079    * multi-state, throws an exception.
0080    */
0081 
0082   GlobalPoint position() const override;
0083 
0084   /**
0085    * Vector containing the parameters describing the momentum as the vertex.
0086    * These are (signed transverse curvature, theta, phi). Not possible yet for a
0087    * multi-state, throws an exception.
0088    */
0089 
0090   AlgebraicVectorM momentumVector() const override;
0091 
0092   double weight() const override;
0093 
0094   std::vector<ReferenceCountingPointer<RefittedTrackState<5> > > components() const override { return theComponents; }
0095 
0096   /**
0097    * This method is meant to returns a new refitted state of the same type, 
0098    * but with another weight. As we can have several components, each component
0099    * of the new multi-state will be reweighted so that the sum of all weights
0100    * is equal to the specified weight.
0101    * The current state is unchanged.
0102    */
0103 
0104   ReferenceCountingPointer<RefittedTrackState<5> > stateWithNewWeight(const double newWeight) const override;
0105 
0106 private:
0107   void computeFreeTrajectoryState() const;
0108 
0109   typedef std::vector<RefCountedRefittedTrackState> RTSvector;
0110 
0111   mutable RTSvector theComponents;
0112   mutable bool totalWeightAvailable, ftsAvailable;
0113   mutable double totalWeight;
0114   mutable FreeTrajectoryState fts;
0115   const GlobalPoint refPosition;
0116   ConstReferenceCountingPointer<Surface> refSurface;
0117   const bool surf;
0118 };
0119 #endif