Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Polycone.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: G4Polycone.hh 76510 2013-11-12 10:28:06Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 //
34 // G4Polycone
35 //
36 // Class description:
37 //
38 // Class implementing a CSG-like type "PCON" Geant 3.21 volume,
39 // inherited from class G4VCSGfaceted:
40 //
41 // G4Polycone( const G4String& name,
42 // G4double phiStart, // initial phi starting angle
43 // G4double phiTotal, // total phi angle
44 // G4int numZPlanes, // number of z planes
45 // const G4double zPlane[], // position of z planes
46 // const G4double rInner[], // tangent distance to inner surface
47 // const G4double rOuter[]) // tangent distance to outer surface
48 //
49 // Alternative constructor, but limited to increasing-only Z sections:
50 //
51 // G4Polycone( const G4String& name,
52 // G4double phiStart, // initial phi starting angle
53 // G4double phiTotal, // total phi angle
54 // G4int numRZ, // number corners in r,z space
55 // const G4double r[], // r coordinate of these corners
56 // const G4double z[]) // z coordinate of these corners
57 
58 // Author:
59 // David C. Williams (davidw@scipp.ucsc.edu)
60 // --------------------------------------------------------------------
61 #ifndef G4Polycone_hh
62 #define G4Polycone_hh
63 
64 #if defined(G4GEOM_USE_USOLIDS)
65 #define G4GEOM_USE_UPOLYCONE 1
66 #endif
67 
68 #if defined(G4GEOM_USE_UPOLYCONE)
69  #define G4UPolycone G4Polycone
70  #include "G4UPolycone.hh"
71 #else
72 
73 #include "G4VCSGfaceted.hh"
74 #include "G4PolyconeSide.hh"
75 #include "G4PolyconeHistorical.hh"
76 
78 class G4ReduciblePolygon;
79 class G4VCSGface;
80 
81 class G4Polycone : public G4VCSGfaceted
82 {
83 
84  public: // with description
85 
86  G4Polycone( const G4String& name,
87  G4double phiStart, // initial phi starting angle
88  G4double phiTotal, // total phi angle
89  G4int numZPlanes, // number of z planes
90  const G4double zPlane[], // position of z planes
91  const G4double rInner[], // tangent distance to inner surface
92  const G4double rOuter[] ); // tangent distance to outer surface
93 
94  G4Polycone( const G4String& name,
95  G4double phiStart, // initial phi starting angle
96  G4double phiTotal, // total phi angle
97  G4int numRZ, // number corners in r,z space
98  const G4double r[], // r coordinate of these corners
99  const G4double z[] ); // z coordinate of these corners
100 
101  virtual ~G4Polycone();
102 
103  // Methods for solid
104 
105  EInside Inside( const G4ThreeVector &p ) const;
106  G4double DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const;
107  G4double DistanceToIn( const G4ThreeVector &p ) const;
108 
110 
112  const G4int n,
113  const G4VPhysicalVolume* pRep );
114 
116 
117  G4VSolid* Clone() const;
118 
119  std::ostream& StreamInfo(std::ostream& os) const;
120 
122 
123  G4bool Reset();
124 
125  // Accessors
126 
127  inline G4double GetStartPhi() const;
128  inline G4double GetEndPhi() const;
129  inline G4bool IsOpen() const;
130  inline G4int GetNumRZCorner() const;
131  inline G4PolyconeSideRZ GetCorner(G4int index) const;
133  inline void SetOriginalParameters(G4PolyconeHistorical* pars);
134 
135  public: // without description
136 
137  G4Polycone(__void__&);
138  // Fake default constructor for usage restricted to direct object
139  // persistency for clients requiring preallocation of memory for
140  // persistifiable objects.
141 
142  G4Polycone( const G4Polycone &source );
143  const G4Polycone &operator=( const G4Polycone &source );
144  // Copy constructor and assignment operator.
145 
146  protected: // without description
147 
148  // Generic initializer, called by all constructors
149 
151 
152  void Create( G4double phiStart, // initial phi starting angle
153  G4double phiTotal, // total phi angle
154  G4ReduciblePolygon *rz ); // r/z coordinate of these corners
155 
156  void CopyStuff( const G4Polycone &source );
157 
158  // Methods for random point generation
159 
161  G4double fRmin2, G4double fRmax2,
162  G4double zOne, G4double zTwo,
163  G4double& totArea) const;
164 
166  G4double zOne, G4double zTwo,
167  G4double& totArea) const;
168 
170  G4double fRMin2, G4double fRMax2,
171  G4double zOne, G4double zTwo,
172  G4double& totArea) const;
173 
175  G4double fRMin2, G4double fRMax2,
176  G4double zOne) const;
177 
178  protected: // without description
179 
180  // Here are our parameters
181 
182  G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
183  G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
184  G4bool phiIsOpen; // true if there is a phi segment
185  G4int numCorner; // number RZ points
186  G4PolyconeSideRZ *corners; // corner r,z points
187  G4PolyconeHistorical *original_parameters; // original input parameters
188 
189  // Our quick test
190 
192 
193 };
194 
195 #include "G4Polycone.icc"
196 
197 #endif
198 
199 #endif
G4Polyhedron * CreatePolyhedron() const
Definition: G4Polycone.cc:896
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Polycone.cc:516
G4bool IsOpen() const
G4ThreeVector GetPointOnSurface() const
Definition: G4Polycone.cc:808
G4double z
Definition: TRTMaterials.hh:39
G4double endPhi
Definition: G4Polycone.hh:183
G4ThreeVector GetPointOnRing(G4double fRMin, G4double fRMax, G4double fRMin2, G4double fRMax2, G4double zOne) const
Definition: G4Polycone.cc:746
const G4Polycone & operator=(const G4Polycone &source)
Definition: G4Polycone.cc:376
G4int GetNumRZCorner() const
const char * p
Definition: xmltok.h:285
const XML_Char * name
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Polycone.cc:488
G4PolyconeSideRZ * corners
Definition: G4Polycone.hh:186
G4double GetEndPhi() const
int G4int
Definition: G4Types.hh:78
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Polycone.cc:542
G4ThreeVector GetPointOnCone(G4double fRmin1, G4double fRmax1, G4double fRmin2, G4double fRmax2, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:594
G4GeometryType GetEntityType() const
Definition: G4Polycone.cc:526
G4ThreeVector GetPointOnCut(G4double fRMin1, G4double fRMax1, G4double fRMin2, G4double fRMax2, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:789
G4double startPhi
Definition: G4Polycone.hh:182
bool G4bool
Definition: G4Types.hh:79
virtual ~G4Polycone()
Definition: G4Polycone.cc:355
void SetOriginalParameters(G4PolyconeHistorical *pars)
EInside Inside(const G4ThreeVector &p) const
Definition: G4Polycone.cc:468
const G4int n
G4PolyconeHistorical * GetOriginalParameters() const
G4double GetStartPhi() const
G4bool Reset()
Definition: G4Polycone.cc:437
G4VSolid * Clone() const
Definition: G4Polycone.cc:534
void CopyStuff(const G4Polycone &source)
Definition: G4Polycone.cc:396
EInside
Definition: geomdefs.hh:58
G4EnclosingCylinder * enclosingCylinder
Definition: G4Polycone.hh:191
G4ThreeVector GetPointOnTubs(G4double fRMin, G4double fRMax, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:687
G4Polycone(const G4String &name, G4double phiStart, G4double phiTotal, G4int numZPlanes, const G4double zPlane[], const G4double rInner[], const G4double rOuter[])
Definition: G4Polycone.cc:59
G4bool phiIsOpen
Definition: G4Polycone.hh:184
G4int numCorner
Definition: G4Polycone.hh:185
void Create(G4double phiStart, G4double phiTotal, G4ReduciblePolygon *rz)
Definition: G4Polycone.cc:177
double G4double
Definition: G4Types.hh:76
G4PolyconeHistorical * original_parameters
Definition: G4Polycone.hh:187
G4PolyconeSideRZ GetCorner(G4int index) const