Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParameterisationPolyhedra.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// G4ParameterisationPolyhedra[Rho/Phi/Z]
27//
28// Class description:
29//
30// These classes represent the parameterised positioning equivalent to
31// dividing a G4Polyhedra along one of each axis Rho, Phi, Z.
32
33// Author: Pedro Arce (CIEMAT), 09.05.2001 - Initial version
34// Ivana Hrivnacova (Orsay), 08.04.2004 - Implemented reflection
35//---------------------------------------------------------------------
36#ifndef G4PARAMETERISATIONPOLYHEDRA_HH
37#define G4PARAMETERISATIONPOLYHEDRA_HH 1
38
40#include "G4Polyhedra.hh"
41
43
44// Dummy declarations to get rid of warnings ...
45//
46class G4Trd;
47class G4Trap;
48class G4Cons;
49class G4Sphere;
50class G4Orb;
51class G4Ellipsoid;
52class G4Torus;
53class G4Para;
54class G4Hype;
55class G4Tubs;
56class G4Polycone;
57
58/**
59 * @brief G4VParameterisationPolyhedra is the base class for the parameterised
60 * positioning equivalent to dividing a G4Polyhedra along one of each axis Rho,
61 * Phi, Z.
62 */
63
65{
66 public:
67
68 /**
69 * Initialises a parameterised polyhedra, given the axis of parameterisation
70 * 'axis' and the number of divided slices 'nCopies'.
71 * @param[in] axis The axis along which apply the parameterisation.
72 * @param[in] nCopies The total number of divided slices.
73 * @param[in] offset Potential initial offset along the axis.
74 * @param[in] step The width of the divided slice.
75 * @param[in] pSolid Pointer to the original shape to parameterise.
76 * @param[in] divType String identifier for the kind of division.
77 */
80 G4VSolid* pSolid, DivisionType divType );
81
82 /**
83 * Default Destructor.
84 */
86
87 private:
88
89 /**
90 * Converts radius of the sides to radius of the corners:
91 * i.e. - r_corners = r_sides/factor.
92 * @returns The cosine of (0.5*phiTotal/nofSides).
93 */
94 G4double ConvertRadiusFactor(const G4Polyhedra& phedra) const;
95
96};
97
98/**
99 * @brief G4ParameterisationPolyhedraRho represents the parameterised positioning
100 * equivalent to dividing a G4Polyhedra along Rho axis.
101 */
102
104{
105 public:
106
107 /**
108 * Initialises a parameterised polyhedra, along the Rho axis.
109 * @param[in] axis The axis along which apply the parameterisation.
110 * @param[in] nCopies The total number of divided slices.
111 * @param[in] offset Potential initial offset along the axis.
112 * @param[in] step The width of the divided slice.
113 * @param[in] pSolid Pointer to the original shape to parameterise.
114 * @param[in] divType String identifier for the kind of division.
115 */
118 G4VSolid* pSolid,
119 DivisionType divType );
120
121 /**
122 * Default Destructor.
123 */
125
126 /**
127 * Checks the validity of parameters given in input, issuing an exception.
128 */
129 void CheckParametersValidity() override;
130
131 /**
132 * Returns the max width along Rho.
133 * @returns The maximum width of the solid to divide along the Rho axis.
134 */
135 G4double GetMaxParameter() const override;
136
137 /**
138 * Concrete methods implementing the parameterisation.
139 */
140 void ComputeTransformation( const G4int copyNo,
141 G4VPhysicalVolume* physVol ) const override;
142 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
143 const G4VPhysicalVolume* physVol ) const override;
144
145 private: // Dummy declarations to get rid of warnings ...
146
147 void ComputeDimensions (G4Trd&,const G4int,
148 const G4VPhysicalVolume*) const override {}
149 void ComputeDimensions (G4Trap&,const G4int,
150 const G4VPhysicalVolume*) const override {}
151 void ComputeDimensions (G4Box&,const G4int,
152 const G4VPhysicalVolume*) const override {}
153 void ComputeDimensions (G4Sphere&,const G4int,
154 const G4VPhysicalVolume*) const override {}
155 void ComputeDimensions (G4Orb&,const G4int,
156 const G4VPhysicalVolume*) const override {}
157 void ComputeDimensions (G4Ellipsoid&,const G4int,
158 const G4VPhysicalVolume*) const override {}
159 void ComputeDimensions (G4Torus&,const G4int,
160 const G4VPhysicalVolume*) const override {}
161 void ComputeDimensions (G4Para&,const G4int,
162 const G4VPhysicalVolume*) const override {}
163 void ComputeDimensions (G4Hype&,const G4int,
164 const G4VPhysicalVolume*) const override {}
165 void ComputeDimensions (G4Tubs&,const G4int,
166 const G4VPhysicalVolume*) const override {}
167 void ComputeDimensions (G4Cons&,const G4int,
168 const G4VPhysicalVolume*) const override {}
169 void ComputeDimensions (G4Polycone&,const G4int,
170 const G4VPhysicalVolume*) const override {}
171};
172
173/**
174 * @brief G4ParameterisationPolyhedraPhi represents the parameterised positioning
175 * equivalent to dividing a G4Polyhedra along Phi axis.
176 */
177
179{
180 public:
181
182 /**
183 * Initialises a parameterised polyhedra, along the Phi axis.
184 * @param[in] axis The axis along which apply the parameterisation.
185 * @param[in] nCopies The total number of divided slices.
186 * @param[in] offset Potential initial offset along the axis.
187 * @param[in] step The width of the divided slice.
188 * @param[in] pSolid Pointer to the original shape to parameterise.
189 * @param[in] divType String identifier for the kind of division.
190 */
193 G4VSolid* pSolid,
194 DivisionType divType );
195
196 /**
197 * Default Destructor.
198 */
200
201 /**
202 * Checks the validity of parameters given in input, issuing an exception.
203 */
204 void CheckParametersValidity() override;
205
206 /**
207 * Returns the max width along Phi.
208 * @returns The maximum width of the solid to divide along the Phi axis.
209 */
210 G4double GetMaxParameter() const override;
211
212 /**
213 * Concrete methods implementing the parameterisation.
214 */
215 void ComputeTransformation( const G4int copyNo,
216 G4VPhysicalVolume* physVol ) const override;
217 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
218 const G4VPhysicalVolume* physVol ) const override;
219
220 private: // Dummy declarations to get rid of warnings ...
221
222 void ComputeDimensions (G4Trd&,const G4int,
223 const G4VPhysicalVolume*) const override {}
224 void ComputeDimensions (G4Trap&,const G4int,
225 const G4VPhysicalVolume*) const override {}
226 void ComputeDimensions (G4Box&,const G4int,
227 const G4VPhysicalVolume*) const override {}
228 void ComputeDimensions (G4Sphere&,const G4int,
229 const G4VPhysicalVolume*) const override {}
230 void ComputeDimensions (G4Orb&,const G4int,
231 const G4VPhysicalVolume*) const override {}
232 void ComputeDimensions (G4Ellipsoid&,const G4int,
233 const G4VPhysicalVolume*) const override {}
234 void ComputeDimensions (G4Torus&,const G4int,
235 const G4VPhysicalVolume*) const override {}
236 void ComputeDimensions (G4Para&,const G4int,
237 const G4VPhysicalVolume*) const override {}
238 void ComputeDimensions (G4Hype&,const G4int,
239 const G4VPhysicalVolume*) const override {}
240 void ComputeDimensions (G4Tubs&,const G4int,
241 const G4VPhysicalVolume*) const override {}
242 void ComputeDimensions (G4Cons&,const G4int,
243 const G4VPhysicalVolume*) const override {}
244 void ComputeDimensions (G4Polycone&,const G4int,
245 const G4VPhysicalVolume*) const override {}
246};
247
248/**
249 * @brief G4ParameterisationPolyhedraZ represents the parameterised positioning
250 * equivalent to dividing a G4Polyhedra along Z axis.
251 */
252
254{
255 public:
256
257 /**
258 * Initialises a parameterised polyhedra, along the Z axis.
259 * @param[in] axis The axis along which apply the parameterisation.
260 * @param[in] nCopies The total number of divided slices.
261 * @param[in] offset Potential initial offset along the axis.
262 * @param[in] step The width of the divided slice.
263 * @param[in] pSolid Pointer to the original shape to parameterise.
264 * @param[in] divType String identifier for the kind of division.
265 */
268 G4VSolid* pSolid,
269 DivisionType divType );
270
271 /**
272 * Default Destructor.
273 */
275
276 /**
277 * Checks the validity of parameters given in input, issuing an exception.
278 */
279 void CheckParametersValidity() override;
280
281 /**
282 * Returns the max width along Z.
283 * @returns The maximum width of the solid to divide along the Z axis.
284 */
285 G4double GetMaxParameter() const override;
286
287 /**
288 * Concrete methods implementing the parameterisation.
289 */
290 void ComputeTransformation( const G4int copyNo,
291 G4VPhysicalVolume* physVol ) const override;
292 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo,
293 const G4VPhysicalVolume* physVol ) const override;
294
295 private:
296
297 /**
298 * Internal accessors for the original R parameters of the solid to divide.
299 */
300 G4double GetR(G4double z, G4double z1, G4double r1,
301 G4double z2, G4double r2) const;
302 G4double GetRmin(G4double z, G4int nsegment) const;
303 G4double GetRmax(G4double z, G4int nsegment) const;
304
305 // Dummy declarations to get rid of warnings ...
306 void ComputeDimensions (G4Trd&,const G4int,
307 const G4VPhysicalVolume*) const override {}
308 void ComputeDimensions (G4Trap&,const G4int,
309 const G4VPhysicalVolume*) const override {}
310 void ComputeDimensions (G4Box&,const G4int,
311 const G4VPhysicalVolume*) const override {}
312 void ComputeDimensions (G4Sphere&,const G4int,
313 const G4VPhysicalVolume*) const override {}
314 void ComputeDimensions (G4Orb&,const G4int,
315 const G4VPhysicalVolume*) const override {}
316 void ComputeDimensions (G4Ellipsoid&,const G4int,
317 const G4VPhysicalVolume*) const override {}
318 void ComputeDimensions (G4Torus&,const G4int,
319 const G4VPhysicalVolume*) const override {}
320 void ComputeDimensions (G4Para&,const G4int,
321 const G4VPhysicalVolume*) const override {}
322 void ComputeDimensions (G4Hype&,const G4int,
323 const G4VPhysicalVolume*) const override {}
324 void ComputeDimensions (G4Tubs&,const G4int,
325 const G4VPhysicalVolume*) const override {}
326 void ComputeDimensions (G4Cons&,const G4int,
327 const G4VPhysicalVolume*) const override {}
328 void ComputeDimensions (G4Polycone&,const G4int,
329 const G4VPhysicalVolume*) const override {}
330 private:
331
332 G4int fNSegment = 0;
333 G4PolyhedraHistorical* fOrigParamMother = nullptr;
334};
335
336#endif
G4ThreadLocal T * G4GeomSplitter< T >::offset
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
G4Cons is, in the general case, a Phi segment of a cone, with half-length fDz, inner and outer radii ...
Definition G4Cons.hh:85
G4Ellipsoid is an ellipsoidal solid, optionally cut at a given Z.
G4Hype is a tube with hyperbolic profile; it describes an hyperbolic volume with curved sides paralle...
Definition G4Hype.hh:72
G4Orb represents a full sphere.
Definition G4Orb.hh:59
G4Para represents a parallelepiped, essentially a box with half lengths dx,dy,dz 'skewed' so that the...
Definition G4Para.hh:86
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
G4ParameterisationPolyhedraPhi(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
~G4ParameterisationPolyhedraPhi() override
void ComputeDimensions(G4Polyhedra &phedra, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
void ComputeDimensions(G4Polyhedra &phedra, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
G4ParameterisationPolyhedraRho(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
~G4ParameterisationPolyhedraRho() override
~G4ParameterisationPolyhedraZ() override
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
G4ParameterisationPolyhedraZ(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
void ComputeDimensions(G4Polyhedra &phedra, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
G4Polycone represents a composed closed shape (PCON) made of cones and cylinders, along the Z axis wi...
Definition G4Polycone.hh:82
G4Polyhedra represents a composed closed polyhedra (PGON) made of planar sizes along the Z axis,...
G4Sphere is, in the general case, a section of a spherical shell, between specified phi and theta ang...
Definition G4Sphere.hh:89
G4Torus represents a torus or torus segment with curved sides parallel to the z-axis....
Definition G4Torus.hh:102
G4Trap is a general trapezoid: the faces perpendicular to the Z planes are trapezia,...
Definition G4Trap.hh:116
G4Trd is a trapezoid with the X and Y dimensions varying along Z.
Definition G4Trd.hh:65
G4Tubs is a tube or tube segment with curved sides parallel to the Z-axis. The tube has a specified h...
Definition G4Tubs.hh:85
G4VDivisionParameterisation(EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
~G4VParameterisationPolyhedra() override
G4VParameterisationPolyhedra(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
Definition G4VSolid.hh:80
EAxis
Definition geomdefs.hh:54
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668