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" );
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
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;
354 SetType(
"DivisionPolyconeZ" );
359 CalculateNDiv( fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
360 - fOrigParamMother->Z_values[0] , width,
offset );
365 CalculateNDiv( fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
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 ) ;
402 fOrigParamMother->Z_values[nseg],
403 fOrigParamMother->Rmin[nseg],
404 fOrigParamMother->Z_values[nseg+1],
405 fOrigParamMother->Rmin[nseg+1]);
414 fOrigParamMother->Z_values[nseg],
415 fOrigParamMother->Rmax[nseg],
416 fOrigParamMother->Z_values[nseg+1],
417 fOrigParamMother->Rmax[nseg+1]);
423 return std::abs (fOrigParamMother->Z_values[fOrigParamMother->Num_z_planes-1]
424 -fOrigParamMother->Z_values[0]);
436 if(
fnDiv > fOrigParamMother->Num_z_planes-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: "
443 << fOrigParamMother->Num_z_planes-1
444 <<
", instead of: " <<
fnDiv <<
" !";
445 G4Exception(
"G4ParameterisationPolyconeZ::CheckParametersValidity()",
458 G4int isegstart = -1;
466 = fOrigParamMother->Z_values[0] +
foffset;
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] )
493 = fOrigParamMother->Z_values[0] -
foffset;
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];
570 G4cout <<
" G4ParameterisationPolyconeZ - position: " << posi <<
G4endl
571 <<
" copyNo: " << copyNo <<
" - foffset: " <<
foffset/CLHEP::deg
581 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyconeZ "
583 <<
" Position: (0,0,0) - Width: " <<
fwidth
601 origparam.
Start_angle = fOrigParamMother->Start_angle;
613 G4double posi = (fOrigParamMother->Z_values[copyNo]
614 + fOrigParamMother->Z_values[copyNo+1])/2;
616 origparam.
Z_values[0] = fOrigParamMother->Z_values[copyNo] - posi;
617 origparam.
Z_values[1] = fOrigParamMother->Z_values[copyNo+1] - posi;
618 origparam.
Rmin[0] = fOrigParamMother->Rmin[copyNo];
619 origparam.
Rmin[1] = fOrigParamMother->Rmin[copyNo+1];
620 origparam.
Rmax[0] = fOrigParamMother->Rmax[copyNo];
621 origparam.
Rmax[1] = fOrigParamMother->Rmax[copyNo+1];
633 G4double posi = fOrigParamMother->Z_values[0]
640 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
641 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
642 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
643 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
652 G4double posi = fOrigParamMother->Z_values[0]
659 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
660 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
661 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
662 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
667 if ( origparam.
Rmin[0] < 0.0 ) { origparam.
Rmin[0] = 0.0; }
668 if ( origparam.
Rmin[nz-1] < 0.0 ) { origparam.
Rmin[1] = 0.0; }
677 G4cout <<
"G4ParameterisationPolyconeZ::ComputeDimensions()" <<
G4endl
678 <<
"-- Parametrised pcone copy-number: " << copyNo <<
G4endl;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4ThreadLocal T * G4GeomSplitter< T >::offset
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4ParameterisationPolyconePhi(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
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
G4double GetMaxParameter() const override
void ComputeDimensions(G4Polycone &pcone, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
~G4ParameterisationPolyconeRho() override
G4ParameterisationPolyconeRho(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
void CheckParametersValidity() override
void ComputeDimensions(G4Polycone &pcone, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
G4ParameterisationPolyconeZ(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const override
~G4ParameterisationPolyconeZ() override
G4double GetMaxParameter() const override
void CheckParametersValidity() override
G4PolyconeHistorical is a data structure for use in G4Polycone.
G4Polycone represents a composed closed shape (PCON) made of cones and cylinders, along the Z axis wi...
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
G4VDivisionParameterisation(EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
void ChangeRotMatrix(G4VPhysicalVolume *physVol, G4double rotZ=0.0) const
G4VParameterisationPolycone(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *pSolid, DivisionType divType)
~G4VParameterisationPolycone() override
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
void SetTranslation(const G4ThreeVector &v)
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
virtual G4GeometryType GetEntityType() const =0
const axis_t axis_to_type< N >::axis