Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VNestedParameterisation.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// G4VNestedParameterisation
27//
28// Class description:
29//
30// Base class for parameterisations that use information from the parent
31// volume to compute the material of a copy/instance of this volume.
32// This is in addition to using the current replication number.
33//
34// Notes:
35// - Such a volume can be nested inside a placement volume or a parameterised
36// volume.
37// - The user can modify the solid type, size or transformation using only
38// the replication number of this parameterised volume.
39// He/she is NOT allowed to change these attributes using information of
40// parent volumes - otherwise incorrect results will occur.
41// Also note that the usual restrictions apply:
42// - the mother volume, in which these copies are placed, must always be
43// of the same dimensions
44
45// Author: John Apostolakis (CERN), 24.02.2005 - First created version
46// --------------------------------------------------------------------
47#ifndef G4VNESTEDPARAMETERISATION_HH
48#define G4VNESTEDPARAMETERISATION_HH
49
50#include "G4Types.hh"
53#include "G4VTouchable.hh"
54
56class G4VSolid;
57class G4Material;
58
59// CSG Entities which may be parameterised/replicated
60//
61class G4Box;
62class G4Tubs;
63class G4Trd;
64class G4Trap;
65class G4Cons;
66class G4Sphere;
67class G4Orb;
68class G4Ellipsoid;
69class G4Torus;
70class G4Para;
71class G4Polycone;
72class G4Polyhedra;
73class G4Hype;
74
75/**
76 * @brief G4VNestedParameterisation is a base class for parameterisations that
77 * use information from the parent volume to compute the material of a
78 * copy/instance of this volume. This is in addition to using the current
79 * replication number. Such a volume can be nested inside a placement volume
80 * or a parameterised volume. The user can modify the solid type, size or
81 * transformation using only the replication number of this parameterised
82 * volume; it is NOT allowed to change these attributes using information of
83 * the parent volumes, otherwise incorrect results will occur.
84 */
85
88{
89 public:
90
91 /**
92 * Default Constructor & Destructor.
93 */
95 ~G4VNestedParameterisation() override = default;
96
97 // Methods required in derived classes
98 // -----------------------------------
99
100 /**
101 * Computes the material for the 'currentVol' and replica number 'repNo'.
102 * It is a required method, as it is the reason for this class.
103 * Must cope with parentTouch=nullptr for navigator's SetupHierarchy().
104 * @param[in] currentVol Pointer to the current physical volume.
105 * @param[in] repNo The copy number index.
106 * @param[in] parentTouch Pointer to the touchable of the parent volume.
107 * @returns A pointer to the associated material.
108 */
110 const G4int repNo,
111 const G4VTouchable* parentTouch = nullptr)=0;
112
113 /**
114 * Accessors needed to define materials for instances of a Nested
115 * Parameterisation. Eeach call should return the materials of all
116 * instances with the same mother/ancestor volume.
117 */
118 G4int GetNumberOfMaterials() const override =0;
119 G4Material* GetMaterial(G4int idx) const override =0;
120
121 /**
122 * Computes the transformation for the 'currentPV' and replica number 'no'.
123 * It is a required method, as it is the reason for this class.
124 * Must cope with parentTouch=nullptr for navigator's SetupHierarchy().
125 * @param[in] currentPV Pointer to the current physical volume.
126 * @param[in] no The copy number index.
127 */
129 G4VPhysicalVolume* currentPV) const override=0;
130
131 // Methods optional in derived classes
132 // -----------------------------------
133
134 /**
135 * Computes the solid for the 'thisVol' volume and replica number 'no'.
136 * To be optionally defined in derived classes, for parameterisation of
137 * the solid type.
138 * @param[in] no The copy number index.
139 * @param[in] thisVol Pointer to the current physical volume.
140 */
141 G4VSolid* ComputeSolid(const G4int no, G4VPhysicalVolume* thisVol) override;
142
143 /**
144 * Method implemented in this class in terms of the above ComputeMaterial().
145 */
146 G4Material* ComputeMaterial(const G4int repNo,
147 G4VPhysicalVolume* currentVol,
148 const G4VTouchable* parentTouch = nullptr) override;
149
150 /**
151 * Methods to identify nested parameterisations. Required in order
152 * to enable material scan for nested parameterisations.
153 */
154 G4bool IsNested() const override;
156
157 // Dispatch methods for the specific solids where parameterisation is allowed
158 // --------------------------------------------------------------------------
159
161 const G4int,
162 const G4VPhysicalVolume *) const override {}
163
165 const G4int,
166 const G4VPhysicalVolume *) const override {}
167
169 const G4int,
170 const G4VPhysicalVolume *) const override {}
171
173 const G4int,
174 const G4VPhysicalVolume *) const override {}
175
177 const G4int,
178 const G4VPhysicalVolume *) const override {}
179
181 const G4int,
182 const G4VPhysicalVolume *) const override {}
183
185 const G4int,
186 const G4VPhysicalVolume *) const override {}
187
189 const G4int,
190 const G4VPhysicalVolume *) const override {}
191
193 const G4int,
194 const G4VPhysicalVolume *) const override {}
195
197 const G4int,
198 const G4VPhysicalVolume *) const override {}
199
201 const G4int,
202 const G4VPhysicalVolume *) const override {}
203
205 const G4int,
206 const G4VPhysicalVolume *) const override {}
207
209 const G4int,
210 const G4VPhysicalVolume *) const override {}
211};
212
213#endif
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4TouchableHistory G4VTouchable
G4VTouchable is a G4TouchableHistory object.
G4Box is a cuboid of given half lengths dx,dy,dz. The Box is centred on the origin with sides paralle...
Definition G4Box.hh:58
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
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
void ComputeDimensions(G4Trap &, const G4int, const G4VPhysicalVolume *) const override
G4Material * GetMaterial(G4int idx) const override=0
void ComputeDimensions(G4Hype &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Polycone &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Orb &, const G4int, const G4VPhysicalVolume *) const override
~G4VNestedParameterisation() override=default
G4VNestedParameterisation()=default
void ComputeTransformation(const G4int no, G4VPhysicalVolume *currentPV) const override=0
void ComputeDimensions(G4Trd &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Cons &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Para &, const G4int, const G4VPhysicalVolume *) const override
G4VVolumeMaterialScanner * GetMaterialScanner() override
G4int GetNumberOfMaterials() const override=0
void ComputeDimensions(G4Tubs &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Sphere &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Torus &, const G4int, const G4VPhysicalVolume *) const override
void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const override
G4VSolid * ComputeSolid(const G4int no, G4VPhysicalVolume *thisVol) override
virtual G4Material * ComputeMaterial(G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch=nullptr)=0
G4VPVParameterisation()=default
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
G4VVolumeMaterialScanner()=default