Geant4  10.00.p02
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 81641 2014-06-04 09:11:38Z 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 #include "G4Polyhedron.hh"
77 
79 class G4ReduciblePolygon;
80 class G4VCSGface;
81 
82 class G4Polycone : public G4VCSGfaceted
83 {
84 
85  public: // with description
86 
87  G4Polycone( const G4String& name,
88  G4double phiStart, // initial phi starting angle
89  G4double phiTotal, // total phi angle
90  G4int numZPlanes, // number of z planes
91  const G4double zPlane[], // position of z planes
92  const G4double rInner[], // tangent distance to inner surface
93  const G4double rOuter[] ); // tangent distance to outer surface
94 
95  G4Polycone( const G4String& name,
96  G4double phiStart, // initial phi starting angle
97  G4double phiTotal, // total phi angle
98  G4int numRZ, // number corners in r,z space
99  const G4double r[], // r coordinate of these corners
100  const G4double z[] ); // z coordinate of these corners
101 
102  virtual ~G4Polycone();
103 
104  // Methods for solid
105 
106  EInside Inside( const G4ThreeVector &p ) const;
107  G4double DistanceToIn( const G4ThreeVector &p, const G4ThreeVector &v ) const;
108  G4double DistanceToIn( const G4ThreeVector &p ) const;
109 
111 
113  const G4int n,
114  const G4VPhysicalVolume* pRep );
115 
117 
118  G4VSolid* Clone() const;
119 
120  std::ostream& StreamInfo(std::ostream& os) const;
121 
123 
124  G4bool Reset();
125 
126  // Accessors
127 
128  inline G4double GetStartPhi() const;
129  inline G4double GetEndPhi() const;
130  inline G4bool IsOpen() const;
131  inline G4int GetNumRZCorner() const;
132  inline G4PolyconeSideRZ GetCorner(G4int index) const;
134  inline void SetOriginalParameters(G4PolyconeHistorical* pars);
135 
136  public: // without description
137 
138  G4Polycone(__void__&);
139  // Fake default constructor for usage restricted to direct object
140  // persistency for clients requiring preallocation of memory for
141  // persistifiable objects.
142 
143  G4Polycone( const G4Polycone &source );
144  G4Polycone &operator=( const G4Polycone &source );
145  // Copy constructor and assignment operator.
146 
147  protected: // without description
148 
149  // Generic initializer, called by all constructors
150 
152 
153  void Create( G4double phiStart, // initial phi starting angle
154  G4double phiTotal, // total phi angle
155  G4ReduciblePolygon *rz ); // r/z coordinate of these corners
156 
157  void CopyStuff( const G4Polycone &source );
158 
159  // Methods for random point generation
160 
162  G4double fRmin2, G4double fRmax2,
163  G4double zOne, G4double zTwo,
164  G4double& totArea) const;
165 
167  G4double zOne, G4double zTwo,
168  G4double& totArea) const;
169 
171  G4double fRMin2, G4double fRMax2,
172  G4double zOne, G4double zTwo,
173  G4double& totArea) const;
174 
176  G4double fRMin2, G4double fRMax2,
177  G4double zOne) const;
178 
179  protected: // without description
180 
181  // Here are our parameters
182 
183  G4double startPhi; // Starting phi value (0 < phiStart < 2pi)
184  G4double endPhi; // end phi value (0 < endPhi-phiStart < 2pi)
185  G4bool phiIsOpen; // true if there is a phi segment
186  G4int numCorner; // number RZ points
187  G4PolyconeSideRZ *corners; // corner r,z points
188  G4PolyconeHistorical *original_parameters; // original input parameters
189 
190  // Our quick test
191 
193 
194 };
195 
196 #include "G4Polycone.icc"
197 
198 #endif
199 
200 #endif
G4Polyhedron * CreatePolyhedron() const
Definition: G4Polycone.cc:897
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4Polycone.cc:517
CLHEP::Hep3Vector G4ThreeVector
G4bool IsOpen() const
G4ThreeVector GetPointOnSurface() const
Definition: G4Polycone.cc:809
G4double z
Definition: TRTMaterials.hh:39
G4double endPhi
Definition: G4Polycone.hh:184
G4ThreeVector GetPointOnRing(G4double fRMin, G4double fRMax, G4double fRMin2, G4double fRMax2, G4double zOne) const
Definition: G4Polycone.cc:747
G4int GetNumRZCorner() const
G4String name
Definition: TRTMaterials.hh:40
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
Definition: G4Polycone.cc:489
G4PolyconeSideRZ * corners
Definition: G4Polycone.hh:187
G4double GetEndPhi() const
int G4int
Definition: G4Types.hh:78
std::ostream & StreamInfo(std::ostream &os) const
Definition: G4Polycone.cc:543
G4ThreeVector GetPointOnCone(G4double fRmin1, G4double fRmax1, G4double fRmin2, G4double fRmax2, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:595
G4GeometryType GetEntityType() const
Definition: G4Polycone.cc:527
G4ThreeVector GetPointOnCut(G4double fRMin1, G4double fRMax1, G4double fRMin2, G4double fRMax2, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:790
G4Polycone & operator=(const G4Polycone &source)
Definition: G4Polycone.cc:375
G4double startPhi
Definition: G4Polycone.hh:183
bool G4bool
Definition: G4Types.hh:79
virtual ~G4Polycone()
Definition: G4Polycone.cc:354
void SetOriginalParameters(G4PolyconeHistorical *pars)
EInside Inside(const G4ThreeVector &p) const
Definition: G4Polycone.cc:469
const G4int n
G4PolyconeHistorical * GetOriginalParameters() const
G4double GetStartPhi() const
G4bool Reset()
Definition: G4Polycone.cc:438
G4VSolid * Clone() const
Definition: G4Polycone.cc:535
void CopyStuff(const G4Polycone &source)
Definition: G4Polycone.cc:395
EInside
Definition: geomdefs.hh:58
G4EnclosingCylinder * enclosingCylinder
Definition: G4Polycone.hh:192
G4ThreeVector GetPointOnTubs(G4double fRMin, G4double fRMax, G4double zOne, G4double zTwo, G4double &totArea) const
Definition: G4Polycone.cc:688
G4Polycone(const G4String &name, G4double phiStart, G4double phiTotal, G4int numZPlanes, const G4double zPlane[], const G4double rInner[], const G4double rOuter[])
Definition: G4Polycone.cc:58
G4bool phiIsOpen
Definition: G4Polycone.hh:185
G4int numCorner
Definition: G4Polycone.hh:186
void Create(G4double phiStart, G4double phiTotal, G4ReduciblePolygon *rz)
Definition: G4Polycone.cc:176
double G4double
Definition: G4Types.hh:76
G4PolyconeHistorical * original_parameters
Definition: G4Polycone.hh:188
G4PolyconeSideRZ GetCorner(G4int index) const