#define WITH_PAINT 0 subroutine define_geometry() real fiber_length real fiber_width(3) real fiber_pitch character*20 natmed integer nmat integer isvol integer ifield real fieldm real tmaxfd real stemax real deemax real epsil real stmin real ubuf(9) integer nwbuf integer npckov real ppckov(2) real absco(2) real effic(2) real rindex(2) character*4 chname character*4 chshape integer nmed real par(9) integer npar integer ivolu integer nr character*4 chmoth real x,y,z integer irot character*4 chonly c define the geometry dimensions fiber_width(1) = 0.176 fiber_width(2) = 0.192 fiber_width(3) = 0.200 fiber_length = 2.0 fiber_pitch = 0.22 c define the tracking media isvol = 0 ifield = 0 fieldm = 0 tmaxfd = 0 stemax = 0 deemax = 0 epsil = 1e-5 stmin = 1e-5 nwbuf = 0 nmed = 1 natmed = 'atmosphere medium' nmat = 15 ! air call gstmed(nmed,natmed,nmat,isvol,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin,ubuf,nwbuf) nmed = 100 natmed = 'fiber core medium' nmat = 100 call gstmed(nmed,natmed,nmat,isvol,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin,ubuf,nwbuf) nmed = 101 natmed = 'inner clad medium' nmat = 101 call gstmed(nmed,natmed,nmat,isvol,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin,ubuf,nwbuf) nmed = 102 natmed = 'outer clad medium' nmat = 102 call gstmed(nmed,natmed,nmat,isvol,ifield,fieldm,tmaxfd,stemax, + deemax,epsil,stmin,ubuf,nwbuf) c assign the refractive properties of these media nmed = 1 npckov = 2 ppckov(1) = 1e-9 ppckov(2) = 4e-9 absco(1) = 1e6 absco(2) = 1e6 effic(1) = 0 effic(2) = 0 #if WITH_PAINT rindex(1) = 2.5 rindex(2) = 2.5 #else rindex(1) = 1 rindex(2) = 1 #endif call gsckov(nmed,npckov,ppckov,absco,effic,rindex) nmed = 100 rindex(1) = 1.60 rindex(2) = 1.60 call gsckov(nmed,npckov,ppckov,absco,effic,rindex) nmed = 101 rindex(1) = 1.49 rindex(2) = 1.49 call gsckov(nmed,npckov,ppckov,absco,effic,rindex) nmed = 102 rindex(1) = 1.42 rindex(2) = 1.42 call gsckov(nmed,npckov,ppckov,absco,effic,rindex) c define the world box nmed = 1 chname = 'SITE' chshape = 'BOX' par(1) = 100. par(2) = 100. par(3) = 100. npar = 3 call gsvolu(chname,chshape,nmed,par,npar,ivolu) c define the scintillating fiber segment nmed = 100 chname = 'CORE' chshape = 'BOX' par(1) = fiber_length/2 par(2) = fiber_width(1)/2 par(3) = fiber_width(1)/2 npar = 3 call gsvolu(chname,chshape,nmed,par,npar,ivolu) nmed = 101 chname = 'CLA1' chshape = 'BOX' par(1) = fiber_length/2 par(2) = fiber_width(2)/2 par(3) = fiber_width(2)/2 npar = 3 call gsvolu(chname,chshape,nmed,par,npar,ivolu) nmed = 102 chname = 'CLA2' chshape = 'BOX' par(1) = fiber_length/2 par(2) = fiber_width(3)/2 par(3) = fiber_width(3)/2 npar = 3 call gsvolu(chname,chshape,nmed,par,npar,ivolu) c place the components of the fiber segment inside each other chname = 'CORE' chmoth = 'CLA1' nr = 1 x = 0 y = 0 z = 0 irot = 0 chonly = 'ONLY' call gspos(chname,nr,chmoth,x,y,z,irot,chonly) chname = 'CLA1' chmoth = 'CLA2' nr = 1 x = 0 y = 0 z = 0 irot = 0 chonly = 'ONLY' call gspos(chname,nr,chmoth,x,y,z,irot,chonly) c place 15 copies of the fibers in a 3x5 configuration in the mother volume chname = 'CLA2' chmoth = 'SITE' nr = 0 do i=-1,1 do j=-2,2 nr = nr + 1 x = 0 y = j*fiber_pitch z = i*fiber_pitch irot = 0 chonly = 'ONLY' call gspos(chname,nr,chmoth,x,y,z,irot,chonly) enddo enddo end real function guplsh(medi0,medi1) integer medi0,medi1 if (medi0 .eq. 102 .and. medi1 .eq. 1) then #if WITH_PAINT guplsh = 0. #else guplsh = 1. #endif else guplsh = 1. endif end