subroutine ver_loadg *----------------------------------------------------------------------* * load geometry from common into GEANT * * Simply go through the geometry common, first load the rotations, * * then define and place the volumes. * * IROT is kept globally by Pisa in GUGEOM for all subsystems to use. * * GEANT routines called: GSROTM, GSVOLU, GSATT and GSPOS * * Oct 2000 Hubert van Hecke LANL * *----------------------------------------------------------------------* implicit none include 'ver_geom.inc' include 'gugeom.inc' integer jvol, index, ivol, ireturn, npar, jrot, i, itmp integer irota_tmp(mrots) real p(10) logical lused *----------------------------------------------------------------------* write (6,*)' VER_LOADG:: Starting GEANT calls:' write (8,*)' VER_LOADG:: Starting GEANT calls:' write (6,*)' nvols,nrots= ',nvols, nrots write (8,*)' nvols,nrots= ',nvols, nrots do jrot=1,nrots ! rotations: irot = irot + 1 ! get new index from gugeom irota_tmp(jrot) = irot ! save new assignment write (6,*)' jrot, irotid(jrot), irot = ', & jrot, irot_id(jrot), irot write (8,*)' jrot, irotid(jrot), irot = ', & jrot, irot_id(jrot), irot call gsrotm(irot, theta(1,jrot),phi(1,jrot), & theta(2,jrot),phi(2,jrot),theta(3,jrot),phi(3,jrot)) enddo ! end rotations ! update geom records: do ivol=1,nvols ! find the volumes that uses irot_id(jrot) if (irota(ivol).gt.1) then ! some non-null matrix used do jrot=1,nrots ! find it if (irota(ivol) .eq. irot_id(jrot)) then ! found it write (6,*)' vol,copy, old, new ', & name(ivol), icopy(ivol), irota(ivol), irota_tmp(jrot) write (8,*)' vol,copy, old, new ', & name(ivol), icopy(ivol), irota(ivol), irota_tmp(jrot) itmp = irota_tmp(jrot) ! replace with saved index endif ! end match/replace enddo ! end search irota(ivol) = itmp ! copy back endif ! end some matrix used enddo ! end al volumes write (6,*) ' end booking matrices' write (8,*) ' end booking matrices' do ivol=1,nvols ! scan the geom common if (name(ivol).ne.' ') then jvol = (index(all_names,name(ivol))+6)/7 ! Fast search if (ivol.eq.jvol) then ! first time if (shape(ivol).eq.'BOX ') then ! do a GSVOLU do i=1,3 p(i) = par(i,ivol) enddo call gsvolu(name(ivol),shape(ivol),nmed(ivol), & p, 3, ireturn) elseif (shape(ivol).eq.'TUBE') then do i=1,3 p(i) = par(i,ivol) enddo call gsvolu(name(ivol),shape(ivol),nmed(ivol), & p, 3, ireturn) elseif (shape(ivol).eq.'PARA') then do i=1,6 p(i) = par(i,ivol) enddo call gsvolu(name(ivol),shape(ivol),nmed(ivol), & p, 6, ireturn) elseif (shape(ivol).eq.'PGON') then do i=1,10 p(i) = par(i,ivol) enddo call gsvolu(name(ivol),shape(ivol),nmed(ivol), & p, 10, ireturn) else write (6,*)' ******> VER_LOADG: Unknown shape',shape(ivol) endif ! also set attributes call gsatt(name(ivol),'SEEN',iseen(ivol)) call gsatt(name(ivol),'COLO',icol(ivol)) endif ! first time: GSVOLU ! for all: GSPOS call gspos(name(ivol),icopy(ivol),mother(ivol), & position(1,ivol), position(2,ivol), position(3,ivol), & irota(ivol),'only') write (6,'(i4,1x,a4,i3,1x,a4,3f8.3,i3)') & ivol, name(ivol), icopy(ivol), mother(ivol), & position(1,ivol), position(2,ivol), position(3,ivol), & irota(ivol) write (8,'(i4,1x,a4,i3,1x,a4,3f8.3,i3)') & ivol, name(ivol), icopy(ivol), mother(ivol), & position(1,ivol), position(2,ivol), position(3,ivol), & irota(ivol) endif ! nonblank name enddo ! end volumes write (6,'('' hit any key '',$)') read (5,'(a1)') name(1) close (unit=8) end ! ver_loadg *======================================================================*