51 std::ostringstream message;
63 message <<
"Generic construct for G4Polyhedra NOT supported." <<
G4endl
64 <<
"Sorry! Solid: " << msol->
GetName();
65 G4Exception(
"G4VParameterisationPolyhedra::G4VParameterisationPolyhedra()",
89 for (
G4int i=0; i<nofZplanes; ++i)
91 rminValues2[i] = rminValues[i] * ConvertRadiusFactor(*msol);
92 rmaxValues2[i] = rmaxValues[i] * ConvertRadiusFactor(*msol);
93 zValuesRefl[i] = - zValues[i];
101 nofZplanes, zValuesRefl, rminValues2, rmaxValues2);
103 delete [] rminValues2;
104 delete [] rmaxValues2;
105 delete [] zValuesRefl;
121G4VParameterisationPolyhedra::
122ConvertRadiusFactor(
const G4Polyhedra& phedra)
const
127 if ( (phiTotal <=0) || (phiTotal >
131 return std::cos(0.5*phiTotal/nofSides);
143 SetType(
"DivisionPolyhedraRho" );
151 - original_pars->
Rmin[0], width, offset );
156 - original_pars->
Rmin[0], nDiv, offset );
162 G4cout <<
" G4ParameterisationPolyhedraRho - # divisions " <<
fnDiv
163 <<
" = " << nDiv <<
G4endl
184 std::ostringstream message;
186 <<
"Division along R will be done with a width "
187 <<
"different for each solid section." <<
G4endl
188 <<
"WIDTH will not be used !";
189 G4Exception(
"G4ParameterisationPolyhedraRho::CheckParametersValidity()",
194 std::ostringstream message;
196 <<
"Division along R will be done with a width "
197 <<
"different for each solid section." <<
G4endl
198 <<
"OFFSET will not be used !";
199 G4Exception(
"G4ParameterisationPolyhedraRho::CheckParametersValidity()",
209 return original_pars->
Rmax[0] - original_pars->
Rmin[0];
229 <<
" foffset: " <<
foffset/CLHEP::deg
239 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyhedraRho "
241 <<
" Position: " << origin
261 for(
G4int ii = 0; ii < nZplanes; ++ii )
266 origparam.
Rmax[ii] = origparamMother->
Rmin[ii]+
foffset+width*(copyNo+1);
275 G4cout <<
"G4ParameterisationPolyhedraRho::ComputeDimensions()" <<
G4endl
276 <<
"-- Parametrised phedra copy-number: " << copyNo <<
G4endl;
290 SetType(
"DivisionPolyhedraPhi" );
305 G4cout <<
" G4ParameterisationPolyhedraPhi - # divisions " <<
fnDiv
306 <<
" = " << nDiv <<
G4endl
334 std::ostringstream message;
336 <<
" Division along PHI will be done splitting "
337 <<
"in the defined numSide." <<
G4endl
338 <<
"WIDTH will not be used !";
339 G4Exception(
"G4ParameterisationPolyhedraPhi::CheckParametersValidity()",
344 std::ostringstream message;
346 <<
"Division along PHI will be done splitting "
347 <<
"in the defined numSide." <<
G4endl
348 <<
"OFFSET will not be used !";
349 G4Exception(
"G4ParameterisationPolyhedraPhi::CheckParametersValidity()",
357 std::ostringstream message;
358 message <<
"Configuration not supported." <<
G4endl
359 <<
"Division along PHI will be done splitting in the defined"
361 <<
"numSide, i.e, the number of division would be :"
362 << origparamMother->
numSide <<
" instead of " <<
fnDiv <<
" !";
363 G4Exception(
"G4ParameterisationPolyhedraPhi::CheckParametersValidity()",
384 G4cout <<
" G4ParameterisationPolyhedraPhi - position: " << posi/CLHEP::deg
386 <<
" copyNo: " << copyNo
396 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyhedraPhi "
398 <<
" Position: " << origin <<
" - Width: " <<
fwidth
425 G4cout <<
"G4ParameterisationPolyhedraPhi::ComputeDimensions():" <<
G4endl;
437 fOrigParamMother(((
G4Polyhedra*)fmotherSolid)->GetOriginalParameters())
440 SetType(
"DivisionPolyhedraZ" );
446 - fOrigParamMother->
Z_values[0] , width, offset);
452 - fOrigParamMother->
Z_values[0] , nDiv, offset);
458 G4cout <<
" G4ParameterisationPolyhedraZ - # divisions " <<
fnDiv <<
" = "
481 return (r1-r2)/(z1-z2)*z + ( r1 - (r1-r2)/(z1-z2)*z1 ) ;
491 fOrigParamMother->
Rmin[nseg],
493 fOrigParamMother->
Rmin[nseg+1]);
503 fOrigParamMother->
Rmax[nseg],
505 fOrigParamMother->
Rmax[nseg+1]);
526 std::ostringstream message;
527 message <<
"Configuration not supported." <<
G4endl
528 <<
"Division along Z will be done splitting in the defined"
530 <<
"Z planes, i.e, the number of division would be :"
533 G4Exception(
"G4ParameterisationPolyhedraZ::CheckParametersValidity()",
546 G4int isegstart = -1;
558 while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 )
561 if ( zstart >= fOrigParamMother->
Z_values[counter] &&
562 zstart < fOrigParamMother->Z_values[counter+1] )
567 if ( zend > fOrigParamMother->
Z_values[counter] &&
568 zend <= fOrigParamMother->Z_values[counter+1] )
584 while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 )
587 if ( zstart <= fOrigParamMother->Z_values[counter] &&
588 zstart > fOrigParamMother->
Z_values[counter+1] )
593 if ( zend < fOrigParamMother->Z_values[counter] &&
594 zend >= fOrigParamMother->
Z_values[counter+1] )
602 if ( isegstart != isegend )
604 std::ostringstream message;
605 message <<
"Configuration not supported." <<
G4endl
606 <<
"Division with user defined width." <<
G4endl
608 <<
"Divided region is not between two Z planes.";
609 G4Exception(
"G4ParameterisationPolyhedraZ::CheckParametersValidity()",
613 fNSegment = isegstart;
627 posi = ( fOrigParamMother->
Z_values[copyNo]
628 + fOrigParamMother->
Z_values[copyNo+1])/2;
636 posi = fOrigParamMother->
Z_values[0];
651 G4cout <<
" G4ParameterisationPolyhedraZ - position: " << posi <<
G4endl
652 <<
" copyNo: " << copyNo <<
" - foffset: " <<
foffset/CLHEP::deg
662 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyhedraZ "
664 <<
" Position: (0,0,0) - Width: " <<
fwidth
698 + fOrigParamMother->
Z_values[copyNo+1])/2;
702 origparam.
Rmin[0] = fOrigParamMother->
Rmin[copyNo];
703 origparam.
Rmin[1] = fOrigParamMother->
Rmin[copyNo+1];
704 origparam.
Rmax[0] = fOrigParamMother->
Rmax[copyNo];
705 origparam.
Rmax[1] = fOrigParamMother->
Rmax[copyNo+1];
723 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
724 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
725 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
726 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
742 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
743 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
744 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
745 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
750 if ( origparam.
Rmin[0] < 0.0 ) origparam.
Rmin[0] = 0.0;
751 if ( origparam.
Rmin[nz-1] < 0.0 ) origparam.
Rmin[1] = 0.0;
760 G4cout <<
"G4ParameterisationPolyhedraZ::ComputeDimensions()" <<
G4endl
761 <<
"-- Parametrised phedra 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
static G4GeometryTolerance * GetInstance()
void CheckParametersValidity()
G4ParameterisationPolyhedraPhi(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
void ComputeDimensions(G4Polyhedra &phedra, const G4int copyNo, const G4VPhysicalVolume *physVol) const
~G4ParameterisationPolyhedraPhi()
G4double GetMaxParameter() const
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
void CheckParametersValidity()
void ComputeDimensions(G4Polyhedra &phedra, const G4int copyNo, const G4VPhysicalVolume *physVol) const
G4double GetMaxParameter() const
~G4ParameterisationPolyhedraRho()
G4ParameterisationPolyhedraRho(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
~G4ParameterisationPolyhedraZ()
G4ParameterisationPolyhedraZ(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
void ComputeDimensions(G4Polyhedra &phedra, const G4int copyNo, const G4VPhysicalVolume *physVol) const
void CheckParametersValidity()
G4double GetMaxParameter() const
G4double GetEndPhi() const
void SetOriginalParameters(G4PolyhedraHistorical *pars)
G4PolyhedraHistorical * GetOriginalParameters() const
G4double GetStartPhi() const
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
G4VParameterisationPolyhedra(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
virtual ~G4VParameterisationPolyhedra()
void SetTranslation(const G4ThreeVector &v)
virtual G4GeometryType GetEntityType() const =0