File indexing completed on 2024-04-06 12:31:28
0001 #ifndef GeomPropagators_SmartPropagator_H
0002 #define GeomPropagators_SmartPropagator_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0023 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0024 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0025 #include "MagneticField/Engine/interface/MagneticField.h"
0026 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0027 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0028
0029 class Cylinder;
0030 class Plane;
0031
0032
0033
0034 class SmartPropagator final : public Propagator {
0035 public:
0036
0037
0038 SmartPropagator(const Propagator* aTkProp,
0039 const Propagator* aGenProp,
0040 const MagneticField* field,
0041 PropagationDirection dir = alongMomentum,
0042 float epsilon = 5);
0043
0044
0045 SmartPropagator(const Propagator& aTkProp,
0046 const Propagator& aGenProp,
0047 const MagneticField* field,
0048 PropagationDirection dir = alongMomentum,
0049 float epsilon = 5);
0050
0051
0052 SmartPropagator(const SmartPropagator&);
0053
0054
0055 ~SmartPropagator() override;
0056
0057
0058 SmartPropagator* clone() const override {
0059 return new SmartPropagator(getTkPropagator(), getGenPropagator(), magneticField());
0060 }
0061
0062
0063 void setPropagationDirection(PropagationDirection dir) override {
0064 Propagator::setPropagationDirection(dir);
0065 theTkProp->setPropagationDirection(dir);
0066 theGenProp->setPropagationDirection(dir);
0067 }
0068
0069 using Propagator::propagate;
0070 using Propagator::propagateWithPath;
0071
0072 private:
0073 std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0074 const Plane& plane) const override;
0075
0076 std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0077 const Cylinder& cylinder) const override;
0078
0079 std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0080 const Plane& sur) const override;
0081
0082 std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0083 const Cylinder& sur) const override;
0084
0085 public:
0086
0087 bool insideTkVol(const FreeTrajectoryState& fts) const;
0088
0089 bool insideTkVol(const Surface& surface) const;
0090
0091 bool insideTkVol(const Cylinder& cylin) const;
0092
0093 bool insideTkVol(const Plane& plane) const;
0094
0095
0096 const Propagator* getTkPropagator() const;
0097
0098 const Propagator* getGenPropagator() const;
0099
0100 const MagneticField* magneticField() const override { return theField; }
0101
0102 private:
0103
0104 void initTkVolume(float epsilon);
0105
0106 Propagator* theTkProp;
0107 Propagator* theGenProp;
0108 const MagneticField* theField;
0109 ReferenceCountingPointer<Cylinder> theTkVolume;
0110
0111 protected:
0112 };
0113
0114 #endif