33 subroutine gsvolu(name, shape, nmed, par, npar, ivol)
35 subroutine ksvolu(name, shape, nmed, par, npar, ivol)
40 character name*4, shape*4, fmt*150
41 integer nmed, npar, ivol, k
49 if (dogeom) call gsvolu(
name, shape, nmed, par, npar, ivol)
53 if (lunlist.ne.0)
then
58 write(fmt,
'(A,I2,A)')
'(a4,1x,a6,1x,a4,1x,a4,2i5,',
max(npar,1),
60 write(lunlist,fmt)
context, rname,
name, shape, nmed, npar,
63 if (luncode.ne.0)
then
64 write(luncode,
'(''{'')')
66 write(luncode,1000)
name, shape, nmed, npar
67 1000
format(
'G4gsvolu(name="',
a,
'",shape="',
a,
'",nmed=',i5,
68 +
',par,npar=',i4,
');')
69 write(luncode,
'(''}'')')
75 subroutine gspos(name, num, moth, x, y, z, irot, only)
77 subroutine kspos(name, num, moth, x, y, z, irot, only)
82 character name*4, moth*4, only*4
91 if (dogeom) call gspos(
name, num, moth,
x,
y,
z, irot, only)
93 if (lunlist.ne.0)
then
95 +
'(a4,1x,a6,1x,a4,i5,1x,a4,3(1x,e16.8),i5,1x,a4)')
98 if (luncode.ne.0)
then
99 write(luncode,
'(''{'')')
103 write(luncode,1000)
name,num,moth,irot,only
104 1000
format(
'G4gspos(name="',
a,
'",num=',i5,
',moth="',
a,
105 +
'",x,y,z,irot=',i5,
',only="',
a,
'");')
106 write(luncode,
'(''}'')')
112 subroutine gsposp(name, num, moth, x, y, z, irot, only, par, npar)
114 subroutine ksposp(name, num, moth, x, y, z, irot, only, par, npar)
119 character name*4, moth*4, only*4
120 integer num, irot, npar, k
121 real x,
y,
z, par(npar)
122 character rname*6, fmt*150
123 #include "G3toG4.inc"
124 data rname /
'GSPOSP'/
128 if (dogeom) call gsposp(
name, num, moth,
x,
y,
z, irot, only,
131 if (lunlist.ne.0)
then
133 if (abs(par(k)).gt.1.e10)
then
134 print *,
'Warning: huge junk value in PAR for GSPOS'
145 write(fmt,
'(A,A,I2,A)')
146 >
'(a4,1x,a6,1x,a4,i5,1x,a4,3(1x,e16.8),',
147 +
'i5,1x,a4,i5,',
max(npar,1),
'(1x,e16.8))'
149 +
context, rname,
name, num, moth,
x,
y,
z, irot, only,
153 if (luncode.ne.0)
then
154 write(luncode,
'(''{'')')
159 write(luncode,1000)
name,num,moth,irot,only,npar
160 1000
format(
'G4gsposp(name="',
a,
'",num=',i5,
',moth="',
a,
161 +
'",x,y,z,irot=',i5,
',only="',
a,
'",par,npar=',i4,
');')
162 write(luncode,
'(''}'')')
168 subroutine gsatt(name, attr, ival)
175 character name*4, attr*4
178 #include "G3toG4.inc"
179 data rname /
'GSATT '/
183 if (dogeom) call gsatt(
name, attr, ival)
185 if (lunlist.ne.0)
then
187 +
'(a4,1x,a6,1x,a4,1x,a4,i12)')
190 if (luncode.ne.0)
then
191 write(luncode,
'(''{'')')
192 write(luncode,1000)
name,attr,ival
193 1000
format(
'G4gsatt(name="',
a,
'",attr="',
a,
'",ival=',i10,
');')
194 write(luncode,
'(''}'')')
200 subroutine gsrotm(irot, theta1, phi1, theta2, phi2,
203 subroutine ksrotm(irot, theta1, phi1, theta2, phi2,
210 real theta1, phi1, theta2, phi2, theta3, phi3
212 #include "G3toG4.inc"
213 data rname /
'GSROTM'/
217 if (dogeom) call gsrotm(irot, theta1, phi1, theta2, phi2,
220 if (lunlist.ne.0)
then
222 +
'(a4,1x,a6,i5,6f11.5)')
223 +
context, rname, irot, theta1, phi1, theta2, phi2,
226 if (luncode.ne.0)
then
227 write(luncode,
'(''{'')')
228 call
rtocp(
'theta1',theta1)
229 call
rtocp(
'phi1',phi1)
230 call
rtocp(
'theta2',theta2)
231 call
rtocp(
'phi2',phi2)
232 call
rtocp(
'theta3',theta3)
233 call
rtocp(
'phi3',phi3)
234 write(luncode,1000) irot
235 1000
format(
'G4gsrotm(irot=',i5,
236 +
',theta1,phi1,theta2,phi2,theta3,phi3);')
237 write(luncode,
'(''}'')')
243 subroutine gsdvn(name, moth, ndiv, iaxis)
245 subroutine ksdvn(name, moth, ndiv, iaxis)
250 character name*4, moth*4
253 #include "G3toG4.inc"
254 data rname /
'GSDVN '/
258 if (dogeom) call gsdvn(
name, moth, ndiv, iaxis)
260 if (lunlist.ne.0)
then
262 +
'(a4,1x,a6,1x,a4,1x,a4,i5,i3)')
265 if (luncode.ne.0)
then
266 write(luncode,
'(''{'')')
267 write(luncode,1000)
name, moth, ndiv, iaxis
268 1000
format(
'G4gsdvn(name="',
a,
'",moth="',
a,
'",ndiv=',i3,
270 write(luncode,
'(''}'')')
276 subroutine gsdvt(name, moth, step, iaxis, numed, ndvmx)
278 subroutine ksdvt(name, moth, step, iaxis, numed, ndvmx)
283 character name*4, moth*4
285 integer iaxis, numed, ndvmx
287 #include "G3toG4.inc"
288 data rname /
'GSDVT '/
292 if (dogeom) call gsdvt(
name, moth, step, iaxis, numed, ndvmx)
294 if (lunlist.ne.0)
then
296 +
'(a4,1x,a6,1x,a4,1x,a4,(1x,e16.8),3i5)')
297 +
context, rname,
name, moth, step, iaxis, numed, ndvmx
299 if (luncode.ne.0)
then
300 write(luncode,
'(''{'')')
301 call
rtocp(
'step',step)
302 write(luncode,1000)
name,moth,iaxis,numed,ndvmx
303 1000
format(
'G4gsdvt(name="',
a,
'",moth="',
a,
'",step,iaxis=',
304 + i1,
',numed=',i4,
',ndvmx=',i4,
');')
305 write(luncode,
'(''}'')')
311 subroutine gsdvx(name, moth, ndiv, iaxis, step, c0, numed, ndvmx)
313 subroutine ksdvx(name, moth, ndiv, iaxis, step, c0, numed, ndvmx)
318 character name*4, moth*4
319 integer ndiv, iaxis, numed, ndvmx
322 #include "G3toG4.inc"
323 data rname /
'GSDVX '/
327 if (dogeom) call gsdvx(
name, moth, ndiv, iaxis, step, c0, numed,
330 if (lunlist.ne.0)
then
332 +
'(a4,1x,a6,1x,a4,1x,a4,i5,i3,2(1x,e16.8),2i5)')
333 +
context, rname,
name, moth, ndiv, iaxis,step, c0,
336 if (luncode.ne.0)
then
337 write(luncode,
'(''{'')')
338 call
rtocp(
'step',step)
340 write(luncode,1000)
name,moth,ndiv,iaxis,numed,ndvmx
341 1000
format(
'G4gsdvx(name="',
a,
'",moth="',
a,
'",ndiv=',i3,
',iaxis=',
342 + i1,
',step,c0,numed=',i4,
',ndvmx=',i4,
');')
343 write(luncode,
'(''}'')')
349 subroutine gsdvn2(name, moth, ndiv, iaxis, c0, numed)
351 subroutine ksdvn2(name, moth, ndiv, iaxis, c0, numed)
356 character name*4, moth*4
357 integer ndiv, iaxis, numed
360 #include "G3toG4.inc"
361 data rname /
'GSDVN2'/
365 if (dogeom) call gsdvn2(
name, moth, ndiv, iaxis, c0, numed)
367 if (lunlist.ne.0)
then
369 +
'(a4,1x,a6,1x,a4,1x,a4,i5,i3,(1x,e16.8),i5)')
370 +
context, rname,
name, moth, ndiv, iaxis, c0, numed
372 if (luncode.ne.0)
then
373 write(luncode,
'(''{'')')
375 write(luncode, 1000)
name,moth,ndiv,iaxis,numed
376 1000
format(
'G4gsdvn2(name="',
a,
'",moth="',
a,
'",ndiv=',i3,
',iaxis=',
377 + i1,
',c0,numed=',i4,
');')
378 write(luncode,
'(''}'')')
384 subroutine gsdvt2(name, moth, step, iaxis, c0, numed, ndvmx)
386 subroutine ksdvt2(name, moth, step, iaxis, c0, numed, ndvmx)
391 character name*4, moth*4
392 integer iaxis, numed, ndvmx
395 #include "G3toG4.inc"
396 data rname /
'GSDVT2'/
400 if (dogeom) call gsdvt2(
name, moth, step, iaxis, c0, numed, ndvmx)
402 if (lunlist.ne.0)
then
404 +
'(a4,1x,a6,1x,a4,1x,a4,(1x,e16.8),i3,(1x,e16.8),2i5)')
405 +
context, rname,
name, moth, step, iaxis, c0, numed, ndvmx
407 if (luncode.ne.0)
then
408 write(luncode,
'(''{'')')
409 call
rtocp(
'step',step)
411 write(luncode,1000)
name,moth,iaxis,numed,ndvmx
412 1000
format(
'G4gsdvt2(name="',
a,
'",moth="',
a,
'",step,iaxis=',
413 + i1,
',c0,numed=',i4,
',ndvmx=',i4,
');')
414 write(luncode,
'(''}'')')
420 subroutine gsmate(imate, name, a, z, dens, radl, absl, ubf, nwbf)
422 subroutine ksmate(imate, name, a, z, dens, radl, absl, ubf, nwbf)
428 integer imate, nwbf, k
429 real a,
z, dens, radl, absl, ubf(nwbf)
430 character rname*6, fmt*150
431 #include "G3toG4.inc"
432 data rname /
'GSMATE'/
436 if (dogeom) call gsmate
437 + (imate,
name,
a,
z, dens, radl, absl, ubf, nwbf)
439 if (lunlist.ne.0)
then
440 write(fmt,
'(A,I3,A)')
441 >
'(a4,1x,a6,i5,1x,''"'',a,''"'',4(1x,e16.8),i3,',
442 >
max(nwbf,1),
'(1x,e16.8))'
445 + nwbf, (ubf(k), k=1,nwbf)
447 if (luncode.ne.0)
then
448 write(luncode,
'(''{'')')
451 call
rtocp(
'dens',dens)
452 call
rtocp(
'radl',radl)
454 write(luncode,1000) imate,
name, nwbf
455 1000
format(
'G4gsmate(imate=',i4,
',name="',
a,
456 +
'",a,z,dens,radl,npar=',i4,
',par);')
457 write(luncode,
'(''}'')')
463 subroutine gsmixt(imate, name, a, z, dens, nlmat, wmat)
465 subroutine ksmixt(imate, name, a, z, dens, nlmat, wmat)
471 integer imate, nlmat, k, nlmata
472 real a(*),
z(*), dens, wmat(*)
473 character rname*6, fmt*150
474 #include "G3toG4.inc"
475 data rname /
'GSMIXT'/
479 if (dogeom) call gsmixt
480 + (imate,
name,
a,
z, dens, nlmat, wmat)
482 if (lunlist.ne.0)
then
484 write(fmt,
'(A,I3,A,I3,A,I3,A)')
485 +
'(a4,1x,a6,i5,1x,''"'',a,''"'',1x,e16.8,1x,i3,',
487 >
'(1x,e16.8),',
max(nlmata,1),
'(1x,e16.8),',
488 >
max(nlmata,1),
'(1x,e16.8))'
492 + (
a(k), k=1,abs(nlmat)),
493 + (
z(k), k=1,abs(nlmat)),
494 + (wmat(k), k=1,abs(nlmat))
496 if (luncode.ne.0)
then
497 write(luncode,
'(''{'')')
498 call
rtocp(
'dens',dens)
501 call
artocp(
'wmat',wmat,abs(nlmat))
502 write(luncode,1000) imate,
name,nlmat
503 1000
format(
'G4gsmixt(imate=',i5,
',name="',
a,
504 +
'",aa,zz,dens,nlmat=',i3,
',wmat);')
505 write(luncode,
'(''}'')')
512 + itmed,
name, nmat, isvol, ifield, fieldm,
513 + tmaxfd, stemax, deemax, epsil, stmin, ubuf, nwbuf)
516 + itmed,
name, nmat, isvol, ifield, fieldm,
517 + tmaxfd, stemax, deemax, epsil, stmin, ubuf, nwbuf)
523 integer itmed, nmat, isvol, ifield, nwbuf, k
524 real fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf(nwbuf)
525 character rname*6, fmt*150
526 #include "G3toG4.inc"
527 data rname /
'GSTMED'/
531 if (dogeom) call gstmed(
532 + itmed,
name, nmat, isvol, ifield, fieldm,
533 + tmaxfd, stemax, deemax, epsil, stmin, ubuf, nwbuf)
535 if (lunlist.ne.0)
then
541 write(fmt,
'(A,I3,A)')
542 >
'(a4,1x,a6,i5,1x,''"'',a,''"'',3i3,6(1x,e16.8),i3,',
543 >
max(nwbuf,1),
'(1x,e16.8))'
545 +
context, rname, itmed,
name, nmat, isvol, ifield, fieldm,
546 + tmaxfd, stemax, deemax, epsil, stmin,
547 + nwbuf, (ubuf(k),k=1,nwbuf)
549 if (luncode.ne.0)
then
550 write(luncode,
'(''{'')')
551 call
rtocp(
'fieldm',fieldm)
552 call
rtocp(
'tmaxfd',tmaxfd)
553 call
rtocp(
'stemax',stemax)
554 call
rtocp(
'deemax',deemax)
555 call
rtocp(
'epsil',epsil)
556 call
rtocp(
'stmin',stmin)
558 write(luncode,1000) itmed,
name,nmat,isvol,ifield,nwbuf
559 1000
format(
'G4gstmed(itmed=',i4,
',name="',
a,
'",nmat=',i4,
560 +
',isvol=',i2,
',ifield=',i2,
',',/
561 +
' fieldm,tmaxfd,stemax,deemax,epsil,stmin,par,npar=',
563 write(luncode,
'(''}'')')
569 subroutine gstpar(itmed, chpar, parval)
580 #include "G3toG4.inc"
581 data rname /
'GSTPAR'/
585 if (dogeom) call gstpar(itmed, chpar, parval)
587 if (lunlist.ne.0)
then
589 +
'(a4,1x,a6,i5,1x,a4,(1x,e16.8))')
590 +
context, rname, itmed, chpar, parval
592 if (luncode.ne.0)
then
593 write(luncode,
'(''{'')')
594 write(luncode,1000) itmed, chpar, parval
595 1000
format(
'G4gstpar(itmed=',i4,
',chpar="',
a,
'",parval=',
597 write(luncode,
'(''}'')')
604 +
ipart, chpar, itrtyp, amass, charge, tlife, ub, nwb)
607 +
ipart, chpar, itrtyp, amass, charge, tlife, ub, nwb)
613 integer ipart, itrtyp, nwb, k
614 real amass, charge, tlife, ub(nwb)
615 character rname*6, fmt*150
616 #include "G3toG4.inc"
617 data rname /
'GSPART'/
621 if (dogeom) call gspart(
622 +
ipart, chpar, itrtyp, amass, charge, tlife, ub, nwb)
624 if (lunlist.ne.0)
then
629 write(fmt,
'(A,I3,A)')
630 >
'(a4,1x,a6,i5,1x,''"'',a,''"'',i3,3(1x,e16.8),i3,',
631 >
max(nwb,1),
'(1x,e16.8))'
635 + nwb, (ub(k), k=1,nwb)
637 if (luncode.ne.0)
then
638 write(luncode,
'(''{'')')
639 call
rtocp(
'amass',amass)
640 call
rtocp(
'charge',charge)
641 call
rtocp(
'tlife',tlife)
643 write(luncode,1000)
ipart,chpar,itrtyp,nwb
644 1000
format(
'G4gspart(ipart=',i8,
',chpar="',
a,
'",itrtyp=',i8,
645 +
',amass,charge,'/
' tlife,par,npar=',i4,
');')
646 write(luncode,
'(''}'')')
652 subroutine gsdk(ipart, bratio, mode)
654 subroutine ksdk(ipart, bratio, mode)
659 integer ipart, mode(6)
662 #include "G3toG4.inc"
667 if (dogeom) call gsdk(
ipart, bratio, mode)
669 if (lunlist.ne.0)
then
673 +
'(a4,1x,a6,i5,i3,6(1x,e16.8),6i8)')
676 if (luncode.ne.0)
then
677 write(luncode,
'(''{'')')
678 call
artocp(
'bratio',bratio,6)
679 call
aitocp(
'mode',mode,6)
680 write(luncode,1000)
ipart
681 1000
format(
'G4gsdk(ipart=',i8,
',bratio,mode);')
682 write(luncode,
'(''}'')')
688 subroutine gsdet(chset, chdet, nv, chnam, nbits, idtyp, nwhi,
691 subroutine ksdet(chset, chdet, nv, chnam, nbits, idtyp, nwhi,
697 integer nv, nbits(nv), idtyp, nwhi, nwdi, iset, idet, k
698 character rname*6, chset*4, chdet*4, chnam(nv)*4, fmt*150
699 #include "G3toG4.inc"
700 data rname /
'GSDET '/
704 if (dogeom) call gsdet(chset, chdet, nv, chnam, nbits, idtyp,
705 + nwhi, nwdi, iset, idet)
707 if (lunlist.ne.0)
then
712 write(fmt,
'(A,I3,A,I3,A)')
'(a4,1x,a6,1x,a4,1x,a4,i5,',
713 >
max(nv,1),
'(1x,a4),',
max(nv,1),
'i10,i10,2i5)'
715 +
context, rname, chset, chdet, nv, (chnam(k), k=1,nv),
716 + (nbits(k), k=1,nv), idtyp, nwhi, nwdi
718 if (luncode.ne.0)
then
719 write(luncode,
'(''{'')')
720 call
astocp(
'chnam',chnam,nv)
721 call
aitocp(
'nbits',nbits,nv)
722 write(luncode,1000) chset, chdet, nv, idtyp, nwhi, nwdi
723 1000
format(
'G4gsdet(chset="',
a,
'",chdet="',
a,
'",nv=',i3,
724 +
',chnam,nbits,idtyp=',i8,
','/
725 +
' nwhi=',i8,
',nwdi=',i8,
');')
726 write(luncode,
'(''}'')')
732 subroutine gsdetv(chset, chdet, idtyp, nwhi, nwdi, iset, idet)
734 subroutine ksdetv(chset, chdet, idtyp, nwhi, nwdi, iset, idet)
739 integer idtyp, nwhi, nwdi, iset, idet
740 character rname*6, chset*4, chdet*4
741 #include "G3toG4.inc"
742 data rname /
'GSDETV'/
746 if (dogeom) call gsdetv(chset, chdet, idtyp,
747 + nwhi, nwdi, iset, idet)
749 if (lunlist.ne.0)
then
751 +
'(a4,1x,a6,1x,a4,1x,a4,i10,2i5)')
752 +
context, rname, chset, chdet, idtyp, nwhi, nwdi
754 if (luncode.ne.0)
then
755 write(luncode,
'(''{'')')
756 write(luncode,1000) chset, chdet, idtyp, nwhi, nwdi
757 1000
format(
'G4gsdetv(chset="',
a,
'",chdet="',
a,
'",idtyp=',i8,
758 +
',nwhi=',i8,
',nwdi=',i8,
');')
759 write(luncode,
'(''}'')')
765 subroutine gsdeta(chset, chdet, chali, nwhi, nwdi, iali)
767 subroutine ksdeta(chset, chdet, chali, nwhi, nwdi, iali)
772 integer nwhi, nwdi, iali
773 character rname*6, chset*4, chdet*4, chali*4
774 #include "G3toG4.inc"
775 data rname /
'GSDETA'/
779 if (dogeom) call gsdeta(chset, chdet, chali, nwhi, nwdi, iali)
781 if (lunlist.ne.0)
then
783 +
'(a4,1x,a6,1x,a4,1x,a4,1x,a4,2i5)')
784 +
context, rname, chset, chdet, chali, nwhi, nwdi
786 if (luncode.ne.0)
then
787 write(luncode,
'(''{'')')
788 write(luncode,1000) chset, chdet, chali, nwhi, nwdi
789 1000
format(
'G4gsdeta(chset="',
a,
'",chdet="',
a,
'",chali="',
a,
790 +
'",nwhi=',i8,
',nwdi=',i8,
');')
791 write(luncode,
'(''}'')')
797 subroutine gsdeth(chset, chdet, nh, chnam, nbits, orig, fact)
799 subroutine ksdeth(chset, chdet, nh, chnam, nbits, orig, fact)
804 integer nh, nbits(nh), k
805 real orig(nh), fact(nh)
806 character rname*6, chset*4, chdet*4, chnam(nh)*4, fmt*150
807 #include "G3toG4.inc"
808 data rname /
'GSDETH'/
812 if (dogeom) call gsdeth(chset, chdet, nh, chnam, nbits,
815 if (lunlist.ne.0)
then
821 write(fmt,
'(A,I3,A,I3,A,I3,A,I3,A)')
822 >
'(a4,1x,a6,1x,a4,1x,a4,i5,',
max(nh,1),
'(1x,a4),',
823 >
max(nh,1),
'i5,',
max(nh,1),
'(1x,e16.8),',
max(nh,1),
826 +
context, rname, chset, chdet, nh, (chnam(k), k=1,nh),
827 + (nbits(k), k=1,nh), (orig(k), k=1,nh), (fact(k), k=1,nh)
829 if (luncode.ne.0)
then
830 write(luncode,
'(''{'')')
831 call
astocp(
'chnam',chnam,nh)
832 call
aitocp(
'nbits',nbits,nh)
833 call
artocp(
'orig',orig,nh)
834 call
artocp(
'fact',fact,nh)
835 write(luncode,1000) chset,chdet,nh
836 1000
format(
'G4gsdeth(chset="',
a,
'",chdet="',
a,
'",nh=',i4,
837 +
',chnam,nbits,orig,fact);')
838 write(luncode,
'(''}'')')
844 subroutine gsdetd(chset, chdet, nd, chnam, nbits)
846 subroutine ksdetd(chset, chdet, nd, chnam, nbits)
851 integer nd, nbits(nd), k
852 character rname*6, chset*4, chdet*4, chnam(nd)*4, fmt*150
853 #include "G3toG4.inc"
854 data rname /
'GSDETD'/
858 if (dogeom) call gsdetd(chset, chdet, nd, chnam, nbits)
860 if (lunlist.ne.0)
then
865 write(fmt,
'(A,I3,A,I3,A)')
866 +
'(a4,1x,a6,1x,a4,1x,a4,i5,',
max(nd,1),
'(1x,a4),',
869 +
context, rname, chset, chdet, nd, (chnam(k), k=1,nd),
872 if (luncode.ne.0)
then
873 write(luncode,
'(''{'')')
874 call
astocp(
'chnam',chnam,nd)
875 call
aitocp(
'nbits',nbits,nd)
876 write(luncode,1000) chset, chdet, nd
877 1000
format(
'G4gsdetd(chset="',
a,
'",chdet="',
a,
'",nd=',i4,
879 write(luncode,
'(''}'')')
885 subroutine gsdetu(chset, chdet, nupar, upar)
887 subroutine ksdetu(chset, chdet, nupar, upar)
894 character rname*6, chset*4, chdet*4, fmt*150
895 #include "G3toG4.inc"
896 data rname /
'GSDETU'/
900 if (dogeom) call gsdetu(chset, chdet, nupar, upar)
902 if (lunlist.ne.0)
then
906 write(fmt,
'(A,I3,A)')
907 +
'(a4,1x,a6,1x,a4,1x,a4,i5,',
max(nupar,1),
'(1x,e16.8))'
909 +
context, rname, chset, chdet, nupar, (upar(k), k=1,nupar)
911 if (luncode.ne.0)
then
912 write(luncode,
'(''{'')')
914 write(luncode,1000) chset, chdet, nupar
915 1000
format(
'G4gsdetu(chset="',
a,
'",chdet="',
a,
'",npar=',
917 write(luncode,
'(''}'')')
931 #include "G3toG4.inc"
932 data rname /
'GGCLOS'/
936 if (dogeom) call ggclos
938 if (lunlist.ne.0)
then
939 write(lunlist,
'(a4,1x,a6)')
context, rname
942 if (luncode.ne.0)
then
943 write(luncode,
'(''//GeoMgr->CloseGeometry();'')')
944 write(luncode,
'(''}'')')
956 character name*4, shape*4
957 real ph, par(*),
tt, raddeg
960 raddeg = 180./3.1415926
962 if (shape(1:3).eq.
'BOX'.and.npar.ne.3)
then
963 print *,
'!! error, BOX with ',npar,
' parameters, vol ',
name
965 if (shape.eq.
'TRD1'.and.npar.ne.4)
then
966 print *,
'!! error, TRD1 with ',npar,
' parameters, vol ',
name
968 if (shape.eq.
'TRD2'.and.npar.ne.5)
then
969 print *,
'!! error, TRD2 with ',npar,
' parameters, vol ',
name
971 if (shape.eq.
'TRAP'.and.npar.ne.35.and.npar.ne.11)
then
973 print *,
'!! error, TRAP with ',npar,
' parameters, vol ',
name
975 if (shape.eq.
'TUBE'.and.npar.ne.3)
then
976 print *,
'!! error, TUBE with ',npar,
' parameters, vol ',
name
978 if (shape.eq.
'TUBS'.and.npar.ne.5)
then
979 print *,
'!! error, TUBS with ',npar,
' parameters, vol ',
name
981 if (shape.eq.
'CONE'.and.npar.ne.5)
then
982 print *,
'!! error, CONE with ',npar,
' parameters, vol ',
name
984 if (shape.eq.
'CONS'.and.npar.ne.7)
then
985 print *,
'!! error, CONS with ',npar,
' parameters, vol ',
name
987 if (shape.eq.
'SPHE'.and.npar.ne.6)
then
988 print *,
'!! error, SPHE with ',npar,
' parameters, vol ',
name
990 if (shape.eq.
'PARA'.and.npar.ne.6)
then
991 print *,
'!! error, PARA with ',npar,
' parameters, vol ',
name
993 if (shape.eq.
'PARA')
then
998 if (par(5).ne.0.) ph = atan2(par(6),par(5))*raddeg
999 tt =
sqrt(par(5)**2+par(6)**2)
1000 par(4) = atan(par(4))*raddeg
1001 if (par(4).gt.90.0) par(4) = par(4)-180.0
1002 par(5) = atan(
tt)*raddeg
1003 if (ph.lt.0.0) ph = ph + 360.0
1006 if (shape.eq.
'TRAP')
then
1012 if (par(2).ne.0.) ph = atan2(par(3),par(2))*raddeg
1013 tt =
sqrt(par(2)**2+par(3)**2)
1014 par(2) = atan(
tt)*raddeg
1015 if (ph.lt.0.0) ph = ph+360.0
1017 par(7) = atan(par(7))*raddeg
1018 if (par(7).gt.90.0) par(7) = par(7)-180.0
1019 par(11)= atan(par(11))*raddeg
1020 if (par(11).gt.90.0) par(11) = par(11)-180.0