1 c-----------------------------------------------------------------------
3 c-----------------------------------------------------------------------
4 c determines interaction configuration
5 c-----------------------------------------------------------------------
11 common/geom/rmproj,rmtarg,bmax,bkmx
13 common /cncl/xproj(mamx),yproj(mamx),zproj(mamx)
14 * ,xtarg(mamx),ytarg(mamx),ztarg(mamx)
15 common/cncl3/iactpr(mamx),iacttg(mamx)
18 call utpri('conaa ',ish,ishini,4)
25 vel=tanh(ypjtl-yhaha)+tanh(yhaha)
27 c determine phi, bimp, coll, iproj, itarg, x/y/zproj, x/y/ztarg
28 c ---------------------------------------------------------------
41 bij=bkmx*sqrt(rangen())
72 elseif(maproj.eq.1.and.matarg.eq.1)then
76 if(b1.gt.b2)call utstop('conaa: bmin > bmax&')
77 bimp=sqrt(b1*b1+(b2*b2-b1*b1)*rangen())
86 xproj(1)=bimp*cos(phi)
87 yproj(1)=bimp*sin(phi)
105 iactpr(1)=1 !int(rangen()+1./chad(iclpro)) !active proj.
106 iacttg(1)=1 !int(rangen()+1./chad(icltar)) !active targ.
107 if(iactpr(1).eq.0.and.iacttg(1).eq.0)iret=-1
111 call conxyz('p',mamx,xproj,yproj,zproj,ypjtl-yhaha)
112 call conxyz('t',mamx,xtarg,ytarg,ztarg,yhaha)
119 b2=amin1(rmproj+rmtarg,bmaxim)
120 if(b1.gt.b2)call utstop('conaa: bmin > bmax&')
121 bimp=sqrt(b1**2+(b2**2-b1**2)*rangen())
122 if(nbarray.gt.0)bimp=barray(mod(nrevt,nbarray)+1)
124 bimp=b1+(b2-b1)*(float(mod(nrevt,12))+rangen())/12.
127 phi=phimin+rangen()*(phimax-phimin)
135 if(jpsi.lt.0)then !modify b
139 if(maproj.eq.0)goto1000
140 c wactv=1./chad(2) !probability to be "active"
145 iactpr(i)=1 !int(rangen()+wactv) !active proj. nucleons
150 iacttg(j)=1 !int(rangen()+wactv) !active targ. nucleons
153 if(iactpr(i).eq.0)goto 12
155 if(iacttg(j).eq.0)goto 11
156 if(jpsi.lt.0.and.ztarg(j).le.ztarg(1))goto11
157 bij=sqrt((xproj(i)+bx-xtarg(j))**2+(yproj(i)+by-ytarg(j))**2)
158 if(ish.ge.7)write(ifch,*)'i_p:',i,' i_t:',j,' b_ij:',bij
159 if(bij.gt.bkmx)goto 11
162 if(koll.gt.kollmx)call utstop('conaa: kollmx too small&')
164 bkx(koll)=xproj(i)+bx-xtarg(j)
165 bky(koll)=yproj(i)+by-ytarg(j)
170 kproj(i,lproj(i))=koll
171 ktarg(j,ltarg(j))=koll
173 if(bij.gt.bkmxndif)goto 11
174 lproj3(i)=lproj3(i)+1
175 ltarg3(j)=ltarg3(j)+1
176 kproj3(i,lproj3(i))=koll
177 ktarg3(j,ltarg3(j))=koll
189 if(((iactpr(1).eq.0.and.maproj.eq.1)
190 &.or.(iacttg(1).eq.0.and.matarg.eq.1))
191 &.and.iret.eq.0)iret=-1
195 if(ish.ge.3)write(ifch,*)'koll=',koll
196 if(koll.eq.0)goto 1001
204 dist=ztarg(j)-zproj(i)
205 coord(1,kl)=(xproj(i)+xtarg(j))*0.5
206 coord(2,kl)=(yproj(i)+ytarg(j))*0.5
207 coord(3,kl)=(zproj(i)+ztarg(j))*0.5
217 write(ifch,*)'ia,x/y/zproj:'
219 write(ifch,*)mm,iactpr(mm),xproj(mm),yproj(mm),zproj(mm)
221 write(ifch,*)'ia,x/y/ztarg:'
223 write(ifch,*)mm,iacttg(mm),xtarg(mm),ytarg(mm),ztarg(mm)
225 write(ifch,*)'iret',iret
227 call utprix('conaa ',ish,ishini,4)
230 1001 continue !iret=1 causes redo of whole collision
234 write(ifch,*)'***** subroutine conaa:'
235 write(ifch,*)'***** no nucleon pair found --> no interaction'
242 c-----------------------------------------------------------------------
243 subroutine xGeometry(iii)
244 c-----------------------------------------------------------------------
246 include 'epos.incems'
247 include 'epos.incsem'
248 common/xgeom/nnn,naa(kollmx),nbb(kollmx)
249 character*5 fmt1,fmt2
264 if(r.le.sqrt(sigine/10./pi))ngl=ngl+1
273 if(xpar1.eq.0..and.xpar2.eq.0.)then
274 print*,'---------- xGeometry -----------------------'
282 if(naa(k).ne.0.)kmx=k
283 nbb(k)=nbb(k-1)+naa(k)
309 elseif(k.gt.k1.and.k.lt.k2)then
322 if(k1.le.9)fmt1='i1,4x'
323 if(k1.gt.9.and.k1.le.99)fmt1='i2,3x'
324 if(k1.gt.99.and.k1.le.999)fmt1='i3,2x'
325 if(k1.gt.999.and.k1.le.9999)fmt1='i4,1x'
326 if(k2.le.9)fmt2='i1,4x'
327 if(k2.gt.9.and.k2.le.99)fmt2='i2,3x'
328 if(k2.gt.99.and.k2.le.999)fmt2='i3,2x'
329 if(k2.gt.999.and.k2.le.9999)fmt2='i4,1x'
330 write(6,'(i4,a,i5,a,'//fmt1//',i6,a,i5,a,'//fmt2//',5x,a,f8.2)')
331 & nint(xpar2),':MIN',n1,'%',k1
332 & ,nint(xpar1),':MAX',n2,'%',k2 ,'av:',av
337 c-----------------------------------------------------------------------
339 c-----------------------------------------------------------------------
340 double precision om1intbc,p,eps
342 include 'epos.incsem'
348 p=1.d0-dexp(-om1intbc(b2))
349 if(p.gt.2.d0*eps)return
356 p=(1.d0-dexp(-om1intbc(b)))
359 if(p.gt.2.d0*eps)then
366 if(p.lt.eps/5.d0)then
374 if(ntry.le.1000)goto 10
375 write(ifmt,*)'Too much try in conbmx ... bmax=',b
381 c-----------------------------------------------------------------------
382 function conbmxndif()
383 c-----------------------------------------------------------------------
384 double precision om1intbc,p,eps
386 include 'epos.incsem'
396 p=1.d0-dexp(-om1intbc(b2))
397 if(p.gt.2.d0*eps)goto 100
404 p=(1.d0-dexp(-om1intbc(b)))
407 if(p.gt.2.d0*eps)then
414 if(p.lt.eps/5.d0)then
422 if(ntry.le.1000)goto 10
423 write(ifmt,*)'Too much try in conbmxndif ... bkmxndif=',b
425 100 iomega=iomegasave
430 c-----------------------------------------------------------------------
432 c-----------------------------------------------------------------------
433 c find b to have (1-exp(-om))pmax=pdiff
434 c-----------------------------------------------------------------------
435 double precision om1intbc,pmax,drootom,pdiff
437 include 'epos.incsem'
446 pmax=1.d0-dexp(-om1intbc(b1))
449 conbmxdif=drootom(pdiff,pmax,bmax,eps)
457 c-----------------------------------------------------------------------
459 c-----------------------------------------------------------------------
460 c initializes remnants
461 c-----------------------------------------------------------------------
462 include "epos.incems"
465 call utpri('conre ',ish,ishini,6)
476 is=idproj/iabs(idproj)
477 if(ia.ne.111.and.ia.ne.222.and.ia.ne.333)id=idproj/10*10
478 if(ia.eq.111.or. ia.eq.222.or. ia.eq.333)id=idproj/10*10+is
479 if(ia.eq.213)id=1230*is
480 if(iabs(idproj).lt.20)id=idproj
483 if(rangen().le.(la-las)*1./(ma-mas))id=1120
484 if(id.eq.1120)las=las+1
502 is=idtarg/iabs(idtarg)
503 if(ia.ne.111.and.ia.ne.222.and.ia.ne.333)id=idtarg/10*10
504 if(ia.eq.111.or. ia.eq.222.or. ia.eq.333)id=idtarg/10*10+is
505 if(ia.eq.213)id=1230*is
506 if(iabs(idtarg).lt.20)id=idtarg
509 if(rangen().le.(la-las)*1./(ma-mas))id=1120
510 if(id.eq.1120)las=las+1
519 call utprix('conre ',ish,ishini,6)
523 c-----------------------------------------------------------------------
525 c-----------------------------------------------------------------------
526 c initializes target remnant in case of appl lepton
527 c-----------------------------------------------------------------------
528 include "epos.incems"
529 common/nucl1/laproj,maproj,latarg,matarg,core,fctrmx
530 common/hadr2/iomodl,idproj,idtarg,wexcit
543 if(rangen().le.(la-las)*1./(ma-mas))id=1120
544 if(id.eq.1120)las=las+1
556 c-----------------------------------------------------------------------
558 c-----------------------------------------------------------------------
560 c-----------------------------------------------------------------------
562 include "epos.incems"
563 double precision XA(64,3),XB(64,3),BQGS,BMAXQGS,BMAXNEX,BMINNEX
564 COMMON /Q_QGSNEX1/ XA,XB,BQGS,BMAXQGS,BMAXNEX,BMINNEX
565 common/nucl3/phi,bimp
566 common /cncl/xproj(mamx),yproj(mamx),zproj(mamx)
567 *,xtarg(mamx),ytarg(mamx),ztarg(mamx)
568 parameter(iapmax=207)
569 double precision bqgs2,bmaxqgs2,bmaxnex2,bminnex2,xan,xbn
570 common /qgsIInex1/xan(iapmax,3),xbn(iapmax,3)
571 *,bqgs2,bmaxqgs2,bmaxnex2,bminnex2
574 call utpri('conwr ',ish,ishini,6)
583 if(iokoll.eq.1)then ! precisely matarg collisions
588 tivptl(1,nptl)=-ainfin
597 tivptl(1,nptl)=-ainfin
604 elseif(iappl.ne.7)then
611 if(model.eq.2)then !QGSJet
617 elseif(model.eq.7)then !QGSJetII
623 elseif(model.ge.3)then !Gheisha, ...
627 xorptl(1,nptl)=xproj(i)+bx/2
628 xorptl(2,nptl)=yproj(i)+by/2
629 xorptl(3,nptl)=zproj(i)
631 tivptl(1,nptl)=-ainfin
632 c for visualisation uncomment
633 c-c tivptl(1,nptl)=-100
634 tivptl(2,nptl)= ainfin
641 if(model.eq.2)then !QGSJet
647 elseif(model.eq.7)then !QGSJetII
653 elseif(model.ge.3)then !Gheisha, ...
657 xorptl(1,nptl)=xtarg(i)-bx/2
658 xorptl(2,nptl)=ytarg(i)-by/2
659 xorptl(3,nptl)=ztarg(i)
661 tivptl(1,nptl)=-ainfin
662 c for visualisation uncomment
663 c-c tivptl(1,nptl)=-100
664 tivptl(2,nptl)= ainfin
681 pptl(4,nptl)=sqrt(pnullx**2+ams**2)
699 pptl(4,nptl)=sqrt(pnullx**2+ams**2)
715 pptl(4,nptl)=sqrt(pnullx**2+ams**2)
732 call utprix('conwr ',ish,ishini,6)
736 c------------------------------------------------------------------------
737 subroutine conxyz(ch,n,x,y,z,ynuc)
738 c-----------------------------------------------------------------------
747 elseif(ch.eq.'t')then
751 call utstop('conxyz: nucleus neither proj nor targ&')
754 if(massnr.eq.0)return
755 if(massnr.gt.n)call utstop('conxyz: massnr.gt.n&')
765 if(massnr.ge.10)then !---wood-saxon density---
767 rad=rad/difnuc(massnr)
768 cr1=1.+3./rad+6./rad**2+6./rad**3
772 1 zuk=rangen()*cr1-1.
774 tt=rad*(rangen()**.3333-1.)
775 elseif(zuk.le.cr2 )then
777 elseif(zuk.lt.cr3 )then
778 tt=-log(rangen())-log(rangen())
780 tt=-log(rangen())-log(rangen())-log(rangen())
782 if(rangen().gt.1./(1.+exp(-abs(tt))))goto 1
784 zz=rim*(2.*rangen()-1.)
785 rim=sqrt(rim*rim-zz*zz)
786 z(i)=zz*difnuc(massnr)
788 x(i)=rim*c*difnuc(massnr)
789 y(i)=rim*s*difnuc(massnr)
792 elseif(massnr.ge.3)then ! ---gaussian density---
794 rad=rad*sqrt(2.*massnr/(massnr-1.)) !van hove simulation
799 aks=rad *(rangen()+rangen()+rangen()-1.5)
801 if(l.eq.1)x(k)=summ-aks*sqrt(float(j)/k)
802 if(l.eq.2)y(k)=summ-aks*sqrt(float(j)/k)
803 if(l.eq.3)z(k)=summ-aks*sqrt(float(j)/k)
804 summ=summ+aks/sqrt(float(j*k))
811 elseif(massnr.eq.2)then ! ---deuteron---
813 !.........r=t*difnuc(massnr), t~exp(-2*t)*(1-exp(-a*t))
815 2 t=-0.5*alog(rangen()) !~exp(-2*t)
816 if(rangen().gt.(1-exp(-a*t))**2)goto2
818 zz=r*(2.*rangen()-1.)
830 stop'conxyz: wrong massnr. '
836 rmax=(radnuc(massnr)+3)
837 drnucl(iii)=rmax/mxnucl
838 nrnucl(iii)=nrnucl(iii)+1
840 r=sqrt(x(i)**2+y(i)**2+z(i)**2)
841 k=1+int(r/drnucl(iii))
842 if(k.le.mxnucl)rnucl(k,iii)=rnucl(k,iii)+1
854 c-----------------------------------------------------------------------
856 c-----------------------------------------------------------------------
859 imax=max(maproj,matarg)
860 if(idtargin.eq.0)imax=max(imax,40)
863 if(massnr.gt.imax.or.massnr.eq.1)then
866 elseif(massnr.eq.197)then
869 elseif(massnr.ge.10)then
870 rad=1.12*massnr**0.33333-0.86*massnr**(-0.33333)
871 elseif(massnr.ge.3)then
872 rad=.9*float(massnr)**.3333
873 elseif(massnr.eq.2)then
882 c-----------------------------------------------------------------------
883 subroutine xConNuclDens(iii)
884 c-----------------------------------------------------------------------
885 c plots distribution of nucleons in nuclei
886 c iii = 1 (proj) or 2 (targ)
887 c-----------------------------------------------------------------------
897 write(ifhi,'(a)') '!-----------------------------------------'
898 write(ifhi,'(a)') '! nuclear density '
899 write(ifhi,'(a)') '!-----------------------------------------'
900 write(ifhi,'(a)') 'openhisto'
901 if(massnr.ge.10)write(ifhi,'(a)')'htyp lin xmod lin ymod lin'
902 if(massnr.lt.10)write(ifhi,'(a)')'htyp lin xmod lin ymod log'
903 write(ifhi,'(a)') 'text 0 0 "title nuclear density"'
904 write(ifhi,'(a)') 'text 0.99 -0.15 " r (fm) "'
905 write(ifhi,'(a)') 'text 0 0 "yaxis rho(r)"'
906 write(ifhi,'(a,2e11.3)')'xrange',0.,mxnucl*drnucl(iii)
907 write(ifhi,'(3a)')'yrange',' 0 ',' auto'
908 write(ifhi,'(a)') 'array 2'
910 r=(j-0.5)*drnucl(iii)
912 write(ifhi,'(2e12.4)') r,rnucl(j,iii)/nrnucl(iii)/
913 * (4./3.*pi*((r+d)**3-(r-d)**3))
915 write(ifhi,'(a)') ' endarray'
916 write(ifhi,'(a)') 'closehisto plot 0-'
917 write(ifhi,'(a)') 'openhisto'
918 write(ifhi,'(a)') 'htyp lbo '
919 write(ifhi,'(a)') 'array 2'
921 r=(j-0.5)*drnucl(iii)
925 rho=1.00*((1-exp(-b*a*rr))*exp(-a*rr)/rr)**2
926 elseif(massnr.eq.197)then
927 rho=0.16/(1+exp((r-6.5)/0.562))
928 elseif(massnr.ge.10)then
929 rho=0.16/(1+exp((r-radnuc(massnr))/difnuc(massnr)))
931 write(ifhi,'(2e12.4)') r,rho
933 write(ifhi,'(a)') ' endarray'
934 write(ifhi,'(a)') 'closehisto plot 0'
937 c-----------------------------------------------------------------------
938 subroutine xConThick(iii)
939 c-----------------------------------------------------------------------
940 ! plots sigma_pp *T_A (b) (=average number of collisions)
941 ! T_A = thickness function
942 ! iii = 1 (proj) or 2 (targ)
943 !----------------------------------------------------------------
945 parameter(iconimax=20,iconkmax=100)
946 real thick(2,0:iconimax)
950 ramx=mxnucl*drnucl(iii)
963 sum=sum+h/6.*(rho0+4*rho1+rho2)
966 sum=sum*2 ! integral fro -infty to +infty
970 write(ifhi,'(a)') 'openhisto'
971 write(ifhi,'(a)') 'htyp lbo '
972 write(ifhi,'(a)') 'txt "xaxis b (fm)" '
973 write(ifhi,'(a)') 'txt "yaxis [s]?pp! T?A! (b) " '
974 write(ifhi,'(a)') 'array 2'
976 write(ifhi,'(2e12.4)') thick(1,i),sigine/10.*thick(2,i)
978 write(ifhi,'(a)') ' endarray'
979 write(ifhi,'(a)') 'closehisto plot 0'
982 c-----------------------------------------------------------------------
983 function conrho(iii,r)
984 c-----------------------------------------------------------------------
986 ! iii = 1 (proj) or 2 (targ)
987 !----------------------------------------------------------------
1001 rho=1.00*((1-exp(-b*a*rr))*exp(-a*rr)/rr)**2
1002 elseif(massnr.eq.197)then
1003 rho=0.16/(1+exp((r-6.5)/0.562))
1004 elseif(massnr.ge.10)then
1005 rho=0.16/(1+exp((r-radnuc(massnr))/difnuc(massnr)))