File indexing completed on 2024-04-06 12:31:28
0001 #ifndef StraightLineCylinderCrossing_H
0002 #define StraightLineCylinderCrossing_H
0003
0004 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0005 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0006 #include "DataFormats/GeometryVector/interface/Basic2DVector.h"
0007
0008 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0009
0010 #include <utility>
0011
0012 class Cylinder;
0013
0014
0015
0016
0017 class StraightLineCylinderCrossing {
0018 public:
0019
0020
0021 StraightLineCylinderCrossing(const LocalPoint& startingPos,
0022 const LocalVector& startingDir,
0023 const PropagationDirection propDir = alongMomentum,
0024 double tolerance = 0);
0025
0026
0027
0028
0029 std::pair<bool, double> pathLength(const Cylinder& cyl) const;
0030
0031
0032
0033
0034
0035
0036 LocalPoint position(const double s) const { return LocalPoint(theX0 + s * theP0); }
0037
0038 private:
0039
0040 std::pair<bool, double> chooseSolution(const double s1, const double s2) const;
0041
0042 private:
0043
0044
0045
0046 typedef LocalPoint PositionType;
0047 typedef LocalVector DirectionType;
0048 typedef Basic2DVector<float> PositionType2D;
0049 typedef Basic2DVector<float> DirectionType2D;
0050
0051 const PositionType theX0;
0052 const DirectionType theP0;
0053 const PropagationDirection thePropDir;
0054 double theTolerance;
0055 };
0056
0057 #endif