57 std::ostringstream message;
58 message <<
"Generic construct for G4Polyhedra NOT supported." <<
G4endl
59 <<
"Sorry! Solid: " << msol->
GetName();
60 G4Exception(
"G4VParameterisationPolyhedra::G4VParameterisationPolyhedra()",
82 for (
G4int i=0; i<nofZplanes; i++)
84 rminValues2[i] = rminValues[i] * ConvertRadiusFactor(*msol);
85 rmaxValues2[i] = rmaxValues[i] * ConvertRadiusFactor(*msol);
86 zValuesRefl[i] = - zValues[i];
94 nofZplanes, zValuesRefl, rminValues2, rmaxValues2);
96 delete [] rminValues2;
97 delete [] rmaxValues2;
98 delete [] zValuesRefl;
114 G4VParameterisationPolyhedra::
115 ConvertRadiusFactor(
const G4Polyhedra& phedra)
const
120 if ( (phiTotal <=0) || (phiTotal >
124 return std::cos(0.5*phiTotal/nofSides);
136 SetType(
"DivisionPolyhedraRho" );
144 - original_pars->
Rmin[0], width, offset );
149 - original_pars->
Rmin[0], nDiv, offset );
155 G4cout <<
" G4ParameterisationPolyhedraRho - # divisions " <<
fnDiv
156 <<
" = " << nDiv <<
G4endl
177 std::ostringstream message;
179 <<
"Division along R will be done with a width "
180 <<
"different for each solid section." <<
G4endl
181 <<
"WIDTH will not be used !";
182 G4Exception(
"G4ParameterisationPolyhedraRho::CheckParametersValidity()",
187 std::ostringstream message;
189 <<
"Division along R will be done with a width "
190 <<
"different for each solid section." <<
G4endl
191 <<
"OFFSET will not be used !";
192 G4Exception(
"G4ParameterisationPolyhedraRho::CheckParametersValidity()",
202 return original_pars->
Rmax[0] - original_pars->
Rmin[0];
232 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyhedraRho "
234 <<
" Position: " << origin
254 for(
G4int ii = 0; ii < nZplanes; ii++ )
259 origparam.
Rmax[ii] = origparamMother->
Rmin[ii]+
foffset+width*(copyNo+1);
268 G4cout <<
"G4ParameterisationPolyhedraRho::ComputeDimensions()" <<
G4endl
269 <<
"-- Parametrised phedra copy-number: " << copyNo <<
G4endl;
283 SetType(
"DivisionPolyhedraPhi" );
298 G4cout <<
" G4ParameterisationPolyhedraPhi - # divisions " <<
fnDiv
299 <<
" = " << nDiv <<
G4endl
327 std::ostringstream message;
329 <<
" Division along PHI will be done splitting "
330 <<
"in the defined numSide." <<
G4endl
331 <<
"WIDTH will not be used !";
332 G4Exception(
"G4ParameterisationPolyhedraPhi::CheckParametersValidity()",
337 std::ostringstream message;
339 <<
"Division along PHI will be done splitting "
340 <<
"in the defined numSide." <<
G4endl
341 <<
"OFFSET will not be used !";
342 G4Exception(
"G4ParameterisationPolyhedraPhi::CheckParametersValidity()",
350 std::ostringstream message;
351 message <<
"Configuration not supported." <<
G4endl
352 <<
"Division along PHI will be done splitting in the defined"
354 <<
"numSide, i.e, the number of division would be :"
355 << origparamMother->
numSide <<
" instead of " <<
fnDiv <<
" !";
356 G4Exception(
"G4ParameterisationPolyhedraPhi::CheckParametersValidity()",
377 G4cout <<
" G4ParameterisationPolyhedraPhi - position: " << posi/
deg
379 <<
" copyNo: " << copyNo
380 <<
" - fwidth: " << fwidth/
deg <<
G4endl;
389 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyhedraPhi " << copyNo
391 <<
" Position: " << origin <<
" - Width: " << fwidth
418 G4cout <<
"G4ParameterisationPolyhedraPhi::ComputeDimensions():" <<
G4endl;
431 fOrigParamMother(((
G4Polyhedra*)fmotherSolid)->GetOriginalParameters())
434 SetType(
"DivisionPolyhedraZ" );
440 - fOrigParamMother->
Z_values[0] , width, offset );
446 - fOrigParamMother->
Z_values[0] , nDiv, offset );
452 G4cout <<
" G4ParameterisationPolyhedraZ - # divisions " <<
fnDiv <<
" = "
475 return (r1-r2)/(z1-z2)*z + ( r1 - (r1-r2)/(z1-z2)*z1 ) ;
485 fOrigParamMother->
Rmin[nseg],
487 fOrigParamMother->
Rmin[nseg+1]);
497 fOrigParamMother->
Rmax[nseg],
499 fOrigParamMother->
Rmax[nseg+1]);
517 std::ostringstream message;
518 message <<
"Configuration not supported." <<
G4endl
519 <<
"Division along Z will be done splitting in the defined"
521 <<
"Z planes, i.e, the number of division would be :"
524 G4Exception(
"G4ParameterisationPolyhedraZ::CheckParametersValidity()",
535 G4int isegstart = -1;
546 while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 ) {
548 if ( zstart >= fOrigParamMother->
Z_values[counter] &&
549 zstart < fOrigParamMother->Z_values[counter+1] ) {
553 if ( zend > fOrigParamMother->
Z_values[counter] &&
554 zend <= fOrigParamMother->Z_values[counter+1] ) {
568 while ( isegend < 0 && counter < fOrigParamMother->Num_z_planes-1 ) {
570 if ( zstart <= fOrigParamMother->Z_values[counter] &&
571 zstart > fOrigParamMother->
Z_values[counter+1] ) {
575 if ( zend < fOrigParamMother->Z_values[counter] &&
576 zend >= fOrigParamMother->
Z_values[counter+1] ) {
583 if ( isegstart != isegend ) {
584 std::ostringstream message;
585 message <<
"Configuration not supported." <<
G4endl
586 <<
"Division with user defined width." <<
G4endl
588 <<
"Divided region is not between two Z planes.";
589 G4Exception(
"G4ParameterisationPolyhedraZ::CheckParametersValidity()",
593 fNSegment = isegstart;
605 + fOrigParamMother->
Z_values[copyNo+1])/2;
627 G4cout <<
" G4ParameterisationPolyhedraZ - position: " << posi <<
G4endl
628 <<
" copyNo: " << copyNo <<
" - foffset: " <<
foffset/
deg
638 G4cout << std::setprecision(8) <<
" G4ParameterisationPolyhedraZ "
640 <<
" Position: " << origin <<
" - Width: " <<
fwidth
670 + fOrigParamMother->
Z_values[copyNo+1])/2;
674 origparam.
Rmin[0] = fOrigParamMother->
Rmin[copyNo];
675 origparam.
Rmin[1] = fOrigParamMother->
Rmin[copyNo+1];
676 origparam.
Rmax[0] = fOrigParamMother->
Rmax[copyNo];
677 origparam.
Rmax[1] = fOrigParamMother->
Rmax[copyNo+1];
692 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
693 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
694 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
695 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
708 origparam.
Rmin[0] = GetRmin(zstart, fNSegment);
709 origparam.
Rmax[0] = GetRmax(zstart, fNSegment);
710 origparam.
Rmin[1] = GetRmin(zend, fNSegment);
711 origparam.
Rmax[1] = GetRmax(zend, fNSegment);
715 if ( origparam.
Rmin[0] < 0.0 ) origparam.
Rmin[0] = 0.0;
716 if ( origparam.
Rmin[nz-1] < 0.0 ) origparam.
Rmin[1] = 0.0;
725 G4cout <<
"G4ParameterisationPolyhedraZ::ComputeDimensions()" <<
G4endl
726 <<
"-- Parametrised phedra copy-number: " << copyNo <<
G4endl;