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

#include <G4ParameterisationPolyhedra.hh>

+ Inheritance diagram for G4VParameterisationPolyhedra:

Public Member Functions

 G4VParameterisationPolyhedra (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
virtual ~G4VParameterisationPolyhedra ()
 
- Public Member Functions inherited from G4VDivisionParameterisation
 G4VDivisionParameterisation (EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
 
virtual ~G4VDivisionParameterisation ()
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
virtual void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const =0
 
const G4StringGetType () const
 
EAxis GetAxis () const
 
G4int GetNoDiv () const
 
G4double GetWidth () const
 
G4double GetOffset () const
 
G4VSolidGetMotherSolid () const
 
void SetType (const G4String &type)
 
G4int VolumeFirstCopyNo () const
 
void SetHalfGap (G4double hg)
 
G4double GetHalfGap () const
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()=default
 
virtual ~G4VPVParameterisation ()=default
 
virtual void ComputeTransformation (const G4int, G4VPhysicalVolume *) const =0
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
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
 
G4int theVoluFirstCopyNo = 1
 
G4double kCarTolerance
 
G4double fhgap = 0.0
 
- Static Protected Attributes inherited from G4VDivisionParameterisation
static G4ThreadLocal G4RotationMatrixfRot = nullptr
 
static const G4int verbose = 5
 

Detailed Description

Definition at line 58 of file G4ParameterisationPolyhedra.hh.

Constructor & Destructor Documentation

◆ G4VParameterisationPolyhedra()

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

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 G4Polyhedra* 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 G4double* rminValues2 = new G4double[nofZplanes];
87 G4double* rmaxValues2 = new G4double[nofZplanes];
88 G4double* 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 G4Polyhedra* 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)
Definition: G4Exception.cc:59
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4double GetEndPhi() const
G4PolyhedraHistorical * GetOriginalParameters() const
G4double GetStartPhi() const
G4bool IsGeneric() const
G4String GetName() const
virtual G4GeometryType GetEntityType() const =0

◆ ~G4VParameterisationPolyhedra()

G4VParameterisationPolyhedra::~G4VParameterisationPolyhedra ( )
virtual

Definition at line 115 of file G4ParameterisationPolyhedra.cc.

116{
117}

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