61 G4VSolid* mConstituentSolid
62 = ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid();
63 msol = (G4Polycone*)(mConstituentSolid);
67 G4int nofZplanes = msol->GetOriginalParameters()->Num_z_planes;
68 G4double* zValues = msol->GetOriginalParameters()->Z_values;
69 G4double* rminValues = msol->GetOriginalParameters()->Rmin;
70 G4double* rmaxValues = msol->GetOriginalParameters()->Rmax;
74 auto zValuesRefl = new G4double[nofZplanes];
75 for (G4int i=0; i<nofZplanes; ++i) { zValuesRefl[i] = - zValues[i]; }
80 msol->GetEndPhi() - msol->GetStartPhi(),
81 nofZplanes, zValuesRefl, rminValues, rmaxValues);
83 delete [] zValuesRefl;
103 SetType(
"DivisionPolyconeRho" );
111 - origparamMother->
Rmin[0], width, offset );
116 - origparamMother->
Rmin[0], nDiv, offset );
122 G4cout <<
" G4ParameterisationPolyconeRho - # divisions " <<
fnDiv
123 <<
" = " << nDiv <<
G4endl
142 std::ostringstream message;
143 message <<
"In solid " << msol->GetName() <<
G4endl
144 <<
"Division along R will be done with a width "
145 <<
"different for each solid section." <<
G4endl
146 <<
"WIDTH will not be used !";
147 G4Exception(
"G4VParameterisationPolycone::CheckParametersValidity()",
152 std::ostringstream message;
153 message <<
"In solid " << msol->GetName() <<
G4endl
154 <<
"Division along R will be done with a width "
155 <<
"different for each solid section." <<
G4endl
156 <<
"OFFSET will not be used !";
157 G4Exception(
"G4VParameterisationPolycone::CheckParametersValidity()",
167 return original_pars->
Rmax[0] - original_pars->
Rmin[0];
197 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyconeRho "
199 <<
" Position: (0,0,0)"
200 <<
" - Width: " <<
fwidth/CLHEP::deg
219 for(
G4int ii = 0; ii < nZplanes; ++ii )
224 origparam.
Rmax[ii] = origparamMother->
Rmin[ii]+
foffset+width*(copyNo+1);
233 G4cout <<
"G4ParameterisationPolyconeRho::ComputeDimensions()" <<
G4endl
234 <<
"-- Parametrised pcone copy-number: " << copyNo <<
G4endl;
248 SetType(
"DivisionPolyconePhi" );
251 G4double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
265 G4cout <<
" G4ParameterisationPolyconePhi - # divisions " <<
fnDiv
266 <<
" = " << nDiv <<
G4endl
267 <<
" Offset " <<
foffset/CLHEP::deg <<
" = " << offset/CLHEP::deg <<
G4endl
268 <<
" Width " <<
fwidth/CLHEP::deg <<
" = " << width/CLHEP::deg <<
G4endl;
280 return msol->GetEndPhi() - msol->GetStartPhi();
299 G4cout <<
" G4ParameterisationPolyconePhi - position: " << posi/CLHEP::deg
301 <<
" copyNo: " << copyNo <<
" - foffset: " <<
foffset/CLHEP::deg
311 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyconePhi "
313 <<
" Position: (0,0,0) - Width: " <<
fwidth
338 G4cout <<
"G4ParameterisationPolyconePhi::ComputeDimensions():" <<
G4endl;
350 fOrigParamMother(((
G4Polycone*)fmotherSolid)->GetOriginalParameters())
354 SetType(
"DivisionPolyconeZ" );
360 - fOrigParamMother->
Z_values[0] , width, offset );
366 - fOrigParamMother->
Z_values[0] , nDiv, offset );
372 G4cout <<
" G4ParameterisationPolyconeZ - # divisions " <<
fnDiv <<
" = "
393 return (r1-r2)/(z1-z2)*z + ( r1 - (r1-r2)/(z1-z2)*z1 ) ;
403 fOrigParamMother->
Rmin[nseg],
405 fOrigParamMother->
Rmin[nseg+1]);
415 fOrigParamMother->
Rmax[nseg],
417 fOrigParamMother->
Rmax[nseg+1]);
438 std::ostringstream error;
439 error <<
"Configuration not supported." <<
G4endl
440 <<
"Division along Z will be done by splitting in the defined"
442 <<
"Z planes, i.e, the number of division would be: "
444 <<
", instead of: " <<
fnDiv <<
" !";
445 G4Exception(
"G4ParameterisationPolyconeZ::CheckParametersValidity()",
458 G4int isegstart = -1;
471 while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 )
474 if ( zstart >= fOrigParamMother->
Z_values[counter] &&
475 zstart < fOrigParamMother->Z_values[counter+1] )
480 if ( zend > fOrigParamMother->
Z_values[counter] &&
481 zend <= fOrigParamMother->Z_values[counter+1] )
498 while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 )
501 if ( zstart <= fOrigParamMother->Z_values[counter] &&
502 zstart > fOrigParamMother->
Z_values[counter+1] )
507 if ( zend < fOrigParamMother->Z_values[counter] &&
508 zend >= fOrigParamMother->
Z_values[counter+1] )
517 if ( isegstart != isegend )
519 std::ostringstream message;
520 message <<
"Condiguration not supported." <<
G4endl
521 <<
"Division with user defined width." <<
G4endl
523 <<
"Divided region is not between two z planes.";
524 G4Exception(
"G4ParameterisationPolyconeZ::CheckParametersValidity()",
528 fNSegment = isegstart;
542 posi = ( fOrigParamMother->
Z_values[copyNo]
543 + fOrigParamMother->
Z_values[copyNo+1])/2;
551 posi = fOrigParamMother->
Z_values[0];
566 G4cout <<
" G4ParameterisationPolyconeZ - position: " << posi <<
G4endl
567 <<
" copyNo: " << copyNo <<
" - foffset: " <<
foffset/CLHEP::deg
577 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyconeZ "
579 <<
" Position: (0,0,0) - Width: " <<
fwidth
610 + fOrigParamMother->
Z_values[copyNo+1])/2;
614 origparam.
Rmin[0] = fOrigParamMother->
Rmin[copyNo];
615 origparam.
Rmin[1] = fOrigParamMother->
Rmin[copyNo+1];
616 origparam.
Rmax[0] = fOrigParamMother->
Rmax[copyNo];
617 origparam.
Rmax[1] = fOrigParamMother->
Rmax[copyNo+1];
636 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
637 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
638 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
639 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
655 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
656 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
657 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
658 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
663 if ( origparam.
Rmin[0] < 0.0 ) origparam.
Rmin[0] = 0.0;
664 if ( origparam.
Rmin[nz-1] < 0.0 ) origparam.
Rmin[1] = 0.0;
673 G4cout <<
"G4ParameterisationPolyconeZ::ComputeDimensions()" <<
G4endl
674 <<
"-- Parametrised pcone copy-number: " << copyNo <<
G4endl;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
G4double GetMaxParameter() const override
void ComputeDimensions(G4Polycone &pcone, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
~G4ParameterisationPolyconePhi() override
G4ParameterisationPolyconePhi(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
G4double GetMaxParameter() const override
void ComputeDimensions(G4Polycone &pcone, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
G4ParameterisationPolyconeRho(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
~G4ParameterisationPolyconeRho() override
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
void CheckParametersValidity() override
void ComputeDimensions(G4Polycone &pcone, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
~G4ParameterisationPolyconeZ() override
G4ParameterisationPolyconeZ(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
G4double GetMaxParameter() const override
void CheckParametersValidity() override
void SetOriginalParameters(G4PolyconeHistorical *pars)
virtual void CheckParametersValidity()
void SetType(const G4String &type)
G4double CalculateWidth(G4double motherDim, G4int nDiv, G4double offset) const
G4int CalculateNDiv(G4double motherDim, G4double width, G4double offset) const
static const G4int verbose
DivisionType fDivisionType
void ChangeRotMatrix(G4VPhysicalVolume *physVol, G4double rotZ=0.0) const
~G4VParameterisationPolycone() override
G4VParameterisationPolycone(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
void SetTranslation(const G4ThreeVector &v)
virtual G4GeometryType GetEntityType() const =0