Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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$
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
81
82#include "G4VSolid.hh"
83
85{
86 public: // with description
87
88 G4EllipticalCone(const G4String& pName,
89 G4double pxSemiAxis,
90 G4double pySemiAxis,
91 G4double zMax,
92 G4double pzTopCut);
93
94 virtual ~G4EllipticalCone();
95
96 // Access functions
97 //
98 inline G4double GetSemiAxisMax () const;
99 inline G4double GetSemiAxisX () const;
100 inline G4double GetSemiAxisY () const;
101 inline G4double GetZMax() const;
102 inline G4double GetZTopCut() const;
103 inline void SetSemiAxis (G4double x, G4double y, G4double z);
104 inline void SetZCut (G4double newzTopCut);
105
108
109 // Solid standard methods
110 //
111 G4bool CalculateExtent(const EAxis pAxis,
112 const G4VoxelLimits& pVoxelLimit,
113 const G4AffineTransform& pTransform,
114 G4double& pmin, G4double& pmax) const;
115
116 EInside Inside(const G4ThreeVector& p) const;
117
119
121 const G4ThreeVector& v) const;
122
123 G4double DistanceToIn(const G4ThreeVector& p) const;
124
126 const G4ThreeVector& v,
127 const G4bool calcNorm=G4bool(false),
128 G4bool *validNorm=0,
129 G4ThreeVector *n=0) const;
130
131 G4double DistanceToOut(const G4ThreeVector& p) const;
132
134
135 G4VSolid* Clone() const;
136
138
139 std::ostream& StreamInfo(std::ostream& os) const;
140
141 // Visualisation functions
142 //
143 G4Polyhedron* GetPolyhedron () const;
144 void DescribeYourselfTo(G4VGraphicsScene& scene) const;
145 G4VisExtent GetExtent() const;
147 G4NURBS* CreateNURBS() const;
148
149 public: // without description
150
151 G4EllipticalCone(__void__&);
152 // Fake default constructor for usage restricted to direct object
153 // persistency for clients requiring preallocation of memory for
154 // persistifiable objects.
155
158 // Copy constructor and assignment operator.
159
160 protected: // without description
161
163 G4int& noPV) const;
164
166
167 private:
168
169 G4double kRadTolerance;
170
171 G4double fCubicVolume;
172 G4double fSurfaceArea;
173 G4double xSemiAxis, ySemiAxis, zheight,
174 semiAxisMax, zTopCut;
175};
176
177#include "G4EllipticalCone.icc"
178
179#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
std::vector< G4ThreeVector > G4ThreeVectorList
Definition: G4VSolid.hh:85
G4VisExtent GetExtent() const
void SetSemiAxis(G4double x, G4double y, G4double z)
G4Polyhedron * GetPolyhedron() const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pmin, G4double &pmax) const
G4NURBS * CreateNURBS() const
G4double GetSemiAxisMax() const
G4GeometryType GetEntityType() const
G4VSolid * Clone() const
G4double GetSurfaceArea()
void SetZCut(G4double newzTopCut)
G4double GetSemiAxisX() const
virtual ~G4EllipticalCone()
G4ThreeVector GetPointOnSurface() const
G4ThreeVectorList * CreateRotatedVertices(const G4AffineTransform &pT, G4int &noPV) const
G4Polyhedron * CreatePolyhedron() const
G4Polyhedron * fpPolyhedron
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4double GetSemiAxisY() const
G4double GetCubicVolume()
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=G4bool(false), G4bool *validNorm=0, G4ThreeVector *n=0) const
std::ostream & StreamInfo(std::ostream &os) const
G4double GetZMax() const
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
EInside Inside(const G4ThreeVector &p) const
G4double GetZTopCut() const
G4EllipticalCone & operator=(const G4EllipticalCone &rhs)
void DescribeYourselfTo(G4VGraphicsScene &scene) const
EAxis
Definition: geomdefs.hh:54
EInside
Definition: geomdefs.hh:58