Geant4 9.6.0
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=0)
 
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 ()
 
virtual ~G4VPVParameterisation ()
 
virtual void ComputeTransformation (const G4int, G4VPhysicalVolume *) const =0
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
 
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 (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.) 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
 
G4double fwidth
 
G4double foffset
 
DivisionType fDivisionType
 
G4VSolidfmotherSolid
 
G4bool fReflectedSolid
 
G4bool fDeleteSolid
 
G4int theVoluFirstCopyNo
 
G4double kCarTolerance
 
G4double fhgap
 
- Static Protected Attributes inherited from G4VDivisionParameterisation
static G4int verbose = 5
 

Detailed Description

Definition at line 64 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 48 of file G4ParameterisationPolyhedra.cc.

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

◆ ~G4VParameterisationPolyhedra()

G4VParameterisationPolyhedra::~G4VParameterisationPolyhedra ( )
virtual

Definition at line 108 of file G4ParameterisationPolyhedra.cc.

109{
110}

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