COSMOS v7.655  COSMOSv7655
(AirShowerMC)
chANewLund.f
Go to the documentation of this file.
1 ! hadron A collision by New Lund (Fritiof v7.02)
2  subroutine chanewlund(pj, ia, iz, a, ntp)
3  implicit none
4 
5 #include "Zptcl.h"
6 #include "Zcode.h"
7 #include "Zevhnv.h"
8 !
9  type(ptcl):: pj ! input projectile ptcl
10  integer ia ! input. nucleon no. of target
11  integer iz ! input. charge no. of target
12  type(ptcl):: a(*) ! output. produced ptcls
13  integer ntp ! number of produced ptcls
14 !
15  type(ptcl):: tgt, temp
16  integer icon, kf, i, code, subcode, charge, maxi
17  real*8 maxe
18 ! type(fmom):: gb ! (g*beta, gc)
19  character*100 msg
20 !////////////
21 ! logical deb
22 ! common /cccdeb/deb
23 ! integer seed(2)
24 ! debug = .false.
25 !////////////
26 !
27 
28 ! make target nucleon simply to form cms
29  call cmkptc(knuc, regptcl, 1, tgt)
30 ! give 4 momentum
31  tgt.fm.p(1) = 0.
32  tgt.fm.p(2) = 0.
33  tgt.fm.p(3) = 0.
34  tgt.fm.p(4) = tgt.mass
35 !
36 ! make projectile so that its direction is z
37 !
38  pjlab.fm.p(1) = 0.
39  pjlab.fm.p(2) = 0.
40  pjlab.fm.p(3) = sqrt(pj.fm.p(4)**2-pj.mass**2)
41  pjlab.fm.p(4) = pj.fm.p(4)
42  pjlab.mass = pj.mass
43 ! Pjlab.code = pj.code
44 ! Pjlab.subcode = pj.subcode
45 ! Pjlab.charge = pj.charge
46 
47 ! get cms equivlent mass and 4 momentum
48  call cgeqm(pjlab, tgt, cmsp, icon)
49  if(icon .ne. 0) then
50  write(msg, *)
51  * ' cms cannot be formed in chANewLund; proj and ',
52  * 'target are '
53  call cerrormsg(msg, 1)
54  call cprptc(pjlab, 1)
55  call cprptc(tgt, 1)
56  stop 9999
57  endif
58 ! get (g*beta, gc) of cms
59 ! call cgetlf(Cmsp, gb)
60 ! boost pj into cms.
61 ! call cbst0(1, gb, Pjlab, Pjcms)
62 !
63  code = pj.code ! need substitution due to integer*2
64  subcode = pj.subcode
65  charge = pj.charge
66 ! convert particle code to kf code
67  call ccos2kf(code, subcode, charge, kf)
68 ! generate ptcls in cms and set them in a
69 !/////////////
70 ! debug = pj.fm.p(4) .gt. 30.e3
71 ! if(debug) then
72 ! write(*,*) '-----',
73 ! * pj.fm.p(1), pj.fm.p(2), pj.fm.p(3), pj.fm.p(4)
74 ! write(*,*) 'ia, iz=', ia,iz,code,subcode,charge, kf
75 ! call rnd1s(seed)
76 ! write(*,*) ' seed=', seed
77 ! endif
78 ! if( deb ) then
79 ! write(*,*) ' bef cfrevent '
80 ! endif
81 !///////////
82 
83  call cfrevent(kf, charge, ia, iz, cmsp.mass, a, ntp)
84 
85 !////////////////
86 ! if( deb ) then
87 ! write(*,*) ' after cfrevent '
88 ! endif
89 !////////
90 
91 ! boost back to lab.
92 ! find max energy partcle and store it in the last
93 ! part. (to save stack area, later)
94  maxe = -1.
95  do i=1, ntp
96  call cibst1(i, cmsp, a(i), a(i))
97  if(a(i).fm.p(4) .gt. maxe) then
98  maxe = a(i).fm.p(4)
99  maxi = i
100  endif
101 ! &&&&&&&&&&&&&&&&777
102 ! write(*,*) ' code=', a(i).code, ' sub=', a(i).subcode,
103 ! * ' chg=', a(i).charge, ' KE=', a(i).fm.p(4) - a(i).mass
104 ! &&&&&&&&&&&&&&&&
105  enddo
106  temp = a(maxi)
107  a(maxi) = a(ntp)
108  a(ntp) = temp
109 ! in above, momentum is measured from pj.fm so
110 ! we need rotate it.
111  call crot3mom(pj, a, ntp)
112  end
113 
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cibst1(init, p1, p2, po)
Definition: cibst1.f:29
subroutine cgeqm(p1, p2, q, icon)
Definition: cgeqm.f:2
subroutine ccos2kf(code, subcode, chg, kf)
Definition: ckf2cos.f:216
subroutine chanewlund(pj, ia, iz, a, ntp)
Definition: chANewLund.f:3
max ptcl codes in the kseethru ! subcode integer regptcl
Definition: Zcode.h:2
subroutine crot3mom(p, a, n)
Definition: crot3mom.f:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
subroutine cprptc(p, n)
Definition: cmkptc.f:395
subroutine cmkptc(code, subcode, charge, p)
Definition: cmkptc.f:15
Definition: Zptcl.h:75
*Zfirst p fm *Zfirst p mass
Definition: ZavoidUnionMap.h:1