-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParini_40.f90
More file actions
6992 lines (6234 loc) · 256 KB
/
Parini_40.f90
File metadata and controls
6992 lines (6234 loc) · 256 KB
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
!! Parini_40.f90 is a part of the PACIAE event generator.
!! Copyright (C) 2025 PACIAE Group.
!! PACIAE is licensed under the GNU GPL v2 or later, see LICENSE for details.
!! Open source: https://github.com/ArcsaberHep/PACIAE4
!! Author: Ben-Hao Sa, December 2003 - February 2025.
!> This is the initialization program to generate the initial partonic state
!! for C-framework or the intermediate hadronic state for A- and B-framework.
!! By Ben-Hao at CIAE on 04/12/2003
!! Last updated by An-Ke at UiO on 04/02/2025
subroutine parini( time_ini, ijk )
!! Generates the initial partonic state in the relativistic
!! NA, AN, AA, lN, & lA collision based on 'PYTHIA' for C-framework
!! (i_mode=3/6). Generates the intermediate hadronic state before the
!! hadronic rescattering for A-, B- and D-frameworks (i_mode=1, 2/5, 4,
!! respectively).
!
! It was composed by Ben-Hao Sa on 04/12/2003.
! Its input messages are in 'PYJETS'.
! Its intermediate working arrays are in 'sa2'.
! 'saf' is consistent with 'sa2'.
! 'saf' to 'PYJETS' after calling 'scat'.
! Its output messages are in 'PYJETS' (partons) and 'sbh' (hadrons)
! for the case of mstptj=0 (C- and D-framework), but is in 'sbh' for
! mstptj=1 (A- and B-frameworks).
!
! The hh, ll & lh collisions would be executed in "main.f90" directly.
! However, some historical statements has been reserved here, which give
! the possibility to perform all kinds of collisions (NN, NA, AN, ll, lN,
! and lA).
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
PARAMETER (KSZJ=80000)
PARAMETER (NSIZE=750000)
COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
COMMON/PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
COMMON/PYJETS/N,NPAD,K(KSZJ,5),P(KSZJ,5),V(KSZJ,5)
! Those variables in above common blocks are defined in "JETSET".
COMMON/PYSUBS/MSEL,MSUB(500),KFIN(2,-40:40),NON,CKIN(200)
COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
! Those variables in above common block are defined in "PYTHIA".
COMMON/PYCIDAT2/KFMAXT,NONCI2,PARAM(100)
common/sa1/kjp21,non1,bp,iii,neve,nout,nosc
common/sa2/nsa,non2,ksa(kszj,5),psa(kszj,5),vsa(kszj,5)
common/sa4/tau(kszj),tlco(kszj,4)
common/sa5/kfmax,kfaco(100),numb(100),numbs(100)
common/sa6/kfmaxi,nwhole
common/sa10/csnn,cspin,cskn,cspipi,cspsn,cspsm,rcsit,ifram, &
iabsb,iabsm,i_sigma_AQM,ajpsi,csspn,csspm,csen
common/sa14/ipyth(2000),idec(2000),iwide(2000)
common/sa21/pincl(5),pscal(5),pinch(5),vnu,fq2,w2l,yyl,zl,xb, &
pph,vnlep
common/sa24/adj1(40),nnstop,non24,zstop
common/sa26/ndiq(kszj),npt(kszj),ifcom(kszj),idi,idio
common/sa27/itime,kjp22,gtime,astr,akapa(6),parj1,parj2,parj3, &
parj21,parj4,adiv,gpmax,nnc
common/sa30/vneump,vneumt,mstptj
common/sbe/nbe,nonbe,kbe(kszj,5),pbe(kszj,5),vbe(kszj,5)
common/saf/naf,nonaf,kaf(kszj,5),paf(kszj,5),vaf(kszj,5)
common/sbh/nbh,nonbh,kbh(kszj,5),pbh(kszj,5),vbh(kszj,5)
common/sgam/ngam,nongam,kgam(kszj,5),pgam(kszj,5),vgam(kszj,5)
common/wz/c17(500,3),ishp(kszj),tp(500),coor(3),p17(500,4)
common/count/isinel(2000)
common/papr/t0,cspipiKK,dep,ddt,edipi,epin,ecsnn,ekn,ecspsn,ecspsm, &
rnt,rnp,rao,rou0,vneu,vneum,ecsspn,ecsspm,ecsen
common/syspar/ipden,itden,suppm,suptm,suppc,suptc,r0p,r0t, &
nap,nat,nzp,nzt,pio
common/ctllist/nctl,noinel(2000),nctl0,nctlm
common/ctllist_t/ lc(nsize,6), tc(nsize), tw(nsize)
common/sa12/ppsa(5),nchan,nsjp,sjp,taup,taujp
common/sa15/nps,npsi,pps(5000,5),ppsi(5000,5)
common/sa23/kpar,knn,kpp,knp,kep,NON_p,skpar,sknn,skpp,sknp,skep
common/schuds/schun,schudn,schudsn,sfra
! For the gamma related statistics.
common/anly_gamma1/ egam, egam1, egam2, egam3, &
segam, segam1, segam2, segam3
! For the parini related statistics.
common/anly_parini1/ woun, swoun, snpctl0, snpctlm, snpar
! For the simulation control.
COMMON/SA1_PY8/ i_mode, i_tune, KF_woDecay(100), &
KF_proj, KF_targ, win, energy_B, psno, b_min, b_max
double precision bst(4),bzp,bzt
! iii : number of current event
! csen: e+p total x section in fm^2
! neve : total number of events
! bp : impact parameter
! 'sbe': store initial parton confiquration (with diquark)
! 'saf': store parton configuration after parton rescattering
! (w/o diquark)
! c17(i,1-3) : three position of i-th nucleon
! tp(i) : time of i-th nucleon counted since collision of two nuclei
! p17(i,1-4) : four momentum of i-th nucleon
! ishp(i)=1 if i-th particle inside the simulated volume
! =0 if i-th particle outside the simulated volume
! tau(i): formation time of particle i.
! ecsen: largest collision distance between lepton and p
! note: incident lepton collides with nucleon in nucleus once
! only, because of very low total x-section. that collision is the one
! with lowest minimum approaching distance.
! cspipiKK (fm^2): cross section of pion + pion to kaon + kaon
! edipi: largest interaction distance between two pions.
! epin: largest interaction distance between pion and nucleon.
! ekn: largest interaction distance between kaon and nucleon.
! ecsnn: largest interaction distance between two nucleons.
! t0 : average proper formation time at rest.
! dep : the accuracy in four momentum conservation
! ddt : time accuracy used in parton initiation
! time accuracy used in parton cascade is dddt
! rou0 : normal nucleon density.
! rao : enlarged factor for the radius of simulated volume.
! nap and nzp (nat and nzt) are the mass and charge numbers of
! projectile (target) nucleus
! r0p=rnp : the standard radius of projectile
! r0t=rnt : the standard radius of target
! nctl: number of collision pairs in current collision list
! nctl0: number of collision pairs in initial collision list
! nctlm: maxmimum number of collision pairs
! noinel(1): statistics of nn elas. colli.;
! noinel(592): statistics of nn colli. calling PYTHIA
! noinel(593): statistics of nn colli. not calling PYTHIA
! suppm: the upper bound in sampling the radius of projectile nucleon
! suptm: the upper bound in sampling the radius of target nucleon
! suppc: the maximum radius in sample for projectile
! suptc: the maximum radius in sample for target
! coor: CM position of collision system
! kfmax: the maximum # of particle KF code considered
! kfaco(i): KF code of i-th particle
! numb(i): order number of last particle among particles with same flavor
! code of kfaco(i) in particle list
!-------------------------------------------------------------------------------
!----------------------- Local Variable Initializing -----------------------
! Counters of sub-collisions pairs (zero-pT, nn, pp, np/pn and lp/ln).
kpar = 0
knn = 0
kpp = 0
knp = 0
kep = 0
! To avoide infinite loop in parini.
ijk = 0
tp = 0D0
N = 0
nbe = 0
naf = 0
nsa = 0
nbh = 0
idi = 0
idio = 0
ndiq = 0
npt = 0
ifcom = 0
nstr0 = 0
nstr1 = 0
nctl = 0
!----------------------- Local Variable Initializing -----------------------
!-------------------------------------------------------------------------------
! Initiates the pp (pA,Ap,AA,lp & lA) collision system.
! Creats the initial particle (nucleon) list.
call initialize_position
call initialize_momentum( win, energy_B )
! Calculates the velocity of the CM of collision system in LAB or
! in nucleon-nucleon CM system.
bst(1) = p17(1,1)*nap + p17(nap+1,1)*nat
bst(2) = p17(1,2)*nap + p17(nap+1,2)*nat
bst(3) = p17(1,3)*nap + p17(nap+1,3)*nat
bst(4) = p17(1,4)*nap + p17(nap+1,4)*nat
bst(1) = -bst(1)/bst(4)
bst(2) = -bst(2)/bst(4)
bst(3) = -bst(3)/bst(4)
!-------------------------------------------------------------------------------
!----------------------- Particle Properties Giving ------------------------
! '1 -> |nzp|' are projectile protons or lepton, '|nzp|+1 -> nap'
! are projectile neutrons; 'nap+1 -> nap+nzt' are targer protons,
! the rest are target nuctrons in 'PYJETS' after nuclear initiation above
napt = nap + nat
n = napt
do i=1,N,1
K(i,1) = 1
K(i,2) = 2112
P(i,5) = PYMASS( 2212 )
! For NN, NA(AN) and AB.
if( (i <= abs(nzp) .and. ipden < 2) &
.OR. (i > nap .and. i <= nap+nzt) )then
K(i,2) = 2212
P(i,5) = PYMASS( 2212 )
! For l+N & lbar + N
else if( i <= nap .AND. (ipden >= 11 .AND. ipden <= 16 &
.AND. ABS(nzp) == 1) )then
K(i,2) = SIGN( ipden, -nzp )
P(i,5) = PYMASS( ipden )
end if
do j=1,3,1
p(i,j) = p17(i,j)
v(i,j) = c17(i,j)
end do
p(i,4) = p17(i,4)
v(i,4) = tp(i)
end do
! v, vbh and vsa arrays are the position four vector
! note: for v etc., we do not take care of their fifth component now.
! for array k, we take care of only first three components now.
!----------------------- Particle Properties Giving ------------------------
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
!--------------------- CMS Boost & Lorentz Contraction ---------------------
! boost PYJETS into cms of initial nucleus-nucleus collision system
! from lab or initial nucleon-nucleon cms system.
! call pyrobo( 1, n, 0D0, 0D0, bst(1), bst(2), bst(3) )
! Lorentz contraction
bzp3 = 0D0
bzp4 = 0D0
bzt3 = 0D0
bzt4 = 0D0
do i=1,nap,1
bzp3 = bzp3 + p(i,3)
bzp4 = bzp4 + p(i,4)
end do
do i = nap+1, napt, 1
bzt3 = bzt3 + p(i,3)
bzt4 = bzt4 + p(i,4)
end do
bzp = bzp3 / bzp4
bzt = bzt3 / bzt4
gamp = 1.d0 / dsqrt( dmax1(1.d-20, (1.0d0 - bzp*bzp) ) )
! no Lorentz contraction for incident lepton
if(ipden >= 2) gamp = 1.
gamt = 1.d0 / dsqrt( dmax1(1.d-20, (1.0d0 - bzt*bzt) ) )
! try no lorentz contract for target
! gamt = 1.
do i=1,nap
c17(i,3) = c17(i,3) / gamp
v(i,3) = v(i,3) / gamp
enddo
do i = nap+1, napt
c17(i,3) = c17(i,3) / gamt
v(i,3) = v(i,3) / gamt
enddo
! Positions two particles at ( b/2, 0, -20 ) and ( -b/2, 0, 20 ).
! 20 fm is just a large enough distance in the z-direction.
do i=1,nap,1
V(i,3) = V(i,3) - 20D0
end do
do i = nap+1, napt, 1
V(i,3) = V(i,3) + 20D0
end do
!--------------------- CMS Boost & Lorentz Contraction ---------------------
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
!---------------------- Particle Filtering & Ordering ----------------------
! filter out those kind of particles wanted to study and make
! the order of proton, neutron, ... (cf. 'filt')
call filt
! since lepton was moved to last position after calling filt, one has to
! remove it to the fist position
if(ipden >= 2) call ltof(n)
! 'PYJETS' to 'sa2'
nsa = n
do j=1,5
do i=1,n
ksa(i,j) = k(i,j)
psa(i,j) = p(i,j)
vsa(i,j) = v(i,j)
enddo
enddo
do i=1,n
ishp(i) = 1
tau(i) = 0D0
enddo
numb = numbs
!---------------------- Particle Filtering & Ordering ----------------------
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
! note: particle list is composed of the arrays in common block
! 'sa2', the array 'ishp' in common block 'wz', the array 'tau' in
! common block 'sa4', and the array 'numb' in common block 'sa5'
time = time_ini
! full_events_history of OSC1999A
call oscar(0)
! calculate the position for the center of mass of the
! non-freeze-out system. The distance of a particle, when checking
! is it freezing out or not, is measured with respect to this center
call copl(time)
! creat the initial collision list, note: be sure that the initial
! collision list must not be empty
call ctlcre
! Resamples a 'b' and positions now.
if( nctl <= 0 )then
iii = iii - 1
ijk = 1
return
end if
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
!------------------------ System Time Initializing -------------------------
! time origin is set at the time of first NN/lN collision (1D-5 fm/c)
! find out colli. pair with least colli. time
call find(icp,tcp,0)
if(icp == 0) stop 'initial collision list is empty'
time = tcp
! perform classical Newton motion in Lab. system for all particles, i.e.
! bring the two nuclei (or the nucleon/leton and a nucleus) into contact.
call his(time,istop)
do ij=1,nsa
vsa(ij,4) = 1D-5
enddo
! move origin of time to collision time of first nucleon-nucleon collision
do ij=1,nctl
tc(ij) = tc(ij) - time + 1D-5
enddo
time = time_ini
call copl(time)
!------------------------ System Time Initializing -------------------------
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
!------------------------- Collision Implementing --------------------------
! loop over implementing NN (hh), ll & lN collision, updating hadron list,
! and updating collision time list untill it is empty.
! It is equivalent to implementing a nucleus-nucleus collision.
call scat(time,ijk,ipau)
if(ijk == 1) return
time_ini = time ! 081010
! 'saf' to 'PYJETS'
if(mstptj == 0) call tran_saf
naf = 0
! 'sa2' to 'sbh'
! 'sbh' stores spectators, hadrons & leptons from the diffractive & the
! special sub-processes, e.g. NRQCD onia, or hadron beam remnants, or
! B-framework.
nbh = 0
if(nsa > 0)then
nbh = nsa
do i2=1,5
do i1=1,nsa
kbh(i1,i2) = ksa(i1,i2)
pbh(i1,i2) = psa(i1,i2)
vbh(i1,i2) = vsa(i1,i2)
enddo
enddo
nsa = 0
endif
! boost PYJETS back to lab or nucleon-nucleon cms system.
! P(N,5) = SQRT( MAX( -P(N,1)**2 -P(N,2)**2 -P(N,3)**2 +P(N,4)**2, 0D0 ) )
! P(N-1,5) = SQRT( MAX( - P(N-1,1)**2 - P(N-1,2)**2 - P(N-1,3)**2 &
! + P(N-1,4)**2,0.0))
! call PYBORO( 1, N, 0D0, 0D0, -bst(1), -bst(2), -bst(3) )
!----------------------- A, B & D-framework Treating -----------------------
if( mstptj == 1 )then
! PYTHIA like simulation for NA (AN) & AB, and low energy simulation.
! 'sbh' to 'PYJETS'
n=nbh
if(n >= 1)then
do i2=1,5
do i1=1,n
k(i1,i2) = kbh(i1,i2)
p(i1,i2) = pbh(i1,i2)
v(i1,i2) = vbh(i1,i2)
enddo
enddo
endif
endif
! Removes photons from "PYJETS" to "sgam".
if( i_mode == 1 ) call remo_gam(22)
! Appends "sbh" to "PYJETS".
if( i_mode == 4 )then
do l=1,nbh,1
l1 = N + l
do m=1,5,1
K(l1,m) = kbh(l,m)
P(l1,m) = pbh(l,m)
V(l1,m) = vbh(l,m)
enddo
enddo
N = N + nbh
end if
!----------------------- A, B & D-framework Treating -----------------------
!------------------------- Collision Implementing --------------------------
!-------------------------------------------------------------------------------
! egam1: energy of gamma after partonic initiation
if( mstptj == 0 .AND. i_mode /= 4 )then
call prt_sgam(ngam,egam1,1)
end if
! egam3: gamma energy after hadronization
if( (mstptj == 1 .AND. i_mode /= 1) .OR. i_mode == 4 )then
call prt_sgam(ngam,egam3,3)
end if
!-------------------------------------------------------------------------------
!------------------------ Wounded Nucleons Counting ------------------------
if( i_mode /= 8 .AND. i_mode /= 9 )then
! woun: # of wounded nucleons
! unwoun: # of unwounded nucleons
unwoun = 0D0
do i=1,nbh,1
KF = kbh(i,2)
if( KF == 2212 .OR. KF == 2112 )then
pT2_N = pbh(i,1)**2 + pbh(i,2)**2
if( pT2_N <= 1D-12 ) unwoun = unwoun + 1D0
end if
end do
woun = (nap + nat)*1D0 - unwoun
end if
if( mstptj == 1 .OR. i_mode == 4 ) nbh = 0
!------------------------ Wounded Nucleons Counting ------------------------
!-------------------------------------------------------------------------------
return
end
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine sysini(win)
!! Gives the initial values to quantities needed in calculation.
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
COMMON/PYCIDAT1/KFACOT(100),ISINELT(2000)
common/sa5/kfmax,kfaco(100),numb(100),numbs(100)
common/count/isinel(2000)
COMMON/PYCIDAT2/KFMAXT,NONCI2,PARAM(100)
common/sa6/kfmaxi,nwhole
common/papr/t0,cspipiKK,dep,ddt,edipi,epin,ecsnn,ekn,ecspsn,ecspsm, &
rnt,rnp,rao,rou0,vneu,vneum,ecsspn,ecsspm,ecsen
common/syspar/ipden,itden,suppm,suptm,suppc,suptc,r0p,r0t, &
nap,nat,nzp,nzt,pio
common/sa10/csnn,cspin,cskn,cspipi,cspsn,cspsm,rcsit,ifram, &
iabsb,iabsm,i_sigma_AQM,ajpsi,csspn,csspm,csen
common/sa25/i_inel_proc,i_time_shower,i_diquark,ipad25,para1_1,para1_2
! For cross sections of hh collisions etc.
common/para_h1/ para(100)
anat = nat
anap = nap
! rou0 = PARAM(11)
! considering the nucleus as a sphere with radii rnt for target
! and rnp for projectile.
! rnt = ( 3D0*anat / ( 4D0 * pio * rou0 ) )**(0.33333)
! rnp = ( 3D0*anap / ( 4D0 * pio * rou0 ) )**(0.33333)
! 1.05 to 1.12
rp00 = 1.12D0
rt00 = 1.12D0
! rp00 = 1.122D0 (nat=208)
! rt00 = 1.12D0 (nat=197)
! if(nap > 16) rp00 = 1.16D0 * ( 1D0 - 1.16D0 * anap**(-0.666666) )
! if(nat > 16) rt00 = 1.16D0 * ( 1D0 - 1.16D0 * anat**(-0.666666) )
! Uses PDG RPP2024 charge radius of proton 0.8409 +- 0.0004 fm.
! (PDG RPP2024 magnetic radius of neutron 0.864 +0.009 -0.008 fm)
! if(itden == 0) rnt = rt00 * anat**(0.33333)
if(itden == 0) rnt = 0.841D0
! +0.54
if(itden == 1) rnt = rt00 * anat**(0.33333)
! 2.60 2.095 1.54, deuteron
if(nat == 2 .and. nzt == 1) rnt = 4.0D0
! lepton
if(ipden >= 2) rnt = 0.5D0
! if(ipden == 0) rnp = rp00*anap**(0.33333)
if(ipden == 0) rnp = 0.841D0
! +0.54
if(ipden == 1) rnp = rp00*anap**(0.33333)
! lepton
if(ipden >= 2) rnp = 0.5D0
! 2.60 2.095 1.54
if(nap == 2 .and. nzp == 1) rnp = 4.0D0
rou0 = 3D0 / 4D0 / pio * anat / rnt**3
r0p = rnp
r0t = rnt
! Sets initial values to some quantities.
! In the program the x-sections are given in a unit of fm^2.
PARAM(1) = para1_1
PARAM(5) = para(5)
csnn = PARAM(1)*0.1D0
cspin = PARAM(2)*0.1D0
cskn = PARAM(3)*0.1D0
cspipi = PARAM(4)*0.1D0
cspipiKK = PARAM(5)*0.1D0
cspsn = PARAM(13)*0.1D0
cspsm = PARAM(14)*0.1D0
csspn = PARAM(15)*0.1D0
csspm = PARAM(16)*0.1D0
iabsb = 1
iabsm = 1
! PARAM(1) : total cross-section of nucleon + nucleon (in mb)
! PARAM(5) : cross-section of pi + pi -> K + K (in mb)
! csnn : total cross section of nucleon + nucleon
! 1 mb = 0.1 fm^2
! cspin : total cross section of pion + nucleon
! cskn : total cross section of Kaon + nucleon
! cspipi: total cross section of pion + pion
! cspsn : total cross section of J/psi (psi') + nucleon
! cspsm : total cross section of J/psi (psi') + meson
! iabsb = 0 : without J/psi (psi') + baryon (nucleon)
! = 1 : with J/Psi (psi') + baryon (nucleon)
! iabsm = 0 : without J/psi (psi') + meson
! = 1 : with J/psi (psi') + meson
! i_sigma_AQM: = 1, uses the input total cross sections of piN, KN, pi+pi,
! Jpsi(psi')+N, Jpsi(psi')+N, Jpsi(psi')+pi/rho,
! and AQM cross sections for D+N/pi/rho in hadcas.
! Ignores the channels which are not well defined.
! : = 2, uses the input cross sections of piN, KN, ... ,
! AQM cross sections for D+N/pi/rho and the channels
! which are not well defined (treated as elastic).
! : = 3, uses AQM cross sections of piN, KN,... and D+N/pi/rho.
! Ignores the channels which are not well defined.
! : = 4, uses AQM cross sections of piN, KN, ..., D+N/pi/rho,
! and the channels which are not well defined (treated
! as elastic).
! Uses the total cross sections from AQM (additive quark model,
! arXiv:2203.11601)
if( i_sigma_AQM == 3 .OR. i_sigma_AQM == 4 )then
! sigma_NN_tot = para1_1
sigma_NN_tot = para1_2
cspin = sigma_AQM( 211, 2212, sigma_NN_tot ) * 0.1D0
cskn = sigma_AQM( 321, 2212, sigma_NN_tot ) * 0.1D0
cspipi = sigma_AQM( 211, 211, sigma_NN_tot ) * 0.1D0
cspsn = sigma_AQM( 443, 2212, sigma_NN_tot ) * 0.1D0
cspsm = sigma_AQM( 443, 221, sigma_NN_tot ) * 0.1D0
csspn = cspsn
csspm = cspsm
end if
if( ipden >= 2 )then
if(ifram == 0)then
ept=sqrt(win*win+0.938*0.938)
rots=sqrt((ept+0.938)*(ept+0.938)-win*win)
endif
if(ifram == 1) rots=win
! temporary using e^-p total x-section
call crosep(rots,csen)
! e^-p total x-section
! if(nzp < 0) call crosep(rots,csen)
! e^+p total x-section
! if(nzp >= 0) call crosepp(rots,csen)
csen = csen * 0.1D0
endif
! largest collision distance between two colliding particles.
edipi = dsqrt(cspipi / pio)
epin = dsqrt(cspin / pio)
ekn = dsqrt(cskn / pio)
ecsnn = dsqrt(csnn / pio)
ecspsn = dsqrt(cspsn / pio)
ecspsm = dsqrt(cspsm / pio)
ecsspn = dsqrt(csspn / pio)
ecsspm = dsqrt(csspm / pio)
ecsen = dsqrt(csen / pio)
anp = nap**0.3333D0
ant = nat**0.3333D0
do ia=1,2
if(ia == 1) napt = nap
if(ia == 2) napt = nat
! In parini.f90.
alpt = get_nuclear_skin_depth( napt )
if(ia == 1) alp = alpt
if(ia == 2) alt = alpt
end do
! Sets max R=10 fm (max b=20 fm) directly, i.e. bmax = 20 fm.
! suppc = rp00*anp + 2D0*alp
! suptc = rt00*ant + 2D0*alt
suppc = 10D0
suptc = 10D0
suppm = 1D0 / ( 1D0 + EXP(0D0 - r0p/alp) )
suptm = 1D0 / ( 1D0 + EXP(0D0 - r0t/alt) )
rcsit = PARAM(6)
t0 = PARAM(7)
! t0 = 0D0
! proper formation time of particle from 'PYTHIA'
dep = PARAM(9)
ddt = PARAM(8)
rao = PARAM(10)
kfmax = KFMAXT
kfaco = KFACOT
isinel = ISINELT
return
end
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine initialize_position
!! Initializes positions of particles, i.e. distributes nucleons inside
!! nuclei (and other particles).
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
PARAMETER (KSZJ=80000)
common/sa1/kjp21,non1,bp,iii,neve,nout,nosc
common/sa24/adj1(40),nnstop,non24,zstop
common/sa30/vneump,vneumt,mstptj
common/sa33/smadel,ecce,secce,parecc,iparres
common/syspar/ipden,itden,suppm,suptm,suppc,suptc,r0p,r0t, &
nap,nat,nzp,nzt,pio
common/wz/c17(500,3),ishp(kszj),tp(500),coor(3),p17(500,4)
! initialization of x, y,xy, x^2, y^2 and sump (statistics of the
! number of nucleons in overlap region, the initial geometry)
sumx = 0D0
sumy = 0D0
sumxy = 0D0
sumx2 = 0D0
sumy2 = 0D0
sump = 0D0
c17 = 0D0
!-------------------------------------------------------------------------------
!-------------------------- Position Initializing --------------------------
! in position phase space
iadj130 = INT(adj1(30))
!***************************** A+B Collisions ******************************
! A+B (nucleus-nucleus)
if( ipden == 1 .and. itden == 1 )then
! distribute projectile nucleons by Woods-Saxon
napt = nap
! In parini.f90.
alpt = get_nuclear_skin_depth( napt )
alp = alpt
r0 = r0p
! upper bound in sampling the radius of projectile nucleon
am = suppm
! maximum radius for projectile
ac = suppc
! ratio of projectile participant nucleons to total
ratps = vneump / nap
do i1=1,nap
if( iadj130 == 1 )then
rann = pyr(1)
if(rann < ratps)then
! sample position of projectile nucleon in overlap region of nuclei
call arrove(i1,1,alp,r0,am,ac)
else
! sample position of projectile nucleon according to Woods-Saxon
! distribution
call woodsax_samp(i1,1,alp,r0,am,ac,1)
! last argument here is 'iway', iway=1: particle i1 must be outside the
! overlap region of colliding nuclei, iway=0: no more requirement
endif
elseif( iadj130 == 0 )then
call woodsax_samp(i1,1,alp,r0,am,ac,0)
endif
enddo
! distribute target nucleons by Woods-Saxon
napt = nat
alpt = get_nuclear_skin_depth( napt )
alp = alpt
r0 = r0t
! upper bound in sampling the radius of target
am = suptm
! maximum radius for target
ac = suptc
! ratio of target participant nucleons to total
ratps = vneumt / nat
do i1=1,nat
i2 = i1 + nap
if( iadj130 == 1 )then
rann = pyr(1)
if(rann < ratps)then
! sample position of target nucleon in overlap region of colliding nuclei
call arrove(i2,0,alp,r0,am,ac)
else
! sample position of target nucleon according to Woods-Saxon
! distribution
call woodsax_samp(i2,0,alp,r0,am,ac,1)
endif
elseif( iadj130 == 0 )then
call woodsax_samp(i2,0,alp,r0,am,ac,0)
endif
enddo
!------------- Impact-Parameter & Initial Geometry Calculating -------------
do i=1,nap
! c17(i,1)=c17(i,1)+bp
! move x-component of origin to 0.5*bp
c17(i,1) = c17(i,1) + 0.5*bp
! Calculates eccentricity correctly for both adj1(30)=0 and 1.
x = c17(i,1)
y = c17(i,2)
z = c17(i,3)
! Relative distance between the projectile nucleon i and the
! target center (-bp/2., 0, 0)
rel_dist = SQRT( (x+bp/2.)**2 + y**2 + z**2 )
! The projectile nucleon i is inside the target, i.e. inside the
! overlap region.
if( rel_dist <= r0t )then
sumx = sumx + x
sumy = sumy + y
sumxy = sumxy + x*y
sumx2 = sumx2 + x**2
sumy2 = sumy2 + y**2
sump = sump + 1D0
end if
enddo
do i = nap+1, nap+nat
c17(i,1) = c17(i,1) - 0.5*bp
! Calculates eccentricity correctly for both adj1(30)=0 and 1.
x = c17(i,1)
y = c17(i,2)
z = c17(i,3)
! Relative distance between the target nucleon i and the
! projectile center (+bp/2., 0, 0)
rel_dist = SQRT( (x-bp/2.)**2 + y**2 + z**2 )
! The target nucleon i is inside the projectile, i.e. inside the
! overlap region.
if( rel_dist <= r0p )then
sumx = sumx + x
sumy = sumy + y
sumxy = sumxy + x*y
sumx2 = sumx2 + x**2
sumy2 = sumy2 + y**2
sump = sump + 1D0
end if
enddo
!------------- Impact-Parameter & Initial Geometry Calculating -------------
!***************************** A+B Collisions ******************************
!*************************** NA & lA Collisions ****************************
! N+A or lepton+A
elseif( (ipden == 0.or.ipden > 1) .and. itden == 1 )then
! distribute projectile proton
do i=1,3
c17(1,i) = 0D0
if(i == 1) c17(1,i) = c17(1,i) + 0.5*bp
enddo
! distribute target nucleons by Woods-Saxon
napt = nat
alpt = get_nuclear_skin_depth( napt )
alp = alpt
r0 = r0t
! upper bound in sampling the radius of target
am = suptm
! maximum radius for target
ac = suptc
do i1=1,napt
i2 = i1 + nap
call woodsax_samp(i2,0,alp,r0,am,ac,0)
enddo
do i = nap+1, nap+nat
c17(i,1) = c17(i,1) - 0.5*bp
enddo
!*************************** NA & lA Collisions ****************************
!****************************** AN Collisions ******************************
! A+N
elseif( ipden == 1 .and. itden == 0 )then
! distribute projectile nucleons by Woods-Saxon
napt = nap
alpt = get_nuclear_skin_depth( napt )
alp = alpt
r0 = r0p
! upper bound in sampling the radius of projectile nucleon
am = suppm
! maximum radius for projectile
ac = suppc
do i1=1,napt
call woodsax_samp(i1,1,alp,r0,am,ac,0)
enddo
do i=1,napt
c17(i,1) = c17(i,1) + 0.5*bp
enddo
do i=1,3
c17(nap+1,i) = 0D0
if(i == 1) c17(nap+1,i) = -0.5*bp
enddo
!****************************** AN Collisions ******************************
!*************************** NN & lN Collisions ****************************
! N+N or lepton+N
! Now NN and e+e- collisions have been processed in main.f90 directly.
elseif( (ipden == 0 .and. itden == 0) .or. &
(ipden >= 11 .and. itden == 0) )then
do i=1,3
c17(1,i) = 0D0
c17(2,i) = 0D0
enddo
endif
!*************************** NN & lN Collisions ****************************
r0pt = r0p + r0t
!********************** Initial Geometry Calculating ***********************
if(sump > 0D0)then !!!
asumx = sumx / sump
sigmx2 = sumx2/sump - asumx*asumx
asumy = sumy / sump
sigmy2 = sumy2/sump - asumy*asumy
asumxy = sumxy / sump
sigmxy = asumxy - asumx*asumy
sigmsu = sigmy2 + sigmx2
sigmde = sigmy2 - sigmx2
argu = sigmde*sigmde + 4D0*sigmxy*sigmxy
! participant eccentricity of participant nucleons
if(argu > 0. .and. sigmsu > 0.) &
ecce = sqrt(argu) / sigmsu
! calculate transverse overlap area
argu1 = sigmx2*sigmy2 - sigmxy*sigmxy
if(argu1 > 0.) secce = 3.1416*sqrt(argu1)
!--------------------- Transverse-Momentum Deformation ---------------------
! assuming ecce = geometric eccentricity of ellipsoid
! sqrt( 1-b^2/a^2 )
! with half major axis
! b = pt * ( 1 + smadel )
! and half minor axis
! a = pt * ( 1 - smadel ),
! the resulted
! smadel = -ecce*ecce/4,
! neglecting the samll term of
! ecce*ecce*( -2*smadel + smadel*smadel ).
ecc2 = ecce*ecce
! approximated deformation parameter
smadel_a = parecc*ecc2/4.
delta1 = (2. - ecc2 + 2.*(1. - ecc2)**0.5 ) / ecc2
delta2 = (2. - ecc2 - 2.*(1. - ecc2)**0.5 ) / ecc2
if(delta1 <= 1.)then
smadel = parecc*delta1 ! exact deformation parameter
elseif(delta2 <= 1.)then
smadel = parecc*delta2 ! exact deformation parameter
endif
! here a sign change is introduced because of asymmetry of initial
! spatial space is oppsed to the final momentum space
!--------------------- Transverse-Momentum Deformation ---------------------
endif !!!
!********************** Initial Geometry Calculating ***********************
! the beam direction is identified as the z axis
! the origin in position space is set on (0, 0, 0)
! and the origin of time is set at the moment of
! first nn colission assumed to be 1.e-5
!-------------------------- Position Initializing --------------------------
!-------------------------------------------------------------------------------
return
end
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
function get_nuclear_skin_depth( nA )
!! Gets the nuclear skin depth. nA: atomic mass number.
integer :: nA
real(kind=8) :: depth, get_nuclear_skin_depth
if( nA < 27 )then
depth = 0.47D0
elseif( nA >= 27 .AND. nA <= 108 )then
depth = 0.488D0
else
depth = 0.54D0
endif
if( nA == 27 )then
depth = 0.478D0
else if( nA == 28 )then
depth = 0.48D0
else if( nA == 32 )then
depth = 0.49D0
else if( nA == 56 )then
depth = 0.49D0
else if( nA == 64 )then
depth = 0.49D0
else if( nA == 108 )then
depth = 0.495D0
else if( nA == 184 )then
depth = 0.53D0
else if( nA == 197 )then
depth = 0.54D0
else if( nA == 207 )then
depth = 0.545D0
else if( nA == 238 )then
depth = 0.55D0
end if
get_nuclear_skin_depth = depth
return
end
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine arrove(ii,jj,alp,r0,am,ac)
!! Arranges randomly particle ii in overlap region of colliding nuclei
! jj=0 and 1 for target and projectile, respectively
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
PARAMETER (KSZJ=80000)
common/sa1/kjp21,non1,bp,iii,neve,nout,nosc
common/wz/c17(500,3),ishp(kszj),tp(500),coor(3),p17(500,4)
common/syspar/ipden,itden,suppm,suptm,suppc,suptc,r0p,r0t, &
nap,nat,nzp,nzt,pio
b = bp
iiii = 0
54 iiii = iiii + 1
if( iiii == 10000 )then
write(*,*) "Warning, difficult to arrange produced nucleons in" &
// "subroutine arrove, infinite loop may occur"
return
end if
! ii in target (-b/2.)
if(jj == 0)then
! sample a point according to woodsax distribution
call woodsax_samp(ii,jj,alp,r0,am,ac,0)
x = c17(ii,1)
y = c17(ii,2)
z = c17(ii,3)
! relative to projectile center, they are b-x, y, and z, respectively
! adjudge does (x-b,y,z) is in the sphere of projectile
r1 = sqrt( (b-x)*(b-x) + y*y + z*z )
if(r1 > r0p) goto 54
endif
! ii in projectile (+b/2.)
if(jj == 1)then
! sample a point according to woodsax distribution
call woodsax_samp(ii,jj,alp,r0,am,ac,0)
x = c17(ii,1)
y = c17(ii,2)
z = c17(ii,3)
! relative to target center, they are x+b, y, and z, respectively
! adjudge does (x+b,y,z) is in the sphere of target
r1 = sqrt( (x+b)*(x+b) + y*y + z*z )
if(r1 > r0t) goto 54
endif
return
end
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
subroutine woodsax_samp(ii,jj,alp,r0,am,ac,iway)
!! Samples position of nucleon ii in nucleus according to
!! Woods-Saxon distribution
! jj=0 and 1 for target and projectile, respectively
! alp: diffusion length
! r0: radius of nucleus
! am: upper bound in sampling the radius
! ac: maximum radius
! iway=1: ii must be outside overlap region of colliding nuclei
! iway=0: no more requirement
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)
PARAMETER (KSZJ=80000)
common/sa1/kjp21,non1,bp,iii,neve,nout,nosc
common/wz/c17(500,3),ishp(kszj),tp(500),coor(3),p17(500,4)
common/syspar/ipden,itden,suppm,suptm,suppc,suptc,r0p,r0t, &
nap,nat,nzp,nzt,pio