Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:40

0001 #ifndef PerigeeTrajectoryError_H
0002 #define PerigeeTrajectoryError_H
0003 
0004 #include "TrackingTools/TrajectoryParametrization/interface/TrajectoryStateExceptions.h"
0005 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
0006 #include "FWCore/Utilities/interface/Likely.h"
0007 /**
0008  *  Class providing access to the <i> Perigee</i> parameters of a trajectory.
0009  *  These parameters consist of <BR>
0010  *  transverse curvature (signed), theta, phi,
0011  *  transverse impact parameter (signed), longitudinal i.p.
0012  */
0013 
0014 class PerigeeTrajectoryError {
0015 public:
0016   PerigeeTrajectoryError() {}
0017   // ~PerigeeTrajectoryError() {}
0018 
0019   /*
0020   PerigeeTrajectoryError(AlgebraicSymMatrix aPerigeeError):
0021     thePerigeeError(asSMatrix<5>(aPerigeeError)), weightIsAvailable(false) {}
0022   */
0023   PerigeeTrajectoryError(const AlgebraicSymMatrix55 &aPerigeeError)
0024       : thePerigeeError(aPerigeeError), weightIsAvailable(false) {}
0025 
0026   /**
0027    * The covariance matrix
0028    */
0029   const AlgebraicSymMatrix55 &covarianceMatrix() const { return thePerigeeError; }
0030 
0031   /**
0032    * The weight matrix (inverse of the covariance matrix)
0033    * The error variable is 0 in case of success.
0034    */
0035   const AlgebraicSymMatrix55 &weightMatrix(int &error) const {
0036     if UNLIKELY (!weightIsAvailable)
0037       calculateWeightMatrix();
0038     error = inverseError;
0039     return thePerigeeWeight;
0040   }
0041 
0042   void calculateWeightMatrix() const;
0043 
0044   double transverseCurvatureError() const { return sqrt(thePerigeeError(0, 0)); }
0045 
0046   /**
0047    * The theta angle
0048    */
0049 
0050   double thetaError() const { return sqrt(thePerigeeError(1, 1)); }
0051 
0052   /**
0053    * The phi angle
0054    */
0055 
0056   double phiError() const { return sqrt(thePerigeeError(2, 2)); }
0057 
0058   /**
0059    * The (signed) transverse impact parameter
0060    */
0061 
0062   double transverseImpactParameterError() const { return sqrt(thePerigeeError(3, 3)); }
0063 
0064   /**
0065    * The longitudinal impact parameter
0066    */
0067 
0068   double longitudinalImpactParameterError() const { return sqrt(thePerigeeError(4, 4)); }
0069 
0070 private:
0071   AlgebraicSymMatrix55 thePerigeeError;
0072   mutable AlgebraicSymMatrix55 thePerigeeWeight;
0073   mutable int inverseError;
0074   mutable bool weightIsAvailable;
0075 };
0076 #endif