00001 #ifndef StraightLineBarrelCylinderCrossing_H 00002 #define StraightLineBarrelCylinderCrossing_H 00003 00004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00005 #include "DataFormats/GeometryVector/interface/GlobalVector.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 StraightLineBarrelCylinderCrossing { 00018 00019 public: 00023 StraightLineBarrelCylinderCrossing (const GlobalPoint& startingPos, 00024 const GlobalVector& startingDir, 00025 const PropagationDirection propDir); 00026 00030 std::pair<bool,double> pathLength (const Cylinder& cyl) const; 00031 00037 GlobalPoint position (const double s) const { return GlobalPoint(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 GlobalPoint PositionType; 00048 typedef GlobalVector 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 }; 00056 00057 #endif