Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:09

0001 #ifndef Alignment_ReferenceTrajectories_TwoBodyDecayTrajectoryState_h
0002 #define Alignment_ReferenceTrajectories_TwoBodyDecayTrajectoryState_h
0003 
0004 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0005 #include "Alignment/TwoBodyDecay/interface/TwoBodyDecay.h"
0006 
0007 /** Computes the trajectory states and their derivatives w.r.t. the decay parameters.
0008  */
0009 
0010 class GlobalTrajectoryParameters;
0011 
0012 class TwoBodyDecayTrajectoryState {
0013 public:
0014   typedef std::pair<TrajectoryStateOnSurface, TrajectoryStateOnSurface> TsosContainer;
0015   typedef std::pair<AlgebraicMatrix, AlgebraicMatrix> Derivatives;
0016 
0017   /** The constructor takes the two trajectory states that are to be updated (typically the
0018    *  innermost trajectory states of two tracks) and the decay parameters.
0019    */
0020   TwoBodyDecayTrajectoryState(const TsosContainer& tsos,
0021                               const TwoBodyDecay& tbd,
0022                               double particleMass,
0023                               const MagneticField* magField,
0024                               bool propagateErrors = false);
0025 
0026   ~TwoBodyDecayTrajectoryState(void) {}
0027 
0028   inline bool isValid(void) const { return theValidityFlag; }
0029 
0030   inline double particleMass(void) const { return theParticleMass; }
0031   inline const TwoBodyDecayParameters& decayParameters(void) const { return theParameters; }
0032   inline const TsosContainer& trajectoryStates(bool useRefittedState = true) const {
0033     return useRefittedState ? theRefittedTsos : theOriginalTsos;
0034   }
0035   inline const Derivatives& derivatives(void) const { return theDerivatives; }
0036 
0037   void rescaleError(double scale);
0038 
0039   inline double primaryMass(void) const { return thePrimaryMass; }
0040   inline double primaryWidth(void) const { return thePrimaryWidth; }
0041 
0042 private:
0043   void construct(const MagneticField* magField, bool propagateErrors);
0044 
0045   bool propagateSingleState(const FreeTrajectoryState& fts,
0046                             const GlobalTrajectoryParameters& gtp,
0047                             const AlgebraicMatrix& startDeriv,
0048                             const Surface& surface,
0049                             const MagneticField* magField,
0050                             TrajectoryStateOnSurface& tsos,
0051                             AlgebraicMatrix& endDeriv) const;
0052 
0053   void setError(FreeTrajectoryState& fts, AlgebraicMatrix& derivative) const;
0054 
0055   bool theValidityFlag;
0056 
0057   double theParticleMass;
0058 
0059   TwoBodyDecayParameters theParameters;
0060   Derivatives theDerivatives;
0061   TsosContainer theOriginalTsos;
0062   TsosContainer theRefittedTsos;
0063 
0064   double thePrimaryMass;
0065   double thePrimaryWidth;
0066 
0067   static const unsigned int nLocalParam = 5;
0068   static const unsigned int nDecayParam = TwoBodyDecayParameters::dimension;
0069 };
0070 
0071 #endif