Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VParameterisationPolyhedra Class Reference

G4VParameterisationPolyhedra is the base class for the parameterised positioning equivalent to dividing a G4Polyhedra along one of each axis Rho, Phi, Z. More...

#include <G4ParameterisationPolyhedra.hh>

Inheritance diagram for G4VParameterisationPolyhedra:

Public Member Functions

 G4VParameterisationPolyhedra (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
 ~G4VParameterisationPolyhedra () override
Public Member Functions inherited from G4VDivisionParameterisation
 G4VDivisionParameterisation (EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
 ~G4VDivisionParameterisation () override
G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *pv) override
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const override=0
const G4StringGetType () const
EAxis GetAxis () const
G4int GetNoDiv () const
G4double GetWidth () const
G4double GetOffset () const
G4VSolidGetMotherSolid () const
void SetType (const G4String &type)
void SetHalfGap (G4double hg)
G4double GetHalfGap () const
Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()=default
virtual ~G4VPVParameterisation ()=default
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
virtual G4bool IsNested () const
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
virtual void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Tubs &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Trd &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Trap &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Cons &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Sphere &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Orb &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Torus &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Para &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Polycone &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const
virtual void ComputeDimensions (G4Hype &, const G4int, const G4VPhysicalVolume *) const

Additional Inherited Members

Protected Member Functions inherited from G4VDivisionParameterisation
void ChangeRotMatrix (G4VPhysicalVolume *physVol, G4double rotZ=0.0) const
G4int CalculateNDiv (G4double motherDim, G4double width, G4double offset) const
G4double CalculateWidth (G4double motherDim, G4int nDiv, G4double offset) const
virtual void CheckParametersValidity ()
void CheckOffset (G4double maxPar)
void CheckNDivAndWidth (G4double maxPar)
virtual G4double GetMaxParameter () const =0
G4double OffsetZ () const
Protected Attributes inherited from G4VDivisionParameterisation
G4String ftype
EAxis faxis
G4int fnDiv = 0
G4double fwidth = 0.0
G4double foffset = 0.0
DivisionType fDivisionType
G4VSolidfmotherSolid = nullptr
G4bool fReflectedSolid = false
G4bool fDeleteSolid = false
G4double kCarTolerance
G4double fhgap = 0.0
Static Protected Attributes inherited from G4VDivisionParameterisation
static G4ThreadLocal G4RotationMatrixfRot = nullptr
static const G4int verbose = 5

Detailed Description

G4VParameterisationPolyhedra is the base class for the parameterised positioning equivalent to dividing a G4Polyhedra along one of each axis Rho, Phi, Z.

Definition at line 64 of file G4ParameterisationPolyhedra.hh.

Constructor & Destructor Documentation

◆ G4VParameterisationPolyhedra()

G4VParameterisationPolyhedra::G4VParameterisationPolyhedra ( EAxis axis,
G4int nCopies,
G4double offset,
G4double step,
G4VSolid * pSolid,
DivisionType divType )

Initialises a parameterised polyhedra, given the axis of parameterisation 'axis' and the number of divided slices 'nCopies'.

Parameters
[in]axisThe axis along which apply the parameterisation.
[in]nCopiesThe total number of divided slices.
[in]offsetPotential initial offset along the axis.
[in]stepThe width of the divided slice.
[in]pSolidPointer to the original shape to parameterise.
[in]divTypeString identifier for the kind of division.

Definition at line 45 of file G4ParameterisationPolyhedra.cc.

49 : G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
50{
51 std::ostringstream message;
52 /* #ifdef G4MULTITHREADED
53 message << "Divisions for G4Polyhedra currently NOT supported in MT-mode."
54 << G4endl
55 << "Sorry! Solid: " << msolid->GetName();
56 G4Exception("G4VParameterisationPolyhedra::G4VParameterisationPolyhedra()",
57 "GeomDiv0001", FatalException, message);
58 #endif */
59
60 auto msol = (G4Polyhedra*)(msolid);
61 if ((msolid->GetEntityType() != "G4ReflectedSolid") && (msol->IsGeneric()))
62 {
63 message << "Generic construct for G4Polyhedra NOT supported." << G4endl
64 << "Sorry! Solid: " << msol->GetName();
65 G4Exception("G4VParameterisationPolyhedra::G4VParameterisationPolyhedra()",
66 "GeomDiv0001", FatalException, message);
67 }
68 if (msolid->GetEntityType() == "G4ReflectedSolid")
69 {
70 // Get constituent solid
71 //
72 G4VSolid* mConstituentSolid
73 = ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid();
74 msol = (G4Polyhedra*)(mConstituentSolid);
75
76 // Get parameters
77 //
78 G4int nofSides = msol->GetOriginalParameters()->numSide;
79 G4int nofZplanes = msol->GetOriginalParameters()->Num_z_planes;
80 G4double* zValues = msol->GetOriginalParameters()->Z_values;
81 G4double* rminValues = msol->GetOriginalParameters()->Rmin;
82 G4double* rmaxValues = msol->GetOriginalParameters()->Rmax;
83
84 // Invert z values, convert radius parameters
85 //
86 auto rminValues2 = new G4double[nofZplanes];
87 auto rmaxValues2 = new G4double[nofZplanes];
88 auto zValuesRefl = new G4double[nofZplanes];
89 for (G4int i=0; i<nofZplanes; ++i)
90 {
91 rminValues2[i] = rminValues[i] * ConvertRadiusFactor(*msol);
92 rmaxValues2[i] = rmaxValues[i] * ConvertRadiusFactor(*msol);
93 zValuesRefl[i] = - zValues[i];
94 }
95
96 auto newSolid
97 = new G4Polyhedra(msol->GetName(),
98 msol->GetStartPhi(),
99 msol->GetEndPhi() - msol->GetStartPhi(),
100 nofSides,
101 nofZplanes, zValuesRefl, rminValues2, rmaxValues2);
102
103 delete [] rminValues2;
104 delete [] rmaxValues2;
105 delete [] zValuesRefl;
106
107 msol = newSolid;
108 fmotherSolid = newSolid;
109 fReflectedSolid = true;
110 fDeleteSolid = true;
111 }
112}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4ThreadLocal T * G4GeomSplitter< T >::offset
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4VDivisionParameterisation(EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
const axis_t axis_to_type< N >::axis
Definition pugixml.cc:9668

Referenced by G4ParameterisationPolyhedraPhi::G4ParameterisationPolyhedraPhi(), G4ParameterisationPolyhedraRho::G4ParameterisationPolyhedraRho(), and G4ParameterisationPolyhedraZ::G4ParameterisationPolyhedraZ().

◆ ~G4VParameterisationPolyhedra()

G4VParameterisationPolyhedra::~G4VParameterisationPolyhedra ( )
overridedefault

Default Destructor.


The documentation for this class was generated from the following files: