Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PVParameterised.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// G4PVParameterised
27//
28// Class description:
29//
30// Represents many touchable detector elements differing in their
31// positioning and dimensions. Both are calculated by means
32// of a G4VParameterisation object. The positioning is assumed to
33// be dominant along a specified Cartesian axis.
34
35// Author: Paul Kent (CERN), 29.07.1995 - First non-stub version
36// ----------------------------------------------------------------------
37#ifndef G4PVPARAMETERISED_HH
38#define G4PVPARAMETERISED_HH
39
40#include "G4PVReplica.hh"
41
42/**
43 * @brief G4PVParameterised represents many touchable detector elements
44 * differing in their positioning and dimensions. Both are calculated by means
45 * of a G4VParameterisation object. The positioning is assumed to be dominant
46 * along a specified Cartesian axis.
47 */
48
49class G4PVParameterised : public G4PVReplica
50{
51 public:
52
53 /**
54 * Replicates the volume 'nReplicas' times using the paramaterisation
55 * 'pParam', within the mother volume 'pMotherLogical'.
56 * The positioning of the replicas is dominant along the specified axis.
57 * @param[in] pName The volume name.
58 * @param[in] pLogical Pointer to the logical volume of the replica.
59 * @param[in] pMotherLogical Pointer to the logical volume of the mother.
60 * @param[in] pAxis The axis along which do the replication.
61 * @param[in] nReplicas The number of copies to replicate.
62 * @param[in] pParam Pointer to the provided parameterisation algorithm.
63 * @param[in] pSurfChk Boolean flag, if true activates check for overlaps
64 * with existing volumes (false by default).
65 */
66 G4PVParameterised(const G4String& pName,
67 G4LogicalVolume* pLogical,
68 G4LogicalVolume* pMotherLogical,
69 const EAxis pAxis,
70 const G4int nReplicas,
72 G4bool pSurfChk = false);
73
74 /**
75 * Similar to the constructor above, except for the mother pointer's type
76 * being here a G4VPhysicalVolume.
77 * @param[in] pName The volume name.
78 * @param[in] pLogical Pointer to the logical volume of the replica.
79 * @param[in] pMother Pointer to the physical volume of the mother.
80 * @param[in] pAxis The axis along which do the replication.
81 * @param[in] nReplicas The number of copies to replicate.
82 * @param[in] pParam Pointer to the provided parameterisation algorithm.
83 * @param[in] pSurfChk Boolean flag, if true activates check for overlaps
84 * with existing volumes (false by default).
85 */
86 G4PVParameterised(const G4String& pName,
87 G4LogicalVolume* pLogical,
88 G4VPhysicalVolume* pMother,
89 const EAxis pAxis,
90 const G4int nReplicas,
92 G4bool pSurfChk = false);
93
94 /**
95 * Fake default constructor for usage restricted to direct object
96 * persistency for clients requiring preallocation of memory for
97 * persistifiable objects.
98 */
99 G4PVParameterised(__void__&);
100
101 /**
102 * Default Destructor.
103 */
104 ~G4PVParameterised() override = default;
105
106 /**
107 * Returns true to identify if it is a parameterised physical volume.
108 */
109 G4bool IsParameterised() const override;
110
111 /**
112 * Returns the volume type characterisation.
113 */
114 EVolume VolumeType() const final;
115
116 /**
117 * Returns the current pointer to the parameterisation algorithm.
118 */
120
121 /**
122 * Fills arguments with the attributes from the base replica.
123 * @param[in,out] axis Axis of parameterisation returned.
124 * @param[in,out] nReplicas The number of replica copies.
125 * @param[in,out] width Width of the replica object.
126 * @param[in,out] offset Potential offset in replication.
127 * @param[in,out] consuming Flag of replica characterisation (always false
128 * for parameterisations).
129 */
131 G4int& nReplicas,
132 G4double& width,
134 G4bool& consuming) const override;
135
136 /**
137 * Sets code and can prepare for special type of regular volumes.
138 */
139 void SetRegularStructureId( G4int code ) override;
140
141 /**
142 * Verifies if each instance of the parameterised volume is overlapping
143 * with other instances or with the mother volume. Provides default
144 * resolution for the number of points to be generated and verified.
145 * A tolerance for the precision of the overlap check can be specified,
146 * by default it is set to maximum precision.
147 * Reports a maximum of overlaps errors according to parameter in input.
148 * @param[in] res The number of points to generate on volume's surface.
149 * @param[in] tol The precision tolerance for the overlap check, below
150 * which to ignore overlaps (deafult is maximim precision).
151 * @param[in] verbose Verbosity mode (default is true).
152 * @param[in] maxErr Maximum of overlaps errors to report (default is 1).
153 * @returns True if an overlap occurs.
154 */
155 G4bool CheckOverlaps(G4int res = 1000, G4double tol = 0.,
156 G4bool verbose = true, G4int maxErr = 1) override;
157
158 private:
159
160 /** The pointer to the parameterisation algorithm. */
161 G4VPVParameterisation* fparam = nullptr;
162};
163
164#endif
G4ThreadLocal T * G4GeomSplitter< T >::offset
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
G4bool IsParameterised() const override
void SetRegularStructureId(G4int code) override
G4VPVParameterisation * GetParameterisation() const override
EVolume VolumeType() const final
G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true, G4int maxErr=1) override
void GetReplicationData(EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const override
G4PVParameterised(const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMotherLogical, const EAxis pAxis, const G4int nReplicas, G4VPVParameterisation *pParam, G4bool pSurfChk=false)
~G4PVParameterised() override=default
G4VPVParameterisation ia an abstract base class for Parameterisation, able to compute the transformat...
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
EAxis
Definition geomdefs.hh:54
EVolume
Definition geomdefs.hh:83
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668