Geant4  10.03
G4EllipticalCone.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4EllipticalCone.hh 100819 2016-11-02 15:17:36Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // G4EllipticalCone
34 //
35 // Class description:
36 //
37 // G4EllipticalCone is a full cone with elliptical base which can be cut in Z.
38 //
39 // Member Data:
40 //
41 // xSemiAxis semi-axis, x, without dimentions
42 // ySemiAxis semi-axis, y, without dimentions
43 // zheight height, z
44 // zTopCut upper cut plane level, z
45 //
46 // The height in Z corresponds to where the elliptical cone hits the
47 // Z-axis if it had no Z cut. Also the cone is centered at zero having a
48 // base at zTopCut and another at -zTopCut. The semi-major axes at the Z=0
49 // plane are given by xSemiAxis*zheight and ySemiAxis*zheight so that the
50 // curved surface of our cone satisfies the equation:
51 //
52 // ***************************************************************************
53 // * *
54 // * (x/xSemiAxis)^2 + (y/ySemiAxis)^2 = (zheight - z)^2 *
55 // * *
56 // ***************************************************************************
57 //
58 // In case you want to construct G4EllipticalCone from :
59 // 1. halflength in Z = zTopCut
60 // 2. Dx and Dy = halflength of ellipse axis at z = -zTopCut
61 // 3. dx and dy = halflength of ellipse axis at z = zTopCut
62 // ! Attention : dx/dy=Dx/Dy
63 //
64 // You need to find xSemiAxis,ySemiAxis and zheight:
65 //
66 // xSemiAxis = (Dx-dx)/(2*zTopCut)
67 // ySemiAxis = (Dy-dy)/(2*zTopCut)
68 // zheight = (Dx+dx)/(2*xSemiAxis)
69 //
70 // Author:
71 // Dionysios Anninos, 8.9.2005
72 //
73 // Revision:
74 // Lukas Lindroos, Tatiana Nikitina 20.08.2007
75 //
76 // --------------------------------------------------------------------
77 #ifndef G4EllipticalCone_HH
78 #define G4EllipticalCone_HH
79 
80 #include <CLHEP/Units/PhysicalConstants.h>
81 
82 #include "G4VSolid.hh"
83 #include "G4Polyhedron.hh"
84 
85 class G4EllipticalCone : public G4VSolid
86 {
87  public: // with description
88 
89  G4EllipticalCone(const G4String& pName,
90  G4double pxSemiAxis,
91  G4double pySemiAxis,
92  G4double zMax,
93  G4double pzTopCut);
94 
95  virtual ~G4EllipticalCone();
96 
97  // Access functions
98  //
99  inline G4double GetSemiAxisMax () const;
100  inline G4double GetSemiAxisX () const;
101  inline G4double GetSemiAxisY () const;
102  inline G4double GetZMax() const;
103  inline G4double GetZTopCut() const;
104  inline void SetSemiAxis (G4double x, G4double y, G4double z);
105  inline void SetZCut (G4double newzTopCut);
106 
107  inline G4double GetCubicVolume();
108  inline G4double GetSurfaceArea();
109 
110  // Solid standard methods
111  //
112  void Extent(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
113 
114  G4bool CalculateExtent(const EAxis pAxis,
115  const G4VoxelLimits& pVoxelLimit,
116  const G4AffineTransform& pTransform,
117  G4double& pMin, G4double& pMax) const;
118 
119  EInside Inside(const G4ThreeVector& p) const;
120 
121  G4ThreeVector SurfaceNormal( const G4ThreeVector& p) const;
122 
124  const G4ThreeVector& v) const;
125 
126  G4double DistanceToIn(const G4ThreeVector& p) const;
127 
129  const G4ThreeVector& v,
130  const G4bool calcNorm=G4bool(false),
131  G4bool *validNorm=0,
132  G4ThreeVector *n=0) const;
133 
134  G4double DistanceToOut(const G4ThreeVector& p) const;
135 
137 
138  G4VSolid* Clone() const;
139 
141 
142  std::ostream& StreamInfo(std::ostream& os) const;
143 
144  // Visualisation functions
145  //
146  G4Polyhedron* GetPolyhedron () const;
147  void DescribeYourselfTo(G4VGraphicsScene& scene) const;
148  G4VisExtent GetExtent() const;
150 
151  public: // without description
152 
153  G4EllipticalCone(__void__&);
154  // Fake default constructor for usage restricted to direct object
155  // persistency for clients requiring preallocation of memory for
156  // persistifiable objects.
157 
160  // Copy constructor and assignment operator.
161 
162  protected: // without description
163 
166 
167  private:
168 
171 
176 };
177 
178 #include "G4EllipticalCone.icc"
179 
180 #endif
G4VSolid * Clone() const
G4EllipticalCone & operator=(const G4EllipticalCone &rhs)
G4double GetSemiAxisX() const
CLHEP::Hep3Vector G4ThreeVector
EInside Inside(const G4ThreeVector &p) const
G4double GetCubicVolume()
G4Polyhedron * CreatePolyhedron() const
std::ostream & StreamInfo(std::ostream &os) const
G4ThreeVector GetPointOnSurface() const
G4double GetSemiAxisMax() const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
G4Polyhedron * fpPolyhedron
bool G4bool
Definition: G4Types.hh:79
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4EllipticalCone(const G4String &pName, G4double pxSemiAxis, G4double pySemiAxis, G4double zMax, G4double pzTopCut)
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4double GetZMax() const
const G4int n
void DescribeYourselfTo(G4VGraphicsScene &scene) const
G4double GetSemiAxisY() const
void SetSemiAxis(G4double x, G4double y, G4double z)
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
void SetZCut(G4double newzTopCut)
G4double GetZTopCut() const
double G4double
Definition: G4Types.hh:76
G4double GetSurfaceArea()
G4Polyhedron * GetPolyhedron() const
G4GeometryType GetEntityType() const
G4VisExtent GetExtent() const
virtual ~G4EllipticalCone()
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const