File indexing completed on 2024-04-06 12:31:27
0001 #ifndef _COMMONRECO_ANALYTICALPROPAGATOR_H_
0002 #define _COMMONRECO_ANALYTICALPROPAGATOR_H_
0003
0004 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0006 #include "FWCore/Utilities/interface/Visibility.h"
0007
0008 #include <cmath>
0009 #include <cfloat>
0010
0011 class Surface;
0012 class Cylinder;
0013 class Plane;
0014 class HelixPlaneCrossing;
0015 class MagneticField;
0016
0017
0018
0019
0020
0021
0022 class AnalyticalPropagator final : public Propagator {
0023 public:
0024 AnalyticalPropagator(const MagneticField* field,
0025 PropagationDirection dir = alongMomentum,
0026 float maxDPhi = 1.6,
0027 bool isOld = true)
0028 : Propagator(dir),
0029 theMaxDPhi2(maxDPhi * maxDPhi),
0030 theMaxDBzRatio(0.5),
0031 theField(field),
0032 isOldPropagationType(isOld) {}
0033
0034 ~AnalyticalPropagator() override {}
0035
0036
0037
0038
0039
0040
0041
0042
0043 using Propagator::propagate;
0044 using Propagator::propagateWithPath;
0045
0046 private:
0047
0048 std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0049 const Plane& plane) const override;
0050
0051
0052 std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0053 const Cylinder& cylinder) const override;
0054
0055 public:
0056
0057
0058
0059 bool setMaxDirectionChange(float phiMax) override {
0060 theMaxDPhi2 = phiMax * phiMax;
0061 return true;
0062 }
0063
0064 AnalyticalPropagator* clone() const override { return new AnalyticalPropagator(*this); }
0065
0066
0067
0068
0069
0070 void setMaxRelativeChangeInBz(const float maxDBz) { theMaxDBzRatio = maxDBz; }
0071
0072 private:
0073
0074 std::pair<TrajectoryStateOnSurface, double> propagatedStateWithPath(const FreeTrajectoryState& fts,
0075 const Surface& surface,
0076 const GlobalTrajectoryParameters& gtp,
0077 const double& s) const dso_internal;
0078
0079
0080 bool propagateParametersOnCylinder(const FreeTrajectoryState& fts,
0081 const Cylinder& cylinder,
0082 GlobalPoint& x,
0083 GlobalVector& p,
0084 double& s) const dso_internal;
0085
0086
0087 bool propagateParametersOnPlane(const FreeTrajectoryState& fts,
0088 const Plane& plane,
0089 GlobalPoint& x,
0090 GlobalVector& p,
0091 double& s) const dso_internal;
0092
0093
0094 bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&, const Plane&, GlobalPoint&, double&) const
0095 dso_internal;
0096
0097 bool propagateWithLineCrossing(const GlobalPoint&, const GlobalVector&, const Cylinder&, GlobalPoint&, double&) const
0098 dso_internal;
0099
0100 bool propagateWithHelixCrossing(
0101 HelixPlaneCrossing&, const Plane&, const float, GlobalPoint&, GlobalVector&, double& s) const dso_internal;
0102
0103 const MagneticField* magneticField() const override { return theField; }
0104
0105 private:
0106 typedef std::pair<TrajectoryStateOnSurface, double> TsosWP;
0107 float theMaxDPhi2;
0108 float theMaxDBzRatio;
0109 const MagneticField* theField;
0110 bool isOldPropagationType;
0111 };
0112
0113 #endif