source: trunk/examples/extended/electromagnetic/TestEm3/geant3/src/gukine.F @ 1309

Last change on this file since 1309 was 807, checked in by garnier, 16 years ago

update

File size: 1.7 KB
Line 
1
2      SUBROUTINE GUKINE
3
4*    Generates Kinematics for primary track
5*
6*    Data card Kine : Itype  Ekine x0  y0  z0  ux  uy  uz rbeam
7*
8*    rbeam : size of the random beam extension in fraction of 0.5*calorYZ
9*
10#include "geant321/gcbank.inc"
11#include "geant321/gcflag.inc"
12#include "geant321/gckine.inc"
13#include "calor.inc"
14#include "histo.inc"                                                         
15*                                                                               
16      DIMENSION VERTEX(3),PLAB(3)
17      dimension rndm(2)
18*
19      data aMeV /1.e-3/     
20*
21* *** set/reset default kinematic
22      IF ((IKINE.LT.0).or.(abs(PKINE(2)).GT.0.5*worldX)) THEN
23          IKINE = ABS(IKINE)
24          PKINE(2) = -0.5*worldX
25          PKINE(3) = 0.
26          PKINE(4) = 0.
27          PKINE(5) = 1.
28          PKINE(6) = 0.
29          PKINE(7) = 0.
30      ENDIF
31*
32*     random in YZ ?
33      if ((pkine(8).lt.0.).or.(pkine(8).gt.1.)) pkine(8) = 0.
34      rbeam = pkine(8)*0.5*calorYZ
35      call GRNDM (rndm,2)
36*       
37      VERTEX(1) = PKINE(2)
38      VERTEX(2) = PKINE(3) + (2*rndm(1)-1.)*rbeam
39      VERTEX(3) = PKINE(4) + (2*rndm(2)-1.)*rbeam
40*
41      CALL GSVERT(VERTEX,0,0,0,0,NVERT)
42*
43*
44      JPA     = LQ(JPART-IKINE)
45      XMASS   =  Q(JPA+7)
46      PMOM    = SQRT(PKINE(1)*(PKINE(1)+2*XMASS))
47      PLAB(1) = PMOM*PKINE(5)
48      PLAB(2) = PMOM*PKINE(6)
49      PLAB(3) = PMOM*PKINE(7)
50*
51      CALL GSKINE(PLAB,IKINE,NVERT,0,0,NT)
52*
53* *** Kinematics debug
54      IF (IEVENT.EQ.1.OR.IDEBUG.NE.0) CALL GPRINT('KINE',0)
55*                                                                               
56      END                                                                       
Note: See TracBrowser for help on using the repository browser.