#include "geant321/pilot.h" *CMZ : 3.21/02 29/03/94 15.41.35 by S.Giani *-- Author : SUBROUTINE GUKINE * ************************************************************************ * * * Generates Kinematics for primary tracks * * * ************************************************************************ * #include "geant321/gcunit.inc" #include "geant321/gcflag.inc" #include "geant321/gckine.inc" #include "geant321/gconsp.inc" #include "geant321/gcscan.inc" #include "geant321/gcomis.inc" #include "geant321/gctrak.inc" #include "geant321/gcnum.inc" #include "geant321/gcking.inc" * DIMENSION VERTEX(4),PLAB(5) DIMENSION RNDM(20) integer i,j character*20 pname integer nubuf real ubuf(99) real pmin, pmax real costmin, costmax real vertex_r, vertex_phi real tgtwidth(2) data tgtwidth/0.,0./ * * ----------------------------------------------------------------- * UPWGHT = 1 ISTORY = 0 ev = IDEVT do i=1,10 ev = ev/10. if (ev.lt.10) goto 2 enddo 2 if (int(ev).eq.ev) then write(LOUT,*) IDEVT," events simulated" endif CALL GRNDM(RNDM,3) vertex_r=RNDM(1)*tgtwidth(1) vertex_phi=RNDM(2)*6.28319 TOFG=0 VERTEX(1)=VSCAN(1)+vertex_r*cos(vertex_phi) VERTEX(2)=VSCAN(2)+vertex_r*sin(vertex_phi) VERTEX(3)=VSCAN(3)+((RNDM(3)-0.5)*tgtwidth(2)) IF (IKINE.GT.100) THEN IK=IKINE-100 CALL GRNDM(RNDM,3) pmin=PKINE(1)-0.5*PKINE(4) pmax=PKINE(1)+0.5*PKINE(4) IF (pmin.LE.0) pmin=0.100 PABS=pmin*(pmax/pmin)**RNDM(1) costmin=cos((PKINE(2)+0.5*PKINE(5))*DEGRAD) costmax=cos((PKINE(2)-0.5*PKINE(5))*DEGRAD) THETA=acos(costmin+(costmax-costmin)*RNDM(2)) PHI=(PKINE(3)+PKINE(6)*(RNDM(3)-0.5))*DEGRAD ELSE IK=IKINE CALL GRNDM(RNDM,2) PABS=PKINE(1) THETA=PI*RNDM(1) PHI=TWOPI*RNDM(2) ENDIF PLAB(1) = PABS*SIN(THETA)*COS(PHI) PLAB(2) = PABS*SIN(THETA)*SIN(PHI) PLAB(3) = PABS*COS(THETA) * * Special processing is needed for Cerenkov photons * because they must be generated with polarization. * if (ik .eq. 50) then ik = 48 endif CALL GSVERT(VERTEX,0,0,0.0,0,NVERT) CALL GSKINE(PLAB,IK,NVERT,0,0,NT) * * Kinematic debug (controled by ISWIT(1)) * IF(IDEBUG.EQ.1.AND.ISWIT(1).EQ.1) THEN CALL GPRINT('VERT',0) CALL GPRINT('KINE',0) ENDIF END