Geant4_10
UIntersectingCone.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * This Software is part of the AIDA Unified Solids Library package *
4 // * See: https://aidasoft.web.cern.ch/USolids *
5 // ********************************************************************
6 //
7 // $Id:$
8 //
9 // --------------------------------------------------------------------
10 //
11 // UIntersectingCone
12 //
13 // Class description:
14 //
15 // Utility class which calculates the intersection
16 // of an arbitrary line with a fixed cone
17 //
18 // 19.02.13 Marek Gayer
19 // Created from original implementation in Geant4
20 // --------------------------------------------------------------------
21 
22 #ifndef UIntersectingCone_hh
23 #define UIntersectingCone_hh
24 
25 #include "UTypes.hh"
26 
28 {
29  public:
30 
31  UIntersectingCone(const double r[2], const double z[2]);
32  virtual ~UIntersectingCone();
33 
34  int LineHitsCone(const UVector3& p, const UVector3& v, double& s1, double& s2);
35 
36  bool HitOn(const double r, const double z);
37 
38  inline double RLo() const
39  {
40  return rLo;
41  }
42  inline double RHi() const
43  {
44  return rHi;
45  }
46  inline double ZLo() const
47  {
48  return zLo;
49  }
50  inline double ZHi() const
51  {
52  return zHi;
53  }
54 
55  public: // without description
56 
57  /*
58  UIntersectingCone(__void__&);
59  // Fake default constructor for usage restricted to direct object
60  // persistency for clients requiring preallocation of memory for
61  // persistifiable objects.
62  */
63 
64 
65  protected:
66 
67  double zLo, zHi, // Z bounds of side
68  rLo, rHi; // R bounds of side
69 
70  bool type1; // True if cone is type 1
71  // (std::fabs(z1-z2)>std::fabs(r1-r2))
72  double A, B; // Cone radius parameter:
73  // type 1: r = A + B*z
74  // type 2: z = A + B*r
75 
76  // int Solution (const UVector3 &p, const UVector3 &v, double a, double b, double c, double &s1, double &s2);
77 
78  int LineHitsCone1(const UVector3& p, const UVector3& v,
79  double& s1, double& s2);
80 
81  int LineHitsCone1Optimized(const UVector3& p, const UVector3& v,
82  double& s1, double& s2);
83 
84  int LineHitsCone2(const UVector3& p, const UVector3& v,
85  double& s1, double& s2);
86 
87 // const double kInfinity;
88  const static double EpsilonQuad;
89 };
90 
91 #endif
int LineHitsCone1(const UVector3 &p, const UVector3 &v, double &s1, double &s2)
int LineHitsCone1Optimized(const UVector3 &p, const UVector3 &v, double &s1, double &s2)
int LineHitsCone2(const UVector3 &p, const UVector3 &v, double &s1, double &s2)
const char * p
Definition: xmltok.h:285
virtual ~UIntersectingCone()
double RHi() const
bool HitOn(const double r, const double z)
static const double EpsilonQuad
tuple v
Definition: test.py:18
jump r
Definition: plot.C:36
double ZHi() const
tuple z
Definition: test.py:28
UIntersectingCone(const double r[2], const double z[2])
double ZLo() const
int LineHitsCone(const UVector3 &p, const UVector3 &v, double &s1, double &s2)
double RLo() const