50{
51 std::ostringstream message;
52
53
54
55
56
57
58
59
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()",
67 }
69 {
70
71
75
76
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
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
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;
111 }
112}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4VDivisionParameterisation(EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
virtual G4GeometryType GetEntityType() const =0