42 #ifndef G3G4_NO_REFLECTION
55 fNofDivisions(nofDivisions),
134 if (shape ==
"PARA") {
143 if (position.
y()!=0.)
146 #ifndef G3G4_NO_REFLECTION
161 G4cout <<
"Create G4PVReplica name " << name <<
" logical volume name "
162 << lv->
GetName() <<
" mother logical volme name "
163 << mlv->
GetName() <<
" axis " <<
fAxis <<
" ndivisions "
168 #ifndef G3G4_NO_REFLECTION
182 G4String err_message =
"G3Division::" + where +
" for "
183 + what +
" is not implemented";
184 G4Exception(
"G3Division::Exception()",
"G3toG40004",
202 default:
G4Exception(
"G3Division::SetRangeAndAxis()",
"G3toG40005",
206 if ( shape ==
"BOX" ) {
210 else if ( shape ==
"TRD1" ) {
222 else if ( shape ==
"TRD2" ) {
233 else if ( shape ==
"TRAP" ) {
238 else if ( shape ==
"TUBE" ) {
254 else if ( shape ==
"TUBS" ) {
273 else if ( shape ==
"CONE" ) {
290 else if ( shape ==
"CONS" ) {
309 else if ( shape ==
"SPHE" ) {
326 else if ( shape ==
"PARA" ) {
330 else if ( shape ==
"PGON" ) {
352 DzArray[i] = Rpar[i4]*
cm;
353 Rmin[i] = Rpar[i5]*
cm;
354 Rmax[i] = Rpar[i6]*
cm;
355 rangelo[0] =
std::min(rangelo[0], Rmin[i]);
356 rangehi[0] =
std::max(rangehi[0], Rmax[i]);
357 rangelo[2] =
std::min(rangelo[2], DzArray[i]);
358 rangehi[2] =
std::max(rangehi[2], DzArray[i]);
361 assert(Rmin[i]>=0 && Rmax[i]>=Rmin[i]);
363 rangehi[1] = pPhi1 + dPhi;
376 else if ( shape ==
"PCON" ) {
398 DzArray[i] = Rpar[i4]*
cm;
399 Rmin[i] = Rpar[i5]*
cm;
400 Rmax[i] = Rpar[i6]*
cm;
401 rangelo[0] =
std::min(rangelo[0], Rmin[i]);
402 rangehi[0] =
std::max(rangehi[0], Rmax[i]);
403 rangelo[2] =
std::min(rangelo[2], DzArray[i]);
404 rangehi[2] =
std::max(rangehi[2], DzArray[i]);
407 assert(Rmin[i]>=0 && Rmax[i]>=Rmin[i]);
409 rangehi[1] = pPhi1 + dPhi;
422 else if ( shape ==
"ELTU" || shape ==
"HYPE" || shape ==
"GTRA" ||
427 Exception(
"SetRangeAndAxis",
"Unknown shape" + shape);
432 G4cout <<
"Shape " << shape <<
" SetRangeAndAxis: "
449 for (
G4int i=0; i<npar; ++i){ Rpar[i] = par[i];}
452 if ( shape ==
"BOX" ) {
454 pos [
fIAxis-1] = (hi + lo)/2.;
456 else if ( shape ==
"TRD1" ) {
463 tn = (Rpar[1] - Rpar[0])/(2.* Rpar[3]);
464 x1 = Rpar[0]; z1 = -Rpar[3];
465 Rpar[0] = x1 + tn * (lo/
cm -
z1);
466 Rpar[1] = x1 + tn * (hi/
cm -
z1);
467 Rpar[3] = (hi - lo)/2./
cm;
468 pos[2] = (hi + lo)/2.;
471 else if ( shape ==
"TRD2" ) {
479 tn1 = (Rpar[1] - Rpar[0])/(2.* Rpar[4]);
480 tn2 = (Rpar[3] - Rpar[2])/(2.* Rpar[4]);
481 x1 = Rpar[0]; y1 = Rpar[2]; z1 = -Rpar[3];
482 Rpar[0] = x1 + tn1 * (lo/
cm -
z1);
483 Rpar[1] = x1 + tn1 * (hi/
cm -
z1);
484 Rpar[2] = y1 + tn2 * (lo/
cm -
z1);
485 Rpar[3] = y1 + tn2 * (hi/
cm -
z1);
486 Rpar[4] = (hi - lo)/2./
cm;
487 pos[2] = (hi + lo)/2.;
490 else if ( shape ==
"TRAP" ) {
491 Exception(
"CreateEnvelope",
"TRAP-x,y,z");
493 else if ( shape ==
"TUBE" ) {
505 Rpar[2] = (hi - lo)/2./
cm;
506 pos [2] = (hi + lo)/2.;
509 else if ( shape ==
"TUBS" ) {
519 Rpar[2] = (hi - lo)/2./
cm;
520 pos [2] = (hi + lo)/2.;
523 else if ( shape ==
"CONE" ) {
535 tn1 = (Rpar[3] - Rpar[1])/(2.* Rpar[0]);
536 tn2 = (Rpar[4] - Rpar[2])/(2.* Rpar[0]);
537 rmin = Rpar[1]; rmax = Rpar[2]; z1 = -Rpar[0];
538 Rpar[1] = rmin + tn1 * (lo/
cm -
z1);
539 Rpar[3] = rmin + tn1 * (hi/
cm -
z1);
540 Rpar[2] = rmax + tn2 * (lo/
cm -
z1);
541 Rpar[4] = rmax + tn2 * (hi/
cm -
z1);
542 Rpar[0] = (hi - lo)/2./
cm;
543 pos[2] = (hi + lo)/2.;
546 else if ( shape ==
"CONS" ) {
556 tn1 = (Rpar[3] - Rpar[1])/(2.* Rpar[0]);
557 tn2 = (Rpar[4] - Rpar[2])/(2.* Rpar[0]);
558 rmin = Rpar[1]; rmax = Rpar[2]; z1 = -Rpar[0];
559 Rpar[1] = rmin + tn1 * (lo/
cm -
z1);
560 Rpar[3] = rmin + tn1 * (hi/
cm -
z1);
561 Rpar[2] = rmax + tn2 * (lo/
cm -
z1);
562 Rpar[4] = rmax + tn2 * (hi/
cm -
z1);
563 Rpar[0] = (hi - lo)/2./
cm;
564 pos[2] = (hi + lo)/2.;
567 else if ( shape ==
"SPHE" ) {
568 Exception(
"CreateEnvelope",
"SPHE-x,y,z");
570 else if ( shape ==
"PARA" ) {
571 Exception(
"CreateEnvelope",
"PARA-x,y,z");
573 else if ( shape ==
"PGON" ) {
583 else if ( shape ==
"PCON" ) {
594 Exception(
"CreateEnvelope",
"Unknown shape" + shape);
606 G3Pos* aG3Pos =
new G3Pos(motherName, 1, offset, 0, only);
619 for (
G4int i=0; i<npar; ++i){ Rpar[i] = par[i];}
628 if ( shape ==
"BOX" ) {
633 else if ( shape ==
"TRD1" ) {
641 else if ( shape ==
"TRD2" ) {
649 else if ( shape ==
"TRAP" ) {
657 else if ( shape ==
"TUBE" ) {
672 else if ( shape ==
"TUBS" ) {
686 else if ( shape ==
"CONE" ) {
700 else if ( shape ==
"CONS" ) {
713 else if (shape ==
"PARA") {
717 else if ( Rpar[4] == 0. && Rpar[5] == 0. ) {
729 else if (shape ==
"SPHE") {
732 else if ( shape ==
"PGON" ) {
742 else if ( shape ==
"PCON" ) {
753 Exception(
"CreateSolid",
"Unknown shape" + shape);
765 +
" has negative parameters.";
766 G4Exception(
"G3Division::CreateSolid()",
"G3toG40006",
849 if (ndvmx > 255) ndvmx = 255;
850 if (ndiv > ndvmx && ndvmx > 0 ) ndiv = ndvmx;
897 if (ndvmx > 255) ndvmx = 255;
898 if (ndiv > ndvmx && ndvmx > 0 ) ndiv = ndvmx;