-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparcas_30.f
4966 lines (4580 loc) · 171 KB
/
parcas_30.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
subroutine parcas(time_par,jjj,iijk,win,nap,rnt,rnp)
c deals with parton cascade (partonic rescattering)
c writen by Ben-Hao Sa at 19/11/2002
c input messages are in 'pyjets' ! 051122
c working block is 'pyjets' ! 051122
c output messages are in 'pyjets' ! 051122
c160110 iiii: number of run
c jjj: jjj-th loop interaction in a event ! 180520
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (KSZJ=80000,MSCA=20000,MCLIS=280000) ! 051122
COMMON/PYJETS/N,NPAD,K(KSZJ,5),P(KSZJ,5),V(KSZJ,5) ! 051122
COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200) ! 240503
COMMON/PYCIDAT2/KFMAXT,NONCI2,PARAM(20),WEIGH(600) ! 300623 Lei
common/sa1/kjp21,non1,bp,iiii,neve,nout,nosc
common/sa8_p/taup(kszj),coor(3),ishp(kszj) ! 300623 Lei
common/sa12/ppsa(5),nchan,nsjp,sjp,ttaup,taujp ! 120505
common/sa24/adj1(40),nnstop,non24,zstop
common/sa33/smadel,ecce,secce,parecc,iparres ! 080520
common/collist/lc(2,mclis),tc(2,mclis),icol
common/scatt/pi(4),pj(4),ic,jc,n0 ! 051122
common/work7/reac(9),crose(9)
common/papr_p/core,xs,xu,xxt,sm,as,dta,xa,sl0,tl0,qa,
c ea,sqq,sqg,sgg,pa(3),pip(6,msca),mtime,kfk,nsca,kpip(msca)
c icol : current total number of collision pairs in collision time list
c lc : line number (in [1,n]) of colliding pair, eg.
c lc(1,100): line number of first particle of 100-th colliding pair
c tc : the collision time of colliding pair
c ic,jc: line number of colliding particles
c n0: the n before current collision
c pi,pj: four momentum of colliding particles
c taup(i) : formation time of particle i. ! 300623 Lei
c ishp(i)=1 if i-th particle inside the simulated volume ! 300623 Lei
c =0 if i-th particle outside the simulated volume ! 300623 Lei
dimension rpo(kszj,4),ppo(kszj,4) ! 051122
c051122 rpo,ppo: parton four coordinate before Neuton motion, four momentum
c051122 before energy loss
c151203 iijk=0 ! 120603
tl0=adj1(24)
c tl0: cut off virtuality of time-like branching, i. e. Mu0**2
if(ABS(adj1(1)).le.1D-15)return ! 290505 300623 Lei i.e. adj1(1)=0
time=time_par ! 280910
adj112=adj1(12)
adj136=adj1(36) ! 120505
adj137=adj1(37) ! 120505
call reset_eve
c241104
c300623 ithroq_p=0 ! 300623 Lei
c300623 ithrob_p=0
c300623 ich_p=0
c300623 do i=1,4
c300623 throe_p(i)=0.
c300623 enddo
do i1=1,n ! 051122
v(i1,4)=0.
taup(i1)=0. ! 300623 Lei
enddo
c241104
c300623 Lei
dpmax=adj1(27)
drmax=PARAM(10)*dmax1(rnt,rnp) ! 300623 Lei
do i1=1,n
if(k(i1,2).eq.88)then ! Excludes junctions.
ishp(i1)=0
goto 200
endif
ppp1=p(i1,1)
ppp2=p(i1,2)
ppp3=p(i1,3)
ppp4=p(i1,4)
rrr1=v(i1,1)
rrr2=v(i1,2)
rrr3=v(i1,3)
pppm=ppp1*ppp1+ppp2*ppp2+ppp3*ppp3
if(pppm.lt.1D-28)pppm=1D-28
if(pppm.gt.1D28)then
ishp(i1)=0
goto 200
endif
pppm=SQRT(pppm)
rrrm=rrr1*rrr1+rrr2*rrr2+rrr3*rrr3
if(rrrm.lt.1D-28)rrrm=1D-28
if(rrrm.gt.1D28)then
ishp(i1)=0
goto 200
endif
rrrm=SQRT(rrrm)
if((pppm.le.dpmax.and.ppp4.le.dpmax).and.rrrm.le.drmax)then
ishp(i1)=1
else
ishp(i1)=0
endif
200 enddo
c300623 Lei
c300623 calculate the position for the center of mass of the ! 300623 Lei
c non-freeze-out system. The distance of a particle, when checking
c is it freezing out or not, is measured with respect to this center
call copl_p(time) ! 300623 Lei
c step 1
c create the parton-parton (initial) collision time list
call ctlcre_par(iijk) ! 290803
if(iijk.eq.2)return ! initial collis. list is empty 151203
c290803
c151203 if(iijk.eq.1)then
c151203 iiii=iiii-1
c151203 return
c151203 endif
c290803
c160110 the loop over parton-parton collisions within an event
jjj=0
icolo=icol ! 120603
c statistic of the number of loops in parton cascade within an event
24 jjj=jjj+1 ! 160110
c---------------------------------------------------------------------
if(jjj.gt.100*icolo)then
write(9,*)'infinite loop may have happened in'
write(9,*)'parcas iiii,jjj,icolo=',iiii,jjj,icolo
iiii=iiii-1
iijk=1
return
endif
n0=n ! 051122
if(jjj.gt.1) call copl_p(time) ! 300623 Lei
c step 2
c find out the binary collision (icp) with the minimum colli. time
c the collision time list is empty if icp=0
call find_par(icp,tcp)
if(icp.eq.0)goto 25 ! colli. list, empty
ic=lc(1,icp)
jc=lc(2,icp)
c131104
c080520 parton rescattering is assumed no longer than 10000 fm/c
if(tcp.le.10000.)goto 27
do i1=icp+1,icol
lc(1,i1-1)=lc(1,i1)
lc(2,i1-1)=lc(2,i1)
tc(1,i1-1)=tc(1,i1)
tc(2,i1-1)=tc(2,i1)
enddo
icol=icol-1
jjj=jjj-1
goto 24
27 continue
time=tcp
c step 3
c perform classical Neuton motion for ic & jc partons
do i=1,n ! 051122
do j=1,3
rpo(i,j)=v(i,j)
c300623 vpij=p(i,j)/p(i,4) ! 300623 Lei
c300623 v(i,j)=v(i,j)+vpij*(tcp-v(i,4)) ! 300623 Lei
enddo
rpo(i,4)=v(i,4)
c300623 v(i,4)=tcp ! 300623 Lei
enddo
call his_p(time,rnt,rnp,istop) ! 300623 Lei
if(istop.eq.1) goto 25 ! 300623 Lei
c300623 istop=1 means all particles have get out of considered volume
c120603
c consider parton energy loss phenomenologically
c120505
if(INT(adj136).eq.1)then ! 280224 Lei INT
bmax=rnt+rnp
bmax2=bmax*bmax
bp2=bp*bp
c energy loss per unit distance
dell=adj137*(nap/197.)**0.75*(1.-bp2/bmax2)
c *(win*win/40000)**0.25
call eloss(dell,rpo,ppo)
endif
c120505
c step 4
c performs parton-parton collision & updates particle list
c if lmn=4,6,& 7 updates,'pyjets','sbe',diquark list,string
c list, & lc(1-2,m) either
kkk=0 ! 120603
iway=0 ! 120505
call collis(ic,jc,kf3,kf4,tcp,jjj,kkk,iway,icnew,jcnew
c ,lmn,time) ! 120603 120505 160110
c120603
c120603
c step 5
c060620 update collision list
if(lmn.eq.4.or.lmn.eq.6.or.lmn.eq.7)goto 26 ! 070720
c in above case 'update collision list' is executed in "collis'
call update_ctl(ic,jc,kf3,kf4,iparres,lmn,iway,tcp)
c 'new' method
c1 if(adj136.eq.0)call update_ctl(tcp,iway)
c1 if(adj136.eq.1 .and.iway.eq.1)call update_ctl(tcp,iway)
c if collision does not happen remove the collision pairs (one of
c company is colliding particle) from collision time list only
c1 if(adj136.eq.1 .and.iway.eq.0)then
c create collision time list completely
c1 icol=0
c1 do i=1,mclis
c1 lc(1,i)=0
c1 lc(2,i)=0
c1 tc(1,i)=0.
c1 tc(2,i)=0.
c1 enddo
c1 call ctlcre_para(iijk,time)
c1 endif
c120505
c goto 25 ! it is actived temporally
26 continue ! 120603
goto 24 ! the loop over collisions within an event
25 continue
time_par=time
c time_par: is the time lasted in parton cascade hereafter
c250803
do i=1,9
reaci=reac(i)
if(reaci.gt.0.)crose(i)=crose(i)/reaci
enddo
c250803
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine reset_eve
c initiate the collision time list
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (MCLIS=280000)
common/sa1/kjp21,non1,bp,iii,neve,nout,nosc ! 300623 Lei
common/collist/lc(2,mclis),tc(2,mclis),icol
common/scatt/pi(4),pj(4),ic,jc,n0 ! 051122
common/work7/reac(9),crose(9)
c reac and crose: the arraies to account for the number and
c the value of cross section for 2->2 partonic processes
ic=0
jc=0
if(iii.eq.1)then ! 300623 Lei
lc=0
tc=0.
endif ! 300623 Lei
icol=0
reac=0.
crose=0.
return
end
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine ctlcre_par(iijk)
c create the initial collision list
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (KSZJ=80000,MCLIS=280000) ! 051122
COMMON/PYJETS/N,NPAD,K(KSZJ,5),P(KSZJ,5),V(KSZJ,5) ! 051122
common/sa24/adj1(40),nnstop,non24,zstop ! 210803 181003 161104
common/papr/t0,sig,dep,ddt,edipi,epin,ecsnn,ekn,ecspsn,ecspsm
c ,rnt,rnp,rao,rou0,vneu,vneum,ecsspn,ecsspm,ecsen ! 060813
common/collist/lc(2,mclis),tc(2,mclis),icol
dddt=adj1(19) ! 161104
icol=1
time=0. ! 111599
c every process (eg. parton casecade) starts from time equal to 0
dminf=100. ! 111599
ijk=0 ! 010601
do 100 i=2,n ! upper diagonal 151203 051122
c n00: total # of partons in projectile nucleus
c080603
kfi=iabs(k(i,2))
c051122 if(kfi.gt.3 .and. kfi.ne.21)goto 100 ! 120620
c consider d,u,s, their antiquarks, and gluon only ! 120620
if(kfi.gt.6 .and. kfi.ne.21)goto 100 ! 080520 051122
c consider d,u,s,c,b, their antiquarks, and gluon only ! 080520
c080603
do 200 j=1,i-1 ! upper diagonal 151203
c080603
kfj=iabs(k(j,2))
c051122 if(kfj.gt.3 .and. kfj.ne.21)goto 200 ! 120620
c consider d,u,s, their antiquarks, and gluon only ! 120620
if(kfj.gt.6 .and. kfj.ne.21)goto 200 ! 080520 051122 300623 Lei kfi -> kfj, 100 -> 200
c consider d,u,s,c,b, their antiquarks, and gluon only ! 080520
c080603
if(icol.gt.mclis) then
write(9,*)'icol over limit n,icol=',n,icol ! sa
stop 7777
endif
iflag=0 ! 300623 Lei
call rsfilt_p(j,i,iflag) ! 300623 Lei
if(iflag.eq.0) goto 200 ! 300623 Lei
tc(1,icol)=0.0
tc(2,icol)=0.0
kji=0 ! 240503
call coij_p(i,j,time,icol,dminf,iff,jf,kji)
if(kji.eq.1)then
ijk=ijk+1 ! 010601
goto 200
endif
tc1=tc(1,icol)
tc2=tc(2,icol)
tcicol=tc1
if(tc1.gt.tc2)tcicol=tc2
c080304 if(tcicol.gt.0.0) icol=icol+1
c080304
if(tcicol.gt.0.0)then ! 121104
tci=tcicol
do j1=1,icol-1
tcj=tc(1,j1)
tck=tc(2,j1)
if(tcj.gt.tck)tcj=tck
c161104 if(ddt.eq.0.)dddt=ddt+0.03
c161104 if(ddt.ne.0.)dddt=ddt*300
if(dabs(tcj-tci).lt.dddt)goto 200
enddo
icol=icol+1
endif ! 121104
c080304
200 enddo
100 enddo
c300623 if(tcicol.eq.0.) icol=icol-1 ! 300623 Lei
icol=icol-1 ! 300623 Lei
if(icol.eq.0)then
c290803
iijk=2 ! 1 151203
return
c290803
c at least one collision should occur, which has the smallest
c 'least approaching distance', that is guaranteed by the variable
c 'dminf'
c290803 icol=1
c290803 lc(1,icol)=iff
c290803 lc(2,icol)=jf
c290803 tc(1,icol)=0.02
c290803 tc(2,icol)=0.02
endif
return
end
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine find_par(icp,tcp)
c find out the binary collision (icp) with minimum colli. time (tcp)
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (MCLIS=280000)
common/scatt/pi(4),pj(4),ic,jc,n0 ! 051122
common/collist/lc(2,mclis),tc(2,mclis),icol
icp=0
tcp=10000.
do i=1,icol
ia=(iabs(lc(1,i)-ic)+iabs(lc(2,i)-jc))*
c (iabs(lc(1,i)-jc)+iabs(lc(2,i)-ic)) !it play role after first colli.
if(ia.eq.0) goto 241
tc1=tc(1,i)
tc2=tc(2,i)
tci=tc1
if(tc1.gt.tc2)tci=tc2
c tci=amax1(tc(1,i),tc(2,i)) ! alternative choice.
if(tci.le.0.) goto 241
if(tcp.lt.tci) goto 241
icp=i
tcp=tci
241 continue
enddo
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine update_ctl(ik1,ik2,kf3,kf4,iparres,lmn,iway,time) ! 120505
c020512 update collision time list for both of w/o & w/ inelastic
c020512 parton-parton scattering
c ik1,ik2: line number of the colliding pair in parton list
c kf3 and kf4: kf code of the collided pair
c230520 if iway=1 the collision does not happen
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (KSZJ=80000,MCLIS=280000) ! 051122
COMMON/PYJETS/N,NPAD,K(KSZJ,5),P(KSZJ,5),V(KSZJ,5) ! 051122
common/sa24/adj1(40),nnstop,non24,zstop ! 210803 181003 161104
common/papr/t0,siig,dep,ddt,edipi,epin,ecsnn,ekn,ecspsn,ecspsm
c ,rnt,rnp,rao,rou0,vneu,vneum,ecsspn,ecsspm,ecsen ! 060813
common/scatt/pi(4),pj(4),ic,jc,n0 ! 051122
common/collist/lc(2,mclis),tc(2,mclis),icol
c-----------------------------------------------------------------------
dddt=adj1(19) ! 161104
j=0
c loop over old colliding pairs
if(icol.eq.0)goto 370
do i=1,icol
i1=lc(1,i)
j1=lc(2,i)
iii=(i1-ic)*(j1-ic)
jjj=(i1-jc)*(j1-jc)
if(i1.eq.j1) goto 400 ! 061123 Lei Avoid the particle collideing with itself.
c throw away the pairs composed of ic and/or jc
if(iii.eq.0.or.jjj.eq.0) goto 400
380 continue
tc1=tc(1,i)
tc2=tc(2,i)
tci=tc1
if(tc1.gt.tc2)tci=tc2
c080104 if(tci.le.time) goto 400
c161104 if(ddt.eq.0.)dddt=ddt+0.03
c161104 if(ddt.ne.0.)dddt=ddt*300
c throw away the pairs with tc-time<=dddt (time accuracy)
if((tci-time).le.dddt) goto 400 ! 080104
c proceeds for survivor
j=j+1
tc(1,j)=tc(1,i)
tc(2,j)=tc(2,i)
lc(1,j)=lc(1,i)
lc(2,j)=lc(2,i)
400 continue
enddo
icol=j
if(iway.eq.1)return ! 120505
c-----------------------------------------------------------------
c loop over ic,jc (new) and old partons (i.e. construct colli. pair
c by partons, one of which is ic or jc and another one is in parton list)
370 icol=j+1
do 100 i=1,n0 ! 051122
i1=i
if(i1.eq.ic) goto 100
if(i1.eq.jc) goto 100
c080603
kfi=iabs(k(i,2)) ! 051122
c051122 if(kfi.gt.3 .and. kfi.ne.21)goto 100 ! 120620
c consider d,u,s, their antiquarks, and gluon only ! 120620
if(kfi.gt.6 .and. kfi.ne.21)goto 100 ! 080520 051122
c consider d,u,s,c,b, their antiquarks, and gluon only ! 080520
c080603
do 200 k1=1,2
if(k1.eq.1)j1=ic
if(k1.eq.2)j1=jc
iflag=0 ! 300623 Lei
call rsfilt_p(j1,i1,iflag) ! 300623 Lei
if(iflag.eq.0) goto 200 ! 300623 Lei
tc(1,icol)=0.0
tc(2,icol)=0.0
call tcolij_par(i1,j1,time,icol)
tc1=tc(1,icol)
tc2=tc(2,icol)
tcicol=tc1
if(tc1.gt.tc2)tcicol=tc2
c020603
c if(tcicol.le.0.0)then
c write(9,*)'i1,j1,tcicol=',i1,j1,tcicol ! sa
c endif
c020603
c141104 if(tcicol.gt.0.0) icol=icol+1
if(tcicol.gt.0.0)then ! 141104
tci=tcicol
do j1=1,icol-1
tcj=tc(1,j1)
tck=tc(2,j1)
if(tcj.gt.tck)tcj=tck
if(dabs(tcj-tci).lt.dddt)goto 200
enddo ! 141104
icol=icol+1
endif
200 enddo
100 enddo
450 continue
c061123 if(tcicol.le.0.0) icol=icol-1 ! 061123 Lei
icol=icol-1 ! 061123 Lei
n0=n ! 051122
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine update_ctlm(time,iway) ! 120505 160110
c a part of updating collision time list (throw away old collission
c pairs only) for inela. parton-parton scattering 7 ! 230520
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (MCLIS=280000)
common/sa24/adj1(40),nnstop,non24,zstop ! 210803 181003 161104
common/papr/t0,siig,dep,ddt,edipi,epin,ecsnn,ekn,ecspsn,ecspsm
c ,rnt,rnp,rao,rou0,vneu,vneum,ecsspn,ecsspm,ecsen ! 060813
common/scatt/pi(4),pj(4),ic,jc,n0 ! 051122
common/collist/lc(2,mclis),tc(2,mclis),icol
c-----------------------------------------------------------------------
dddt=adj1(19) ! 161104
j=0
c loop over old colliding pairs
do i=1,icol
i1=lc(1,i)
j1=lc(2,i)
iii=(i1-ic)*(j1-ic)
jjj=(i1-jc)*(j1-jc)
if(i1.eq.j1) goto 400 ! 061123 Lei Avoid the particle collideing with itself.
c throw away the pairs composed of ic and/or jc
if(iii.eq.0.or.jjj.eq.0) goto 400
380 continue
tc1=tc(1,i)
tc2=tc(2,i)
tci=tc1
if(tc1.gt.tc2)tci=tc2
c080104 if(tci.le.time) goto 400
c161104 if(ddt.eq.0.)dddt=ddt+0.03
c161104 if(ddt.ne.0.)dddt=ddt*300
c throw away the pairs with tc-time<=dddt (time accuracy)
if((tci-time).le.dddt) goto 400 ! 080104
j=j+1
tc(1,j)=tc(1,i)
tc(2,j)=tc(2,i)
lc(1,j)=lc(1,i)
lc(2,j)=lc(2,i)
400 continue
enddo
icol=j
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine update_ctln(time,iway) ! 120505 160110
c update the collision time list (a part) for inela. parton-parton
c scattering 7
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (KSZJ=80000,MCLIS=280000) ! 051122
COMMON/PYJETS/N,NPAD,K(KSZJ,5),P(KSZJ,5),V(KSZJ,5) ! 051122
common/sa24/adj1(40),nnstop,non24,zstop ! 210803 181003 161104
common/papr/t0,siig,dep,ddt,edipi,epin,ecsnn,ekn,ecspsn,ecspsm
c ,rnt,rnp,rao,rou0,vneu,vneum,ecsspn,ecsspm,ecsen ! 060813
common/scatt/pi(4),pj(4),ic,jc,n0 ! 051122
common/collist/lc(2,mclis),tc(2,mclis),icol
c-----------------------------------------------------------------------
dddt=adj1(19) ! 161104
c loop over ic (jc) and old 'pyjets' (i.e. construct colli. pair
c composed of partons one of which is ic (jc) and another one
c in old 'pyjets')
icol=icol+1
do 100 i=1,n0 ! 051122
i1=i
if(i1.eq.ic) goto 100
if(i1.eq.jc) goto 100
c080603
kfi=iabs(k(i,2))
c051122 if(kfi.gt.3 .and. kfi.ne.21)goto 100 ! 120620
c consider d,u,s, their antiquarks, and gluon only ! 120620
if(kfi.gt.6 .and. kfi.ne.21)goto 100 ! 080520 051122
c consider d,u,s,c,b, their antiquarks, and gluon only ! 080520
c080603
do 200 k1=1,2
if(k1.eq.1)j1=ic
if(k1.eq.2)j1=jc
iflag=0 ! 300623 Lei
call rsfilt_p(j1,i1,iflag) ! 300623 Lei
if(iflag.eq.0) goto 200 ! 300623 Lei
tc(1,icol)=0.0
tc(2,icol)=0.0
call tcolij_par(i1,j1,time,icol)
tc1=tc(1,icol)
tc2=tc(2,icol)
tcicol=tc1
if(tc1.gt.tc2)tcicol=tc2
c020603
if(tcicol.le.0.0)then
c write(9,*)'i1,j1,tcicol=',i1,j1,tcicol ! sa
endif
c020603
c141104 if(tcicol.gt.0.0) icol=icol+1
if(tcicol.gt.0.0)then ! 141104
tci=tcicol
do j1=1,icol-1
tcj=tc(1,j1)
tck=tc(2,j1)
if(tcj.gt.tck)tcj=tck
if(abs(tcj-tci).lt.dddt)goto 200
enddo ! 141104
icol=icol+1
endif
200 enddo
100 enddo
450 continue
c061123 if(tcicol.le.0.0) icol=icol-1 ! 061123 Lei
icol=icol-1 ! 061123 Lei
n0=n ! 051122
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine coij_p(i,j,time,icp,dminf,iff,jf,kji)
c calculate the collision time for construction
c of initial collision time list
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (KSZJ=80000,MCLIS=280000) ! 051122
COMMON/PYJETS/N,NPAD,K(KSZJ,5),P(KSZJ,5),V(KSZJ,5) ! 051122
common/syspar_p/rsig1,pio,tcut
common/collist/lc(2,mclis),tc(2,mclis),icol
common/scatt/pi(4),pj(4),ic,jc,n0 ! 051122
dimension px(4),py(4),pij(4)
dimension dr(3),db(3),vi(3),vj(3),pic(4),pjc(4),pxc(4),pyc(4)
double precision b(3)
pio=3.1416
pi(4)=p(i,4)
pj(4)=p(j,4)
if(pi(4).lt.1.e-10)pi(4)=1.e-10 ! 031204
if(pj(4).lt.1.e-10)pj(4)=1.e-10 ! 031204
pij(4)=pi(4)+pj(4)
pic(4)=pi(4)
pjc(4)=pj(4)
do k1=1,3
pi(k1)=p(i,k1)
pj(k1)=p(j,k1)
pij(k1)=pi(k1)+pj(k1)
pic(k1)=pi(k1)
pjc(k1)=pj(k1)
b(k1)=(pi(k1)+pj(k1))/pij(4)
enddo
rmi=p(i,5)
rmj=p(j,5)
eiej2=dot(pij,pij)
c230520 invariant mass
c insert! energy cut
if(eiej2.lt.0.) then
c240503
kji=1 ! stop 2222
return
c240503
endif
do n1=1,4
px(n1)=v(i,n1)
py(n1)=v(j,n1)
pxc(n1)=px(n1)
pyc(n1)=py(n1)
enddo
ilo=0
kf1=k(i,2)
kf2=k(j,2)
c160110
ikf1=iabs(kf1)
ikf2=iabs(kf2)
if((ikf1.le.6.or.ikf1.eq.21).and.(ikf2.le.6.or.ikf2.eq.21))then
c d,u,s,c,b quarks, their anti quarks, and gluon only
c calculate the total cross section and decide the type of reaction
c (when ilo=0) or sample the t value as well (when ilo=1)
call fsig(ilo,kf1,kf2,kf3,kf4,eiej2,sig,tsmp,lmn,jjj)! 230520
else
sig=0.
endif
c160110
if(sig.le.0.)return ! 120603 250803
if(ilo.eq.-2)then ! 111999
return ! added by Sa on 24/06/96
endif ! 111999
rsig1=dsqrt(sig/pio)
call lorntz(0,b,pic,pjc)
call lorntz(0,b,pxc,pyc)
rb=0.
bb=0.
rr=0.
rtai=0.
do k1=1,3 ! 051122
vi(k1)=pic(k1)/pic(4)
vj(k1)=pjc(k1)/pjc(4)
enddo
do k1=1,3
dr(k1)=pxc(k1)-pyc(k1)-(vi(k1)*pxc(4)-vj(k1)*pyc(4))
db(k1)=vi(k1)-vj(k1)
rb=rb+dr(k1)*db(k1)
bb=db(k1)**2+bb
rr=rr+dr(k1)*dr(k1)
enddo
if(bb.le.1.e-10)then
return
endif ! sa
tcol=0.-rb/bb
do ik=1,3
dr(ik)=dr(ik)+tcol*db(ik)
rtai=rtai+dr(ik)*dr(ik)
enddo
sg=rtai
dmin=dsqrt(sg)
if(dmin.lt.dminf)then
dminf=dmin
iff=i
jf=j
endif
if(dmin.gt.rsig1)then
return
endif
do ik=1,3
pxc(ik)=pxc(ik)+vi(ik)*(tcol-pxc(4))
pyc(ik)=pyc(ik)+vj(ik)*(tcol-pyc(4))
enddo
c move along Newton trajectory in CMS
pxc(4)=tcol
pyc(4)=tcol
call lorntz(1,b,pxc,pyc)
c transform back to Lab.
c241104
if(pxc(4).le.10000.and.pyc(4).le.10000.)goto 100
return
c241104
100 lc(1,icp)=i
lc(2,icp)=j
tc(1,icp)=pxc(4)
tc(2,icp)=pyc(4)
return
end
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine tcolij_par(i,j,time,icp)
c calculate the collision time of i and j
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (KSZJ=80000,MCLIS=280000) ! 051122
COMMON/PYJETS/N,NPAD,K(KSZJ,5),P(KSZJ,5),V(KSZJ,5) ! 051122
common/sa8_p/taup(kszj),coor(3),ishp(kszj) ! 300623 Lei
common/syspar_p/rsig1,pio,tcut
common/collist/lc(2,mclis),tc(2,mclis),icol
common/scatt/pi(4),pj(4),ic,jc,n0
dimension px(4),py(4),dx(4),pij(4),pic(4),pjc(4),
c pxc(4),pyc(4)
dimension dr(3),db(3),vi(3),vj(3),rfi(4),rfj(4)
double precision b(3)
c300623 dimension taup(kszj) ! 051122 ! 300623 Lei
c051122
c300623 taup=0. ! 300623 Lei
c051122
pi(4)=p(i,4)
pj(4)=p(j,4)
if(pi(4).lt.1.e-10)pi(4)=1.e-10 ! 031204
if(pj(4).lt.1.e-10)pj(4)=1.e-10 ! 031204
pij(4)=pi(4)+pj(4)
pic(4)=pi(4)
pjc(4)=pj(4)
do k1=1,3
pi(k1)=p(i,k1)
pj(k1)=p(j,k1)
pij(k1)=pi(k1)+pj(k1)
pic(k1)=pi(k1)
pjc(k1)=pj(k1)
b(k1)=(pi(k1)+pj(k1))/(pi(4)+pj(4))
enddo
rmi=p(i,5)
rmj=p(j,5)
eiej2=dot(pij,pij)
c230520 squared invariant mass
c insert! energy cut
if(eiej2.lt.0.) then
c072200 stop 1111
return ! 072200
endif
c081000 ecut=dsqrt(eiej2)-rmi-rmj
c081000 ecut0=0.02 ! P.Yang
c081000 if(ecut.le.ecut0) return
c Note! energy cut can be taken into account HERE to decide coll. pairs
c etc. According to Y. Pang's opinions, May,1994, CCAST.(05/24/95)
do n1=1,4
px(n1)=v(i,n1)
py(n1)=v(j,n1)
pxc(n1)=px(n1)
pyc(n1)=py(n1)
enddo
ilo=0
kf1=k(i,2)
kf2=k(j,2)
c160110
ikf1=iabs(kf1)
ikf2=iabs(kf2)
if((ikf1.le.6.or.ikf1.eq.21).and.(ikf2.le.6.or.ikf2.eq.21))then
c d,u,s,c,b quarks, their anti quarks, and gluon only
call fsig(ilo,kf1,kf2,kf3,kf4,eiej2,sig,tsmp,lmn,jjj) ! 230520
else
sig=0.
endif
c160110
cc if(il.eq.2)return ! put 'cc' by Sa on 24/06/96
if(ilo.eq.-2)return ! added by Sa on 24/06/96
if(sig.le.0.)return ! 120603 250803
rsig1=dsqrt(sig/pio)
do i1=1,3
rfi(i1)=px(i1)+(taup(i)-time)*pi(i1)/pi(4)
rfj(i1)=py(i1)+(taup(j)-time)*pj(i1)/pj(4)
enddo
rfi(4)=taup(i)
rfj(4)=taup(j)
c spatial coordinates of colliding particles at formation
c moment in Lab. frame
call lorntz(0,b,rfi,rfj)
ctaui=rfi(4)
ctauj=rfj(4)
tcol=ctaui
if(ctaui.lt.ctauj)tcol=ctauj
c for back to back collision the collision time is equal to
c the lager one of their formation times
call lorntz(0,b,pic,pjc)
call lorntz(0,b,pxc,pyc)
rb=0.
bb=0.
rr=0.
rtai=0.
kflag=0
do ik=1,3
vi(ik)=pic(ik)/pic(4)
vj(ik)=pjc(ik)/pjc(4)
enddo
do ik=1,3
db(ik)=vi(ik)-vj(ik)
dr(ik)=pxc(ik)-pyc(ik)-(vi(ik)*pxc(4)-vj(ik)*pyc(4))+db(ik)*tcol
rtai=rtai+dr(ik)*dr(ik)
enddo
dott=0.
do ik=1,3
dott=dr(ik)*pic(ik)+dott
enddo
if(dott.ge.0.)then
kflag=1
if(tcol.le.pxc(4))return
if(tcol.le.pyc(4))return
c for the back to back collisions (collision happens in future)
else
rtai=0.
do ik=1,3
dr(ik)=pxc(ik)-pyc(ik)-(vi(ik)*pxc(4)-vj(ik)*pyc(4))
rb=rb+dr(ik)*db(ik)
bb=bb+db(ik)*db(ik)
rr=rr+dr(ik)*dr(ik)
enddo
if(bb .le. 1.e-10)return
tcol=0.-rb/bb
if(tcol.le.pxc(4))return
if(tcol.le.pyc(4))return
c020603 collision happens in future
if(tcol-ctaui .le. 0.)return
if(tcol-ctauj .le. 0.)return
c collision must be after formation
do ik=1,3
dr(ik)=dr(ik)+db(ik)*tcol
rtai=rtai+dr(ik)*dr(ik)
enddo
c for the face to face collisions
endif
sg=rtai
dmin=dsqrt(sg)
if(dmin.gt.rsig1) return
do ik=1,3
pxc(ik)=pxc(ik)+vi(ik)*(tcol-pxc(4))
pyc(ik)=pyc(ik)+vj(ik)*(tcol-pyc(4))
enddo
c move along Newton trajectory in CMS
pxc(4)=tcol
pyc(4)=tcol
call lorntz(1,b,pxc,pyc)
c transform back to Lab.
tcol1=pxc(4)
tcol2=pyc(4)
if(kflag.eq.0)then
if(tcol1-taup(i).lt.0.)return
if(tcol2-taup(j).lt.0.)return
else
if(tcol1-taup(i).lt.-1.E-4)return
if(tcol2-taup(j).lt.-1.E-4)return
endif
if(tcol1.le.time)return
if(tcol2.le.time)return
c collision happens in the future
c241104
if(tcol1.le.10000..and.tcol2.le.10000.)goto 100
return
c241104
100 tc(1,icp)=tcol1
tc(2,icp)=tcol2
lc(1,icp)=i
lc(2,icp)=j
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
function dot(v1,v2)
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
dimension v1(4),v2(4)
dot=v1(4)*v2(4)-v1(1)*v2(1)-v1(2)*v2(2)-v1(3)*v2(3)
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine ppes(pei,il,ih,peo)
c sum of momentum and energy
c pei: two dimension array for input momentum and energy
c il and ih: lower and higher limits of sum
c peo: one dimension array of output momentum,energy & sqrt(s)
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
PARAMETER (MPLIS=80000) ! 030223 Yong & She
dimension pei(mplis,5),peo(5)
do i=1,5
peo(i)=0.
enddo
do i=il,ih
do j=1,4
peo(j)=peo(j)+pei(i,j)
enddo
enddo
peo(5)=peo(4)*peo(4)
do i=1,3
peo(5)=peo(5)-peo(i)*peo(i)
enddo
peo5=peo(5)
if(peo5.lt.0.)then
c write(9,*)'peo(5)=',peo(5) ! w
peo5=dabs(peo5)
endif
peo(5)=dsqrt(peo5)
write(9,*)'sum= px py pz e sqrt(s)' ! sa
write(9,100)(peo(i),i=1,5) ! sa
100 format(4x,5(1x,f11.3))
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
function ichge(kf)
c calculate the charge (in unit of 1/3) of parton ! 180520
c kf: parton flaver
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
INTEGER PYK,PYCHGE,PYCOMP
ichge=0 ! 280224 Lei
if(kf.eq.21 .or. kf.eq.-21)then ! 180520
ichge=0 ! gluon charge
elseif(kf.gt.0)then
if(kf.eq.1)ichge=-1 ! d
if(kf.eq.2)ichge=2 ! u
if(kf.eq.3)ichge=-1 ! s
if(kf.eq.4)ichge=2 ! c
if(kf.eq.5)ichge=-1 ! b
if(kf.eq.6)ichge=2 ! t
elseif(kf.lt.0)then
if(kf.eq.-1)ichge=1 ! dbar
if(kf.eq.-2)ichge=-2 ! ubar
if(kf.eq.-3)ichge=1 ! sbar
if(kf.eq.-4)ichge=-2 ! cbar
if(kf.eq.-5)ichge=1 ! bbar
if(kf.eq.-6)ichge=-2 ! tbar
else
write(*,*) "Non-parton in ichge of parcas.f, STOP!" ! 280224 Lei
stop ! 280224 Lei
endif
return
end
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine fsig(ilo,kf1,kf2,kf3,kf4,eiej2,sig,tsmp,lmn,jjj)!230520
c calculate the total cross section and decide the type of reaction
c (when ilo=0) or sample the t value as well (when ilo=1)