MarlinTPC  1.2.0
IntersectionCalculator.h
1 #ifndef INTERSECTION_CALCULATOR_H
2 #define INTERSECTION_CALCULATOR_H
3 
4 #include <exception>
5 
6 namespace marlintpc
7 {
8 
33 {
34  public:
46  static std::pair<double,double> circle_circle(double R, double centreX, double centreY, double r);
47 
59  static std::pair<std::pair<double,double>,std::pair<double,double> > circle_straightLine_xy(double R, double inclination, double xAxisIntersect);
60 
61 
74  static std::pair<double,double> circle_straightLine(double R, double x0, double y0, double trackPhi);
75 
76 
81  static std::pair<double,double> circle_straightLine_phi(double R, double inclination, double xAxisIntersect);
82 
92  static std::pair<double,double> horizonalLine_circle(double Y, double centreX, double centreY, double r);
93 
103  static double horizontalLine_straightLine(double Y, double inclination, double xAxisIntersect);
104 
106  class NoIntersectionException : public std::exception
107  {
108  protected:
109  std::string message ;
110 
111  NoIntersectionException(){ /*no_op*/ ; }
112 
113  public:
114  virtual ~NoIntersectionException() throw() { /*no_op*/; }
115 
116  NoIntersectionException( const std::string& text ){
117  message = "NoIntersectionExceptionException: " + text ;
118  }
119 
120  virtual const char* what() const throw() { return message.c_str() ; }
121  };
122 
123  private:
126 
137  static std::pair<double,double> circle_straightLine_inx_phi(double R, double inclination, double xAxisIntersect);
138 
149  static std::pair<double,double> circle_straightLine_iny_phi(double R, double inclination, double yAxisIntersect);
150 
151 };
152 
153 } //namespace marlintpc
154 #endif //INTERSECTION_CALCULATOR_H
static std::pair< double, double > circle_straightLine_phi(double R, double inclination, double xAxisIntersect)
Only kept for backwards compatibility.
Definition: IntersectionCalculator.cc:185
A helper class to calculate the intersections of.
Definition: IntersectionCalculator.h:32
static std::pair< double, double > circle_straightLine(double R, double x0, double y0, double trackPhi)
Calculate the intersection of a circular pad row with a straight track.
Definition: IntersectionCalculator.cc:128
static double horizontalLine_straightLine(double Y, double inclination, double xAxisIntersect)
Calculate the intersection of a straight line (pad row) with a straight track parameterised in the di...
Definition: IntersectionCalculator.cc:216
A nested exception which is thrown in case there is no intersection.
Definition: IntersectionCalculator.h:106
static std::pair< double, double > horizonalLine_circle(double Y, double centreX, double centreY, double r)
Calculate the intersection of a straight line (pad row) with a circle.
Definition: IntersectionCalculator.cc:201
static std::pair< double, double > circle_circle(double R, double centreX, double centreY, double r)
Calculate the intersection of a circular pad row with a track circle.
Definition: IntersectionCalculator.cc:14
static std::pair< std::pair< double, double >, std::pair< double, double > > circle_straightLine_xy(double R, double inclination, double xAxisIntersect)
Calculate the intersection of a circular pad row with a straight track parameterised in the direction...
Definition: IntersectionCalculator.cc:95