c************************************************************************ * subroutine kinegen(nvtx,xvert) c Generates tracks by reading kinematics from KINEGEN common block. c c created on: 07/01/2000 by R. Schicker c c last modified on 21/03/2005 by R. Holzmann c c c get event from common block /kinegen/ filled from Cint via passEvent() c************************************************************************* implicit none integer nvtx real xvert(3) #include "user.inc" #include "kinetups.inc" #include "kinegenc.inc" #include "geatarget.inc" #include "geant321/gcflag.inc" #include "geant321/gctrak.inc" real ubuf(4), p(3), genetype1, genetype2, genetype3 real weight, xv(3) real tofsave integer i, itrack, itr, itype ebeam = 1000.*eb ! beam energy in MeV/u bpar = bp ! impact parameter phi_event = phiev ! event angle tofsave = tofg do itr=1,ngen itype = idgen(itr) if (iswit(1).gt.0 .and. itype.ne.iswit(1)) goto 20 ! skip this particle, do not track it if (iswit(1).lt.0 .and. itype.eq.-iswit(1)) goto 20 p(1) = pxgen(itr) p(2) = pygen(itr) p(3) = pzgen(itr) weight = wgen(itr) genetype1 = float(idsrc(itr)) genetype2 = float(idpar(itr)) genetype3 = float(ixpar(itr)) xv(1) = xvert(1) + 0.1*vxgen(itr) ! adjust vertex (vxgen is in mm) xv(2) = xvert(2) + 0.1*vygen(itr) xv(3) = xvert(3) + 0.1*vzgen(itr) ubuf(1) = idsrc(itr) ubuf(2) = idpar(itr) ubuf(3) = ixpar(itr) ubuf(4) = weight tofg = vtgen(itr)*1.e-9 ! set tofg in common /GCTRAK/ call gsvert(xv,0,0,ubuf,0,nvtx) call gskine(p,itype,nvtx,ubuf,4,itrack) if (itrack.gt.0) then ! save primary kinematics call copykine(itrack,itype,p,xv,0,0, + weight,-1.,genetype1,genetype2,genetype3) end if 20 continue enddo tofg = tofsave return end