Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-13 03:24:14

0001 #ifndef PerigeeConversions_H
0002 #define PerigeeConversions_H
0003 
0004 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
0005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0006 #include "TrackingTools/TrajectoryParametrization/interface/PerigeeTrajectoryParameters.h"
0007 #include "TrackingTools/TrajectoryParametrization/interface/PerigeeTrajectoryError.h"
0008 #include <optional>
0009 
0010 class TrajectoryStateClosestToPoint;
0011 
0012 /**
0013  * namespace provides several functions to transform perigee parameters to and from
0014  * various other parametrisations.
0015  */
0016 namespace PerigeeConversions {
0017   typedef FreeTrajectoryState FTS;
0018   /**
0019    *  calculates the perigee parameters from a given FTS
0020    * and a reference point. Returns nullopt if pt == 0.
0021    */
0022   std::optional<PerigeeTrajectoryParameters> ftsToPerigeeParameters(const FTS& originalFTS,
0023                                                                     const GlobalPoint& referencePoint,
0024                                                                     double& pt);
0025 
0026   PerigeeTrajectoryError ftsToPerigeeError(const FTS& originalFTS);
0027 
0028   /**
0029    *  returns the position (on the helix) at which the
0030    * parameters are defined
0031    */
0032   GlobalPoint positionFromPerigee(const PerigeeTrajectoryParameters& parameters, const GlobalPoint& referencePoint);
0033 
0034   /**
0035    *  returns the (Cartesian) momentum.
0036    * The parameters need not be the full perigee parameters, as long as the first
0037    * 3 parameters are the transverse curvature, theta and phi.
0038    */
0039   GlobalVector momentumFromPerigee(const AlgebraicVector3& momentum,
0040                                    const TrackCharge& charge,
0041                                    const GlobalPoint& referencePoint,
0042                                    const MagneticField* field);
0043 
0044   /**
0045    *  returns the (Cartesian) momentum from the PerigeeTrajectoryParameters
0046    */
0047   GlobalVector momentumFromPerigee(const PerigeeTrajectoryParameters& parameters,
0048                                    double pt,
0049                                    const GlobalPoint& referencePoint);
0050 
0051   CurvilinearTrajectoryError curvilinearError(const PerigeeTrajectoryError& perigeeError,
0052                                               const GlobalTrajectoryParameters& gtp);
0053 
0054   /**
0055    * Public constructor.
0056    * This constructor takes a momentum, with parameters
0057    * (transverse curvature, theta, phi) and a position, which is both the
0058    * reference position and the position at which the momentum is defined.
0059    * The covariance matrix is defined for these 6 parameters, in the order
0060    * (x, y, z, transverse curvature, theta, phi).
0061    */
0062   TrajectoryStateClosestToPoint trajectoryStateClosestToPoint(const AlgebraicVector3& momentum,
0063                                                               const GlobalPoint& referencePoint,
0064                                                               const TrackCharge& charge,
0065                                                               const AlgebraicSymMatrix66& theCovarianceMatrix,
0066                                                               const MagneticField* field);
0067 
0068   /**
0069    * Jacobians of tranformations between the parametrixation
0070    * (x, y, z, transverse curvature, theta, phi) to Cartesian
0071    */
0072   AlgebraicMatrix66 jacobianParameters2Cartesian(const AlgebraicVector3& momentum,
0073                                                  const GlobalPoint& position,
0074                                                  const TrackCharge& charge,
0075                                                  const MagneticField* field);
0076 
0077   /**
0078    * Jacobians of tranformations between curvilinear frame at point of closest
0079    * approach in transverse plane and perigee frame. The fts must therefore be
0080    * given at exactly this point in order to yield the correct Jacobians.
0081    */
0082   AlgebraicMatrix55 jacobianCurvilinear2Perigee(const FreeTrajectoryState& fts);
0083 
0084   AlgebraicMatrix55 jacobianPerigee2Curvilinear(const GlobalTrajectoryParameters& gtp);
0085 
0086 }  // namespace PerigeeConversions
0087 
0088 #endif