Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:05:33

0001 #ifndef HelixBarrelCylinderCrossing_H
0002 #define HelixBarrelCylinderCrossing_H
0003 
0004 #include "DataFormats/GeometryVector/interface/Basic2DVector.h"
0005 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0006 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0007 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0008 
0009 #include "FWCore/Utilities/interface/Visibility.h"
0010 
0011 class Cylinder;
0012 
0013 /** Calculates the crossing of a helix with a barrel cylinder.
0014  */
0015 
0016 class HelixBarrelCylinderCrossing {
0017 public:
0018   enum Solution { bothSol, bestSol, onlyPos };
0019 
0020   typedef double TmpType;
0021   typedef Basic2DVector<TmpType> Point;   // for private use only
0022   typedef Basic2DVector<TmpType> Vector;  // for private use only
0023 
0024   typedef GlobalPoint PositionType;
0025   typedef GlobalVector DirectionType;
0026 
0027   HelixBarrelCylinderCrossing(const GlobalPoint& startingPos,
0028                               const GlobalVector& startingDir,
0029                               double rho,
0030                               PropagationDirection propDir,
0031                               const Cylinder& cyl,
0032                               Solution sol = bothSol);
0033 
0034   bool hasSolution() const { return theSolExists; }
0035 
0036   /** Propagation status (true if valid) and (signed) path length 
0037    *  along the helix from the starting point to the cylinder. The 
0038    *  starting point and the cylinder are given in the constructor.
0039    */
0040   double pathLength() const { return theS; }
0041 
0042   /** Returns the position along the helix that corresponds to path
0043    *  length "s" from the starting point. If s is obtained from the
0044    *  pathLength method the position is the destination point, i.e.
0045    *  the position of the crossing with a cylinder (if it exists!) 
0046    *  is given by position( pathLength( cylinder)).
0047    */
0048   PositionType position() const { return thePos; }
0049 
0050   /// Method to access separately each solution of the helix-cylinder crossing equations
0051   PositionType position1() const { return thePos1; }
0052 
0053   /// Method to access separately each solution of the helix-cylinder crossing equations
0054   PositionType position2() const { return thePos2; }
0055 
0056   /** Returns the direction along the helix that corresponds to path
0057    *  length "s" from the starting point. As for position,
0058    *  the direction of the crossing with a cylinder (if it exists!) 
0059    *  is given by direction( pathLength( cylinder)).
0060    */
0061   DirectionType direction() const { return theDir; }
0062 
0063 private:
0064   PositionType thePos;
0065   DirectionType theDir;
0066   double theS;
0067   bool theSolExists;
0068 
0069   PositionType thePos1;
0070   PositionType thePos2;
0071 
0072   std::pair<Vector, int> chooseSolution(const Point& p1,
0073                                         const Point& p2,
0074                                         const PositionType& startingPos,
0075                                         const DirectionType& startingDir,
0076                                         PropagationDirection propDir) dso_internal;
0077 };
0078 
0079 #endif