b0VIM 5.3}p7 8brashproton.cebaf.gov/mnt/scratch/fpp_geant/src/ugeom.f3210#"! UtpwoxgNUcd\UwOsxu_{RS,\adw~hJ* wuNL  a I 1 u H F (  y e c ; 9 [  v =  ~fN6{dM6}fO8! poS='}?G*i& real*8 rx12min,rx12max real*8 rv12min,rv12max,ru456min,ru456max,rv456min,rv456max real*8 ru12min,ru12max,zru12,zrv12,zrx12,zru456,zrv456 real*8 fv123min,fv123max,fu456min,fu456max,fv456min,fv456max real*8 fu123min,fu123max,zfu123,zfv123,zfu456,zfv456 real*8 strw_size(3),xnr,ynr real*8 sci1_size(3),sci2_size(3),aer1_size(3),aer2_size(3) real*8 airi_size(3),airj_size(3),airk_size(3),airl_size(3) real*8 aira_size(3),airb_size(3),airc_size(3),aird_size(3) real*8 airf_size(3),airg_size(3),airh_size(3),carb2_size(3) real*8 carbon_size(3),aire_size(3),airm_size(3),aer3_size(3) real*8 pb_size(3) real*8 rv456_size(3) real*8 ru456_size(3) real*8 rx12_size(3) real*8 rv12_size(3) real*8 ru12_size(3) real*8 fv456_size(3) real*8 fv123_size(3) real*8 fu456_size(3) real*8 fu123_size(3) real*8 HALL_size(3) parameter (nsci=626) parameter (nluc=625) parameter (nlih=624) parameter (nhy=623) parameter (nch=622) parameter (naer3=620) parameter (naer2=619) parameter (naer1=618) parameter (nsci2=617) parameter (nsci1=616) parameter (nairm=615) parameter (nairl=614) parameter (nairk=613) parameter (nairj=612) parameter (nairi=611) parameter (ncarb2=610) parameter (nairh=609) parameter (nairg=608) parameter (nairf=607) parameter (naire=606) parameter (naird=605) parameter (nairc=604) parameter (nairb=603) parameter (naira=602) parameter (ncarbon=6) parameter (nrv456=402) parameter (nru456=302) parameter (nrx12=501) parameter (nrv12=401) parameter (nru12=301) parameter (nfv456=202) parameter (nfv123=201) parameter (nfu456=102) parameter (nfu123=101) parameter (nHALL=100) parameter (nvac=15) parameter (nair=15) parameter (ndim=3)c common / gugeompar / irot, irotnullc real*8 aircmi,aircma real*8 sci2mi,sci2ma,airbmi,airbma,carbmi,carbma real*8 zpb,zsci,zhy,zluc,zli,zlih,zch real*8 zsci1,zsci2,zaer1,zaer2,zaer3 real*8 zairh,zcarb2,zairi,zairj,zairk,zairl,zairm integer*4 nr,i real*8 fieldm,tmaxfd,dmaxms,deemax,epsil,stmin,ubuf(10) integer*4 isvol,ifield,nwbuf integer*4 nt_sci,nt_luc,nt_pb,nt_hy,nt_lih,nt_ch integer*4 nt_air,nt_carbon,nt_strc parameters)c variables used in calls to gstmed (which defines tracking materialc character*4 chnmsv(1),chnamh(6)c real*8 zaddc real*8 zanalymin,zanalymax real*8 zanaly real*8 analyz_size(3) integer*4 nt_analyz, nanalyz real*8 comp_thick real*8 ncomp(6) integer*4 ianalyzcompc integer*4 nsci,nluc,npb,nhy,nlih,nch integer*4 nsci1,nsci2,naer1,naer2,naer3 integer*4 nairk,nairl,nairm integer*4 nairf,nairg,nairh,ncarb2,nairi,nairj integer*4 ncarbon,naira,nairb,nairc,naird,naire integer*4 nrx12 integer*4 nrv12,nrv456 integer*4 nru12,nru456 integer*4 nfv123,nfv456 integer*4 nfu123,nfu456 integer*4 iv_targ,nair,ndim,nvac integer*4 irot1,irot2,irot3,irot4 integer*4 nHALL,iv_HALL,irot,irotnull,irotx,irotu,irotvc logical statusok,read_databasec include 'option.h' include 'experiment.h' include 'transport.h' include 'detector.h' include 'espace_type.h' include 'parameter.h' include 'geant_local.h' include 'fpp_local.h' implicit nonecc august 17, 1994 - e.j. brash, rutgers.c define experimental setup. write for cebaf HALL a fpp.c subroutine ugeomad - }P- y< M K > 4 3 2 1 0 / . - , end returnc call gsdeth('fppd','strw',6,chnamh,nbitsh,orig,fact) call gpsets('*','*') call gsdet ('fppd','strw',1,chnmsv,nbitsv,1,100,100,iset,idet)c enddo call gspos('strw',nr,'srv4',xnr,ynr,0.938,irotv,'only')c write(6,*)'straw #',nr,' placed at y=',ynr,' and x=',xnr > cos(45.0*pi/180.) xnr=-1.0*(uvx_zero(24)+w_spacingr*(nr-irv4str-1))* ynr=(uvx_zero(24)+w_spacingr*(nr-irv4str-1))*cos(45.0*pi/180.) do nr=irv4str+1,irv5str write(*,*)zrv456,z_fpp(24)c write(*,*)'positioning straws in plane 24' enddo call gspos('strw',nr,'srv4',xnr,ynr,0.,irotv,'only')c write(6,*)'straw #',nr,' placed at y=',ynr,' and x=',xnradYUl^N~U y i M 3 " ] [ I k P _ Q A W  {kO5$sqpD0~A3c- ifv4str=ifu3str+spdetector.h.fpp.geom.plane(7).nwire ifu3str=ifu2str+spdetector.h.fpp.geom.plane(6).nwire ifu2str=ifu1str+spdetector.h.fpp.geom.plane(5).nwire ifu1str=ifv3str+spdetector.h.fpp.geom.plane(4).nwire ifv3str=ifv2str+spdetector.h.fpp.geom.plane(3).nwire ifv2str=ifv1str+spdetector.h.fpp.geom.plane(2).nwire ifv1str=spdetector.h.fpp.geom.plane(1).nwire enddo write(*,*)uvx_zero(i),uvx_zero(i+1),uvx_zero(i+2) do i=19,24,3 enddo write(*,*)uvx_zero(i),uvx_zero(i+1) do i=13,18,2 enddo write(*,*)uvx_zero(i),uvx_zero(i+1),uvx_zero(i+2) do i=1,12,3 write(6,*)'initial straw positions'c & ,phi(2),theta(3),phi(3)) call gsrotm(irot4,theta(1),phi(1),theta(2) irot4=8 enddo write(6,*)'fpp rotation 4=',ic,theta(ic),phi(ic) endif phi(ic)=0.0 theta(ic)=0.0 else phi(ic)=atan2(sinph,cosph)*rtod theta(ic)=atan2(sinth,costh)*rtod if(rotate) then write(*,*)costh,sinth,cosph,sinph call gfang(rowmat,costh,sinth,cosph,sinph,rotate) rowmat(3)=real(rotmat4(ic,3)) rowmat(2)=real(rotmat4(ic,2)) rowmat(1)=real(rotmat4(ic,1)) do ic=1,3c & phi(2),theta(3),phi(3)) call gsrotm(irot3,theta(1),phi(1),theta(2), irot3=7 enddo write(6,*)'fpp rotation 3=',ic,theta(ic),phi(ic) endif phi(ic)=0.0 theta(ic)=0.0 else phi(ic)=atan2(sinph,cosph)*rtod theta(ic)=atan2(sinth,costh)*rtod if(rotate) then write(*,*)costh,sinth,cosph,sinph call gfang(rowmat,costh,sinth,cosph,sinph,rotate) rowmat(3)=real(rotmat3(ic,3)) rowmat(2)=real(rotmat3(ic,2)) rowmat(1)=real(rotmat2(ic,1)) do ic=1,3c & phi(2),theta(3),phi(3)) call gsrotm(irot2,theta(1),phi(1),theta(2), irot2=6 enddo write(6,*)'fpp rotation 2 =',ic,theta(ic),phi(ic) endif phi(ic)=0.0 theta(ic)=0.0 else phi(ic)=atan2(sinph,cosph)*rtod theta(ic)=atan2(sinth,costh)*rtod if(rotate) then write(*,*)costh,sinth,cosph,sinph call gfang(rowmat,costh,sinth,cosph,sinph,rotate) rowmat(3)=real(rotmat2(ic,3)) rowmat(2)=real(rotmat2(ic,2)) rowmat(1)=real(rotmat2(ic,1)) do ic=1,3c & phi(2),theta(3),phi(3)) call gsrotm(irot1,theta(1),phi(1),theta(2), irot1=5 enddo write(6,*)'fpp rotation 1 =',ic,theta(ic),phi(ic) endif phi(ic)=0.0 theta(ic)=0.0 elsead lR tfdR) t Y ( e W G  w N  r b F ,  V T B  dIXJ:yPtdH.lji=)w:,\& ifv4str=ifu3str+spdetector.h.fpp.geom.plane(7).nwire ifu3str=ifu2str+spdetector.h.fpp.geom.plane(6).nwire ifu2str=ifu1str+spdetector.h.fpp.geom.plane(5).nwire ifu1str=ifv3str+spdetector.h.fpp.geom.plane(4).nwire ifv3str=ifv2str+spdetector.h.fpp.geom.plane(3).nwire ifv2str=ifv1str+spdetector.h.fpp.geom.plane(2).nwire ifv1str=spdetector.h.fpp.geom.plane(1).nwire enddo write(*,*)uvx_zero(i),uvx_zero(i+1),uvx_zero(i+2) do i=19,24,3 enddo write(*,*)uvx_zero(i),uvx_zero(i+1) do i=13,18,2 enddo write(*,*)uvx_zero(i),uvx_zero(i+1),uvx_zero(i+2) do i=1,12,3 write(6,*)'initial straw positions'c & ,phi(2),theta(3),phi(3)) call gsrotm(irot4,theta(1),phi(1),theta(2) irot4=8 enddo write(6,*)'fpp rotation 4=',ic,theta(ic),phi(ic) endif phi(ic)=0.0 theta(ic)=0.0 else phi(ic)=atan2(sinph,cosph)*rtod theta(ic)=atan2(sinth,costh)*rtod if(rotate) then write(*,*)costh,sinth,cosph,sinph call gfang(rowmat,costh,sinth,cosph,sinph,rotate) rowmat(3)=real(rotmat4(ic,3)) rowmat(2)=real(rotmat4(ic,2)) rowmat(1)=real(rotmat4(ic,1)) do ic=1,3c & phi(2),theta(3),phi(3)) call gsrotm(irot3,theta(1),phi(1),theta(2), irot3=7 enddo write(6,*)'fpp rotation 3=',ic,theta(ic),phi(ic) endif phi(ic)=0.0 theta(ic)=0.0 else phi(ic)=atan2(sinph,cosph)*rtod theta(ic)=atan2(sinth,costh)*rtod if(rotate) then write(*,*)costh,sinth,cosph,sinph call gfang(rowmat,costh,sinth,cosph,sinph,rotate) rowmat(3)=real(rotmat3(ic,3)) rowmat(2)=real(rotmat3(ic,2)) rowmat(1)=real(rotmat2(ic,1)) do ic=1,3c & phi(2),theta(3),phi(3)) call gsrotm(irot2,theta(1),phi(1),theta(2), irot2=6 enddo write(6,*)'fpp rotation 2 =',ic,theta(ic),phi(ic) endif phi(ic)=0.0 theta(ic)=0.0 else phi(ic)=atan2(sinph,cosph)*rtod theta(ic)=atan2(sinth,costh)*rtod if(rotate) then write(*,*)costh,sinth,cosph,sinph call gfang(rowmat,costh,sinth,cosph,sinph,rotate) rowmat(3)=real(rotmat2(ic,3)) rowmat(2)=real(rotmat2(ic,2)) rowmat(1)=real(rotmat2(ic,1)) do ic=1,3c & phi(2),theta(3),phi(3)) call gsrotm(irot1,theta(1),phi(1),theta(2), irot1=5 enddo phi(ic)=atan2(si phi(ic)=atan2(sinph,cosph)*rtod theta(ic)=atanx2(sinth,costh)*rtod if(costh.ne.0.0) thenc phi(ic)=atan2(sinph,cosph)*rtodc theta(ic)=atan2(sinth,costh)*rtod if(rotate) then write(*,*)costh,sinth,cosph,sinph call gfang(rowmat,costh,sinth,cosph,sinph,rotate) rowmat(3)=real(rotmat1(ic,3)) rowmat(2)=real(rotmat1(ic,2)) rowmat(1)=real(rotmat1(ic,1)) do ic=1,3c enddo write(*,*)rotmat4(ic,1),rotmat4(ic,2),rotmat4(ic,3) do ic=1,3 rotmat4(3,3)=cos(psoff4)*cos(phoff4) $ *sin(phoff4) rotmat4(3,2)=-sin(psoff4)*sin(thoff4)-cos(psoff4)*cos(thoff4) $ *sin(phoff4) rotmat4(3,1)=-sin(psoff4)*cos(thoff4)+cos(psoff4)*sin(thoff4) rotmat4(2,3)=sin(phoff4) rotmat4(2,2)=cos(phoff4)*cos(thoff4)