00001 #ifndef StraightLineCylinderCrossing_H 00002 #define StraightLineCylinderCrossing_H 00003 00004 #include "DataFormats/GeometryVector/interface/LocalPoint.h" 00005 #include "DataFormats/GeometryVector/interface/LocalVector.h" 00006 #include "DataFormats/GeometryVector/interface/Basic2DVector.h" 00007 00008 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h" 00009 00010 #include <utility> 00011 00012 class Cylinder; 00013 00017 class StraightLineCylinderCrossing { 00018 00019 public: 00022 StraightLineCylinderCrossing (const LocalPoint& startingPos, 00023 const LocalVector& startingDir, 00024 const PropagationDirection propDir=alongMomentum, 00025 double tolerance=0); 00026 00030 std::pair<bool,double> pathLength (const Cylinder& cyl) const; 00031 00037 LocalPoint position (const double s) const { return LocalPoint(theX0+s*theP0);} 00038 00039 private: 00041 std::pair<bool,double> chooseSolution (const double s1, const double s2) const; 00042 00043 private: 00044 // 00045 // single precision is sufficient for intermediate vectors 00046 // 00047 typedef LocalPoint PositionType; 00048 typedef LocalVector DirectionType; 00049 typedef Basic2DVector<float> PositionType2D; 00050 typedef Basic2DVector<float> DirectionType2D; 00051 00052 const PositionType theX0; 00053 const DirectionType theP0; 00054 const PropagationDirection thePropDir; 00055 double theTolerance; 00056 }; 00057 00058 #endif