Geant4  10.01
UEnclosingCylinder.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 // UEnclosingCylinder
12 //
13 // Class description:
14 //
15 // Definition of a utility class for quickly deciding if a point
16 // is clearly outside a polyhedra or polycone or deciding if
17 // a trajectory is clearly going to miss those shapes.
18 //
19 // 19.10.12 Marek Gayer
20 // Created from original implementation in Geant4
21 // --------------------------------------------------------------------
22 
23 #ifndef UEnclosingCylinder_hh
24 #define UEnclosingCylinder_hh
25 
26 #include "UTypes.hh"
27 #include "UTubs.hh"
28 
29 class UReduciblePolygon;
30 
32 {
33  public: // with description
34 
35  UEnclosingCylinder(/*const UReduciblePolygon *rz*/ double r, double lo, double hi,
36  bool phiIsOpen,
37  double startPhi, double totalPhi);
39 
40  bool MustBeOutside(const UVector3& p) const;
41  // Decide very rapidly if the point is outside the cylinder.
42  // If one is not certain, return false.
43 
44  bool ShouldMiss(const UVector3& p, const UVector3& v) const;
45  // Decide very rapidly if the trajectory is going to miss the cylinder.
46  // If one is not sure, return false.
47 
48  double DistanceTo(const UVector3& p, const UVector3& v) const;
49 
50  double SafetyFromOutside(const UVector3& p) const;
51 
52  public: // without description
53 
54  void Extent(UVector3& aMin, UVector3& aMax) const;
55 
56  double radius; // radius of our cylinder
57 
58  protected:
59 
60  double zLo, zHi; // z extent
61 
62  bool phiIsOpen; // true if there is a phi segment
63  double startPhi, // for isPhiOpen==true, starting of phi segment
64  totalPhi; // for isPhiOpen==true, size of phi segment
65 
66  double rx1, ry1,
67  dx1, dy1;
68  double rx2, ry2,
69  dx2, dy2;
70 
71  bool concave; // true, if x/y Cross section is concave
72 
74 };
75 
76 #endif
Definition: UTubs.hh:47
double SafetyFromOutside(const UVector3 &p) const
bool MustBeOutside(const UVector3 &p) const
UEnclosingCylinder(double r, double lo, double hi, bool phiIsOpen, double startPhi, double totalPhi)
bool ShouldMiss(const UVector3 &p, const UVector3 &v) const
void Extent(UVector3 &aMin, UVector3 &aMax) const
double DistanceTo(const UVector3 &p, const UVector3 &v) const