Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FConicalSurface.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// Class G4FConicalSurface
31//
32// Class description:
33//
34// Definition of a generic conical surface.
35/*
36 Position.axis|
37 |
38 -- ---|--- small_radius
39 l | / | \
40 e | / | \
41 n | / | \
42 g | / | \
43 t | / | \
44 h | / | \
45 -- ---------|--------- large_radius
46 Position
47*/
48
49// The code for G4FConicalSurface has been derived from the original
50// implementation in the "Gismo" package.
51//
52// Author: Alan Breakstone
53// Adaptation: J.Sulkimo, P.Urban.
54// Revisions by: L.Broglia, G.Cosmo.
55// ----------------------------------------------------------------------
56#ifndef __FCONIC_H
57#define __FCONIC_H
58
59#include "G4PointRat.hh"
60#include "G4Axis2Placement3D.hh"
61#include "G4Surface.hh"
62
64{
65
66 public: // with description
67
69 virtual ~G4FConicalSurface();
70 // Default constructor and destructor.
71
72 G4FConicalSurface( const G4Point3D& o, const G4Vector3D& a,
73 G4double l, G4double sr, G4double lr );
74 // o : origin of the G4FConicalSurface.
75 // a : axis of the G4FConicalSurface.
76 // l : length of the G4FConicalSurface.
77 // sl: small radius of the G4FConicalSurface.
78 // lr: large radius of the G4FConicalSurface.
79
80 virtual G4Vector3D SurfaceNormal( const G4Point3D& p ) const;
81 // Returns the normal to the surface on point p.
82
83 G4int Inside( const G4Vector3D& x ) const;
84 // Returns 0 if point x is outside G4ConicalSurface, 1 if Inside.
85
86 inline G4String GetEntityType() const;
87 // Returns the type identifier.
88
89 virtual const char* Name() const;
90 // Returns the class type name.
91
92 virtual void PrintOn( std::ostream& os = G4cout ) const;
93 // Printing function.
94
95 G4int operator==( const G4FConicalSurface& c ) const;
96 // Equality operator.
97
98 G4int Intersect( const G4Ray& ry );
99 // Counts the number of intersections of a bounded conical surface by a ray.
100 // At first, calculates the intersections with the semi-infinite
101 // conical surface; then, it counts the intersections within the
102 // finite conical surface boundaries, and sets the "distance" to the
103 // closest distance from the start point to the nearest intersection.
104 // If the point is on the surface it returns or the intersection with
105 // the opposite surface or kInfinity.
106 // If no intersection is found, it sets distance = kInfinity and returns 0.
107
108 void CalcBBox();
109 // Computes the bounding-box.
110
111 virtual G4double HowNear( const G4Vector3D& x ) const;
112 // Computes the shortest distance from the point x to the G4FConicalSurface.
113 // The distance will always be positive.
114 // This function works only with Cone axis equal (0,0,1) or (0,0,-1),
115 // it projects the surface and the point on the x,z plane and computes
116 // the distance in analytical way.
117
118 virtual G4int WithinBoundary( const G4Vector3D& x ) const;
119 // Returns 1 if the point x is within the boundary, returns 0 otherwise.
120
121 virtual G4double Scale() const;
122 // Returns the size of a G4FConicalSurface.
123 // Used for Scale-invariant tests of surface thickness.
124 // If the small radius is zero, returns the large radius.
125
126 virtual G4double Area() const;
127 // Calculates the area of a G4FConicalSurface.
128
129 virtual void resize( G4double l, G4double sr, G4double lr );
130 // Changes the radii and length of the G4FConicalSurface.
131 // - l (input) argument: the new length
132 // - sr (input) argument: the new small radius
133 // - lr (input) argument: the new large radius
134
135
136 inline G4double GetLength() const;
137 inline G4double GetSmallRadius() const;
138 inline G4double GetLargeRadius() const;
139 inline G4double GetTan_Angle() const;
140 // Accessors to dimensions of the G4FConicalSurface.
141
142protected:
143
145 // length of G4FConicalSurface
146
148 // small radius of G4FConicalSurface, can be zero
150 // large radius of G4FConicalSurface, must be greater than the small
151 // radius. Note that the angle of the G4ConicalSurface is calculated
152 // from these three quantities.
153
156
157private:
158
160 G4FConicalSurface& operator=(const G4FConicalSurface&);
161 // Private copy constructor and assignment operator.
162
163};
164
165#include "G4FConicalSurface.icc"
166
167#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
G4DLLIMPORT std::ostream G4cout
virtual const char * Name() const
virtual G4Vector3D SurfaceNormal(const G4Point3D &p) const
virtual G4double HowNear(const G4Vector3D &x) const
virtual G4double Area() const
virtual void resize(G4double l, G4double sr, G4double lr)
G4int Inside(const G4Vector3D &x) const
G4double GetLength() const
virtual void PrintOn(std::ostream &os=G4cout) const
G4double GetTan_Angle() const
G4int Intersect(const G4Ray &ry)
virtual G4double Scale() const
virtual G4int WithinBoundary(const G4Vector3D &x) const
virtual ~G4FConicalSurface()
G4double GetLargeRadius() const
G4String GetEntityType() const
G4Axis2Placement3D Position
G4int operator==(const G4FConicalSurface &c) const
G4double GetSmallRadius() const
Definition: G4Ray.hh:49