Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:33

0001 #ifndef TR_StraightLine_Propagator_H_
0002 #define TR_StraightLine_Propagator_H_
0003 
0004 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0005 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0006 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0007 
0008 class MagneticField;
0009 
0010 /** As the name indicates, propagates track parameters according to
0011  *  a straight line model. Intended for test beams without magnetic field
0012  *  and similar cases.
0013  * \warning The errors are NOT propagated.
0014  */
0015 
0016 class StraightLinePropagator final : public Propagator {
0017 private:
0018   typedef FreeTrajectoryState FTS;
0019   typedef TrajectoryStateOnSurface TSOS;
0020 
0021 public:
0022   StraightLinePropagator(const MagneticField* field, PropagationDirection aDir = alongMomentum)
0023       : Propagator(aDir), theField(field) {}
0024 
0025   ~StraightLinePropagator() override {}
0026 
0027   using Propagator::propagate;
0028   using Propagator::propagateWithPath;
0029 
0030   std::pair<TSOS, double> propagateWithPath(const FreeTrajectoryState& fts, const Plane& surface) const override;
0031 
0032   std::pair<TSOS, double> propagateWithPath(const FreeTrajectoryState& fts, const Cylinder& surface) const override;
0033 
0034   StraightLinePropagator* clone() const override { return new StraightLinePropagator(*this); }
0035 
0036   const MagneticField* magneticField() const override { return theField; }
0037 
0038 private:
0039   const MagneticField* theField;
0040 
0041   // compute propagated state, with errors if needed
0042   TrajectoryStateOnSurface propagatedState(const FreeTrajectoryState& fts,
0043                                            const Surface& surface,
0044                                            const AlgebraicMatrix55& jacobian,
0045                                            const GlobalPoint& x,
0046                                            const GlobalVector& p) const;
0047 
0048   TrajectoryStateOnSurface propagatedState(const FreeTrajectoryState& fts,
0049                                            const Surface& surface,
0050                                            const AlgebraicMatrix55& jacobian,
0051                                            const LocalPoint& x,
0052                                            const LocalVector& p) const;
0053 
0054   // compute jacobian of transform
0055   AlgebraicMatrix55 jacobian(double& s) const;
0056 
0057   // compute propagated x and p and path s, return true when propagation is OK
0058   bool propagateParametersOnCylinder(
0059       const FreeTrajectoryState& fts, const Cylinder& cylinder, GlobalPoint& x, GlobalVector& p, double& s) const;
0060 
0061   // compute propagated x and p and path s, return true when propagation is OK
0062   bool propagateParametersOnPlane(
0063       const FreeTrajectoryState& fts, const Plane& plane, LocalPoint& x, LocalVector& p, double& s) const;
0064 };
0065 
0066 #endif