-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsophia.f
3863 lines (3324 loc) · 105 KB
/
sophia.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 DJGSPH(L0,IMODE)
C***********************************************************************
C
C DJGSPH
C
C H.Spiesberger (05.07.99)
C Interface to SOPHIA: Simulation of events with low mass and low Q2
C for SOPHIA 1.5
C update 08.08.2005 for djangoh, version 1.6
C
C***********************************************************************
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
COMMON /HSPARM/ POLARI,HPOLAR,LLEPT,LQUA
COMMON /HSELAB/ SP,EELE,PELE,EPRO,PPRO
COMMON /HSIKP/ S,T,U,SS,TS,US,DKP,DKPS,DKQ,DKQS
COMMON /HSCHNN/ ICHNN
COMMON /DJPASS/ NTOT,NPASS,NFAILL
COMMON /SPPASS/ NSOPH,NSPOUT,NFAILP,NSPACC
COMMON /DJFAIL/ NFAILI(10)
PARAMETER (NMXHEP=2000)
COMMON /HEPEVT/ NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
& JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),
& PHEP(5,NMXHEP),VHKK(4,NMXHEP)
COMMON /S_PLIST/ P_S(2000,5), LLIST(2000), NP, Ideb
COMMON/LUJETS/N,K(4000,5),P(4000,5),V(4000,5)
REAL*4 P,V
COMMON /LEPTOU/ CUT(14),LST(40),PARL(30)
&,XSCH,YSCH,W2SCH,Q2SCH,USCH
REAL*4 CUT,PARL,XSCH,YSCH,W2SCH,Q2SCH,USCH
SAVE
DIMENSION P_gam(4),P_nuc(4)
LOGICAL FIRST
DATA FIRST/.TRUE./
C...Header
IF (FIRST) THEN
FIRST=.FALSE.
WRITE(6,9)
9 FORMAT(
1'**************************************************',
2'*****************************',
3//,10X,' Calling SOPHIA '
4//,10X,' Event generator for photohadronic processes in'
4,' astrophysics '
6//,10X,' VERSION 1.5, '/
7//,10X,' by A.M"ucke, Ralph Engel, J.P.Rachen, '
8//,10X,' R.J.Protheroe, and Todor Stanev'
9//,10X,' Comput.Phys.Commun. 124 (2000) 290-314',//
9' **************************************************',
1'****************************',//)
CALL INITIAL(13)
ENDIF
C...Event accepted by HERACLES
NTOT=NTOT+1
C...reset counters for failed trials
DO 1 INF=1,10
1 NFAILI(INF)=0
NSPACC=0
C...Determine momentum of virtual incoming photon
IF (ICHNN.LE.2) THEN
C...non-radiative channels
P_gam(1)= -PHEP(1,1)
P_gam(2)= -PHEP(2,1)
P_gam(3)=PELE-PHEP(3,1)
P_gam(4)=EELE-PHEP(4,1)
Q2=-T
ELSE
C...radiative channels
P_gam(1)= -PHEP(1,1)-PHEP(1,3)
P_gam(2)= -PHEP(2,1)-PHEP(2,3)
P_gam(3)=PELE-PHEP(3,1)-PHEP(3,3)
P_gam(4)=EELE-PHEP(4,1)-PHEP(4,3)
Q2=-TS
ENDIF
C...Determine momentum of incoming nucleon
P_nuc(1)=0D0
P_nuc(2)=0D0
P_nuc(3)=-PPRO
P_nuc(4)=EPRO
N=0
C...Generate hadronic final state
LST(21)=99
CALL SOPHIA(L0,P_gam,P_nuc,Imode)
c call print_event(1)
C...Event passed fragmentation
IF (NP.NE.0) THEN
LST(21)=0
LST(36)=2
NSOPH=NSOPH+1
NSPACC=1
ENDIF
IF (NP.EQ.0) NFAILP=NFAILP+1
C...Transfer event to JETSET common block
IF (LLEPT.EQ.-1) THEN
LEPIN=11
ELSEIF (LLEPT.EQ.1) THEN
LEPIN=-11
ENDIF
IP1=0
C...Set initial state, first lepton:
IP1=IP1+1
K(IP1,1)=201
K(IP1,2)=LEPIN
K(IP1,3)=0
K(IP1,4)=0
K(IP1,5)=0
P(IP1,1)=0.
P(IP1,2)=0.
P(IP1,3)=PELE
P(IP1,4)=EELE
P(IP1,5)=ULMASS(LEPIN)
C...then nucleon = proton
IP1=IP1+1
K(IP1,1)=201
K(IP1,2)=2212
K(IP1,3)=0
K(IP1,4)=0
K(IP1,5)=0
P(IP1,1)=0.
P(IP1,2)=0.
P(IP1,3)=-PPRO
P(IP1,5)=ULMASS(K(IP1,2))
P(IP1,4)=EPRO
C...Virtual boson (non-radiative case)
IP1=IP1+1
K(IP1,1)=21
K(IP1,2)=23
K(IP1,3)=1
K(IP1,4)=0
K(IP1,5)=0
IF(ICHNN.EQ.1.OR.ICHNN.EQ.2) THEN
DO 10 JG=1,4
P(IP1,JG)=P(1,JG)-PHEP(JG,1)
10 CONTINUE
P(IP1,5)=-SQRT(Q2)
ELSE
C...Virtual boson (radiative case)
DO 11 JG=1,4
c...corrected (pointed out by VL: 14.08.05)
c P(IP1,JG)=P(1,JG)-PHEP(JG,1)-P(JG,3)
P(IP1,JG)=P(1,JG)-PHEP(JG,1)-PHEP(JG,3)
11 CONTINUE
P(IP1,5)=-SQRT(Q2)
ENDIF
C...scattered lepton
IP1=IP1+1
DO 12 J=1,5
P(IP1,J)=PHEP(J,1)
12 CONTINUE
K(IP1,1)=ISTHEP(1)
K(IP1,2)=IDHEP(1)
K(IP1,3)=1
K(IP1,4)=JDAHEP(1,1)
K(IP1,5)=JDAHEP(2,1)
C...radiative photon
IF (ICHNN.GT.2) THEN
IP1=IP1+1
DO 13 J=1,5
P(IP1,J)=PHEP(J,3)
13 CONTINUE
K(IP1,1)=ISTHEP(3)
K(IP1,2)=IDHEP(3)
K(IP1,3)=1
IF(ICHNN.EQ.6.OR.ICHNN.EQ.8.OR.ICHNN.EQ.12) THEN
K(IP1,3)=1
ELSE
K(IP1,3)=4
ENDIF
K(IP1,4)=JDAHEP(1,3)
K(IP1,5)=JDAHEP(2,3)
ENDIF
C...Hadronic final state from SOPHIA
DO 20 IP=1,NP
IF (ABS(LLIST(IP)).LT.50) THEN
IP1=IP1+1
P(IP1,1)=P_S(IP,1)
P(IP1,2)=P_S(IP,2)
P(IP1,3)=P_S(IP,3)
P(IP1,4)=P_S(IP,4)
P(IP1,5)=P_S(IP,5)
K(IP1,1)=1
K(IP1,2)=ICON_SIB_PDG(LLIST(IP))
K(IP1,3)=0
K(IP1,4)=0
K(IP1,5)=0
ENDIF
20 CONTINUE
N=IP1
RETURN
END
C***********************************************************************
SUBROUTINE DJGNOE
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
COMMON /SPPASS/ NSOPH,NSPOUT,NFAILP,NSPACC
PARAMETER (NMXHEP=2000)
COMMON /HEPEVT/ NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
& JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),
& PHEP(5,NMXHEP),VHKK(4,NMXHEP)
COMMON/LUJETS/N,K(4000,5),P(4000,5),V(4000,5)
REAL*4 P,V
COMMON /LEPTOU/ CUT(14),LST(40),PARL(30),X,Y,W2,Q2,U
REAL*4 CUT,PARL,X,Y,W2,Q2,U
SAVE
N=0
LST(21)=99
NSPOUT=NSPOUT+1
RETURN
END
C***********************************************************************
subroutine SOPHIA(L0,P_gam,P_nuc,Imode)
C***********************************************************************
C
C SOPHIA 1.5
C
C A. M\"ucke, R. Engel, J.P. Rachen, R.J. Protheroe, and T. Stanev:
C {\it SOPHIA -- Monte Carlo simulations for photohadronic processes in
C astrophysics.} BA-99-33 (astro-ph/9903478),
C submitted to Comp. Phys. Commun.
C
C***********************************************************************
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
SAVE
DIMENSION P_gam(4),P_nuc(4)
COMMON /S_RUN/ SQS, S, Q2MIN, XMIN, ZMIN, kb, kt, a1, a2, Nproc
COMMON /S_PLIST/ P(2000,5), LLIST(2000), NP, Ideb
COMMON /S_MASS1/ AM(49), AM2(49)
COMMON /S_CHP/ S_LIFE(49), ICHP(49), ISTR(49), IBAR(49)
COMMON /S_CSYDEC/ CBR(102), IDB(49), KDEC(612), LBARP(49)
CHARACTER NAMPRES*6
COMMON /RES_PROP/ AMRES(9), SIG0(9),WIDTH(9),
+ NAMPRES(0:9)
CHARACTER NAMPRESp*6
COMMON /RES_PROPp/ AMRESp(9), BGAMMAp(9),WIDTHp(9),
+ RATIOJp(9),NAMPRESp(0:9)
CHARACTER NAMPRESn*6
COMMON /RES_PROPn/ AMRESn(9), BGAMMAn(9),WIDTHn(9),
+ RATIOJn(9),NAMPRESn(0:9)
DOUBLE PRECISION P_sum(4),PC(4),GamBet(4)
c DATA pi /3.141593D0/
DATA pm /0.93827D0/
DATA IRESMAX /9/
DATA Icount / 0 /
data iphpi / 0 /
c****** INPUT **************************************************
c E0 = energy of incident proton (in lab frame) [in GeV]
c eps = energy of incident photon [in GeV] (in lab frame)
c theta = angle between incident proton and photon [in degrees]
c L0 = code number of the incident nucleon
c***************************************************************
c** calculate eps_prime = photon energy in nuclear rest frame,
c** sqrt(s) = CMF energy of the N\gamma-system
Esum = P_nuc(4)+P_gam(4)
PXsum = P_nuc(1)+P_gam(1)
PYsum = P_nuc(2)+P_gam(2)
PZsum = P_nuc(3)+P_gam(3)
IQchr = ICHP(1)+ICHP(L0)
IQbar = IBAR(1)+IBAR(L0)
C calculate Lorentz boost and rotation
P_sum(1) = P_nuc(1)+P_gam(1)
P_sum(2) = P_nuc(2)+P_gam(2)
P_sum(3) = P_nuc(3)+P_gam(3)
P_sum(4) = P_nuc(4)+P_gam(4)
s = (P_sum(4)-P_sum(3))*(P_sum(4)+P_sum(3))
& -P_sum(1)**2-P_sum(2)**2
sqsm = sqrt(s)
eps_prime = (s-pm*pm)/2.D0/pm
C Lorentz transformation into c.m. system
DO I=1,4
GamBet(I) = P_sum(I)/sqsm
ENDDO
C calculate rotation angles
IF(GamBet(4).lt.1.d5) then
C transform nucleon vector
GamBet(1) = -GamBet(1)
GamBet(2) = -GamBet(2)
GamBet(3) = -GamBet(3)
CALL PO_ALTRA(GamBet(4),GamBet(1),GamBet(2),GamBet(3),
& P_nuc(1),P_nuc(2),P_nuc(3),P_nuc(4),Ptot,
& PC(1),PC(2),PC(3),PC(4))
GamBet(1) = -GamBet(1)
GamBet(2) = -GamBet(2)
GamBet(3) = -GamBet(3)
C rotation angle: nucleon moves along +z
COD = PC(3)/Ptot
SID = SQRT(PC(1)**2+PC(2)**2)/Ptot
COF = 1.D0
SIF = 0.D0
IF(Ptot*SID.GT.1.D-5) THEN
COF=PC(1)/(SID*Ptot)
SIF=PC(2)/(SID*Ptot)
Anorf=SQRT(COF*COF+SIF*SIF)
COF=COF/Anorf
SIF=SIF/Anorf
ENDIF
else
COD = 1.D0
SID = 0.D0
COF = 1.D0
SIF = 0.D0
endif
c... check for threshold:
sth = 1.1646D0
if (s.lt.sth) then
iphpi=iphpi+1
if (iphpi.le.10) then
print*,'input energy below threshold for photopion production !'
print*,'sqrt(s) = ',sqrt(s)
print*,'only first 10 warnings printed'
endif
NP = 0
RETURN
endif
200 continue
Icount = Icount+1
Imode = 0
c*******************************************************************
c decide which process occurs: ***
c (1) decay of resonance ***
c (2) direct pion production (interaction of photon with ***
c virtual pions in nucleon cloud) and diffractive scattering ***
c (3) multipion production ***
c*******************************************************************
call dec_inter3(eps_prime,Imode,L0)
c*********************************************
c******* PARTICLE PRODUCTION *****************
c*********************************************
c 42 continue
if (Imode.le.5) then
c... direct/multipion/diffractive scattering production channel:
call GAMMA_H(sqsm,L0,Imode,Ifbad)
if(Ifbad.ne.0) then
print *,' eventgen: simulation of particle production failed'
goto 200
endif
else if (Imode.eq.6) then
c... Resonances:
c... decide which resonance decays with ID=IRES in list:
c... IRESMAX = number of considered resonances = 9 so far
IRES = 0
46 call dec_res2(eps_prime,IRES,IRESMAX,L0)
Nproc = 10+IRES
call dec_proc2(eps_prime,IPROC,IRANGE,IRES,L0)
c 2-particle decay of resonance in CM system:
NP = 2
call res_decay3(IRES,IPROC,IRANGE,s,L0,nbad)
if (nbad.eq.1) then
print *,' eventgen: event rejected by res_decay3'
goto 46
endif
call DECSIB
else
print*,'invalid Imode !!'
STOP
endif
c... consider only stable particles:
18 istable=0
do 16 i=1,NP
if (abs(LLIST(i)).lt.10000) then
istable = istable+1
LLIST(istable) = LLIST(i)
P(istable,1) = P(i,1)
P(istable,2) = P(i,2)
P(istable,3) = P(i,3)
P(istable,4) = P(i,4)
P(istable,5) = P(i,5)
endif
16 continue
if (NP.gt.istable) then
do i=istable+1,NP
LLIST(i) = 0
P(i,1) = 0.
P(i,2) = 0.
P(i,3) = 0.
P(i,4) = 0.
P(i,5) = 0.
enddo
endif
NP = istable
c***********************************************
c transformation from CM-system to lab-system: *
c***********************************************
DO I=1,NP
CALL PO_TRANS(P(I,1),P(I,2),P(I,3),COD,SID,COF,SIF,
& PC(1),PC(2),PC(3))
PC(4) = P(I,4)
CALL PO_ALTRA(GamBet(4),GamBet(1),GamBet(2),GamBet(3),
& PC(1),PC(2),PC(3),PC(4),Ptot,
& P(I,1),P(I,2),P(I,3),P(I,4))
ENDDO
call check_event(Icount,Esum,PXsum,PYsum,PZsum,IQchr,IQbar,Irej)
if(Irej.ne.0) then
print *,' eventgen: event rejected by check_event'
goto 200
endif
return
END
c*****************************
c*** List of SUBROUTINES *****
C*****************************
SUBROUTINE INITIAL(L0)
c*******************************************************************
c initialization routine
c*******************************************************************
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
SAVE
COMMON /RES_PROP/ AMRES(9),SIG0(9),WIDTH(9),
+ NAMPRES(0:9)
COMMON /RES_PROPp/ AMRESp(9), BGAMMAp(9),WIDTHp(9),
+ RATIOJp(9),NAMPRESp(0:9)
COMMON /RES_PROPn/ AMRESn(9), BGAMMAn(9),WIDTHn(9),
+ RATIOJn(9),NAMPRESn(0:9)
COMMON /S_MASS1/ AM(49), AM2(49)
CHARACTER NAMPRESp*6, NAMPRESn*6
CHARACTER NAMPRES*6
C...for interface to DJANGOH
COMMON /SPPASS/ NSOPH,NSPOUT,NFAILP,NSPACC
NSOPH=0
NSPOUT=0
NFAILP=0
* print *,'settings of resonance parameters:'
* print *,
* & 'name, nom.mass [GeV], width [GeV], sigma0 [mub], bgamma*10^3'
if (L0.eq.13) then
do i=1,9
SIG0(i) = 4.893089117D0/AM2(13)*RATIOJp(i)*BGAMMAp(i)
AMRES(i) = AMRESp(i)
WIDTH(i) = WIDTHp(i)
NAMPRES(i) = NAMPRESp(i)
* print*,NAMPRES(i), real(AMRES(i)), real(WIDTH(i)),
* & real(SIG0(i)), real(BGAMMAp(i))
enddo
endif
if (L0.eq.14) then
do i=1,9
SIG0(i) = 4.893089117D0/AM2(14)*RATIOJn(i)*BGAMMAn(i)
AMRES(i) = AMRESn(i)
WIDTH(i) = WIDTHn(i)
NAMPRES(i) = NAMPRESn(i)
* print*,NAMPRES(i), real(AMRES(i)), real(WIDTH(i)),
* & real(SIG0(i)), real(BGAMMAn(i))
enddo
endif
RETURN
END
DOUBLE PRECISION function crossection(x,NDIR,NL0)
IMPLICIT DOUBLE PRECISION (A-M,O-Z)
IMPLICIT INTEGER (N)
SAVE
CHARACTER NAMPRES*6
COMMON /RES_PROP/ AMRES(9), SIG0(9),WIDTH(9),
+ NAMPRES(0:9)
DIMENSION sig_res(9)
external breitwigner, Ef, singleback, twoback
DATA pm /0.93827D0/
DATA sth /1.1646D0/
c*****************************************************
C calculates crossection of N-gamma-interaction
C (see thesis of J.Rachen, p.45ff and corrections
C report from 27/04/98, 5/05/98, 22/05/98 of J.Rachen)
C*****************************************************
c** Date: 20/01/98 **
c** correct.:27/04/98**
c** update: 23/05/98 **
c** author: A.Muecke **
c**********************
c
c x = eps_prime in GeV
c x = eps_prime
s = pm*pm+2.D0*pm*x
if (s.lt.sth) then
c if (x.lt.0.15275) then
crossection = 0.
c print*,'BELOW P\GAMMA THRESHOLD !'
RETURN
endif
if (x.gt.10.D0) then
c only multipion production:
cross_res = 0.D0
cross_dir = 0.D0
cross_dir1 = 0.D0
cross_dir2 = 0.D0
goto 10
endif
c****************************
c RESONANCES:
c****************************
cross_res = 0.D0
cross_res = breitwigner(SIG0(1),WIDTH(1),AMRES(1),x)
& *Ef(x,0.152D0,0.17D0)
sig_res(1) = cross_res
DO N=2,9
sig_res(N) = breitwigner(SIG0(N),WIDTH(N),AMRES(N),x)
& *Ef(x,0.15D0,0.38D0)
cross_res = cross_res + sig_res(N)
ENDDO
c****************************
c DIRECT CHANNEL:
c****************************
if((x.gt.0.1D0).and.(x.lt.0.6D0)) then
cross_dir1 = singleback(x)
& + 40.D0*exp(-(x-0.29D0)**2/0.002D0)
& - 15.D0*exp(-(x-0.37D0)**2/0.002D0)
else
cross_dir1 = singleback(x)
endif
cross_dir2 = twoback(x)
cross_dir = cross_dir1 + cross_dir2
c****************************
c FRAGMENTATION 2:
c****************************
10 continue
if (NL0.eq.13) then
cross_frag2 = 80.3D0*Ef(x,0.5D0,0.1D0)*(s**(-0.34D0))
else if (NL0.eq.14) then
c cross_frag2 = 72.3*Ef(x,0.5D0,0.1D0)*(s**(-0.34))
cross_frag2 = 60.2D0*Ef(x,0.5D0,0.1D0)*(s**(-0.34D0))
endif
c****************************************************
c MULTIPION PRODUCTION/FRAGMENTATION 1 CROSS SECTION
c****************************************************
if (x.gt.0.85D0) then
ss1 = (x-.85D0)/.69D0
if (NL0.eq.13) then
ss2 = 29.3D0*(s**(-.34D0))+59.3D0*(s**.095D0)
else if (NL0.eq.14) then
ss2 = 26.4D0*(s**(-.34D0))+59.3D0*(s**.095D0)
endif
cs_multidiff = (1.-exp(-ss1))*ss2
cs_multi = 0.89D0*cs_multidiff
c****************************
c DIFFRACTIVE SCATTERING:
c****************************
ss1 = ((x-.85D0)**.75D0)/.64D0
ss2 = 74.1D0*(x**(-.44D0))+62.D0*(s**.08D0)
cs_tmp = 0.96D0*(1.D0-exp(-ss1))*ss2
cross_diffr1 = 0.14D0*cs_tmp
cross_diffr2 = 0.013D0*cs_tmp
cs_delta = cross_frag2 - (cross_diffr1+cross_diffr2-cross_diffr)
if(cs_delta.lt.0.D0) then
cross_frag2 = 0.D0
cs_multi = cs_multi+cs_delta
else
cross_frag2 = cs_delta
endif
cross_diffr = cross_diffr1 + cross_diffr2
cs_multidiff = cs_multi + cross_diffr
else
cross_diffr = 0.D0
cross_diffr1 = 0.D0
cross_diffr2 = 0.D0
cs_multidiff = 0.D0
cs_multi = 0.D0
endif
if (NDIR.eq.3) then
crossection = cross_res+cross_dir+cs_multidiff+cross_frag2
RETURN
else if (NDIR.eq.0) then
crossection = cross_res+cross_dir+cross_diffr+cross_frag2
RETURN
else if (NDIR.eq.2) then
crossection = cross_res+cross_dir
RETURN
else if (NDIR.eq.1) then
crossection = cross_res
RETURN
else if (NDIR.eq.4) then
crossection = cross_dir
RETURN
else if (NDIR.eq.5) then
crossection = cs_multi
RETURN
else if (NDIR.eq.6) then
crossection = cross_res+cross_dir2
RETURN
else if (NDIR.eq.7) then
crossection = cross_res+cross_dir1
RETURN
else if (NDIR.eq.8) then
crossection = cross_res+cross_dir+cross_diffr1
RETURN
else if (NDIR.eq.9) then
crossection = cross_res+cross_dir+cross_diffr
RETURN
else if (NDIR.eq.10) then
crossection = cross_diffr
RETURN
else if ((NDIR.ge.11).and.(NDIR.le.19)) then
crossection = sig_res(NDIR-10)
RETURN
else
print*,'wrong input NDIR in crossection.f !'
STOP
endif
END
DOUBLE PRECISION function breitwigner(sigma_0,Gamma,
& DMM,eps_prime)
IMPLICIT DOUBLE PRECISION (A-M,O-Z)
IMPLICIT INTEGER (N)
SAVE
c***************************************************************************
c calculates Breit-Wigner cross section of a resonance with width Gamma [GeV],
c mass DMM [GeV], max. cross section sigma_0 [mubarn] and total mass of the
c interaction s [GeV]
c***************************************************************************
pm = 0.93827D0
s = pm*pm+2.D0*pm*eps_prime
gam2s = Gamma*Gamma*s
breitwigner = sigma_0
& *(s/eps_prime**2)*gam2s/((s-DMM*DMM)**2+gam2s)
RETURN
END
DOUBLE PRECISION function Pl(x,xth,xmax,alpha)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
SAVE
if (xth.gt.x) then
Pl = 0.
RETURN
endif
a = alpha*xmax/xth
prod1 = ((x-xth)/(xmax-xth))**(a-alpha)
prod2 = (x/xmax)**(-a)
Pl = prod1*prod2
END
DOUBLE PRECISION function Ef(x,th,w)
IMPLICIT DOUBLE PRECISION (A-M,O-Z)
IMPLICIT INTEGER (N)
SAVE
wth = w+th
if (x.le.th) then
Ef = 0.
RETURN
else if (x.gt.th.and.x.lt.wth) then
Ef = (x-th)/w
RETURN
else if (x.ge.wth) then
Ef = 1.
RETURN
else
print*,'error in function EF'
STOP
endif
END
subroutine dec_inter3(eps_prime,Imode,L0)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
SAVE
DOUBLE PRECISION RNDM
external RNDM
c*** decides which process takes place at eps_prime ********
c (6) excitation/decay of resonance ***
c (2) direct pion production: N\gamma --> N \pi ***
c (3) direct pion production: N\gamma --> \Delta \pi ***
c (1) diffractive scattering: N\gamma --> N \rho ***
c (4) diffractive scattering: N\gamma --> N \omega ***
c (0) multipion production (fragmentation) ***
c (5) fragmentation in resonance region ***
c***********************************************************
c** Date: 15/04/98 **
c** author: A.Muecke **
c**********************
tot = crossection(eps_prime,3,L0)
if (tot.eq.0.) tot = 1.D0
prob1 = crossection(eps_prime,1,L0)/tot
prob2 = crossection(eps_prime,7,L0)/tot
prob3 = crossection(eps_prime,2,L0)/tot
prob4 = crossection(eps_prime,8,L0)/tot
prob5 = crossection(eps_prime,9,L0)/tot
prob6 = crossection(eps_prime,0,L0)/tot
prob7 = 1.D0
rn = RNDM(0)
if (rn.lt.prob1) then
Imode = 6
c ... --> resonance decay
RETURN
else if (prob1.le.rn.and.rn.lt.prob2) then
Imode = 2
c ... --> direct channel: N\gamma --> N\pi
RETURN
else if (prob2.le.rn.and.rn.lt.prob3) then
Imode = 3
c ... --> direct channel: N\gamma --> \Delta \pi
RETURN
else if (prob3.le.rn.and.rn.lt.prob4) then
Imode = 1
c ... --> diffractive scattering: N\gamma --> N \rho
RETURN
else if (prob4.le.rn.and.rn.lt.prob5) then
Imode = 4
c ... --> diffractive scattering: N\gamma --> N \omega
RETURN
else if (prob5.le.rn.and.rn.lt.prob6) then
Imode = 5
c ... --> fragmentation (2) in resonance region
return
else if (prob6.le.rn.and.rn.lt.1.) then
Imode = 0
c ... --> fragmentation mode/multipion production
RETURN
else if (rn.eq.1.D0) then
Imode = 0
RETURN
else
print*,'error in dec_inter.f !'
STOP
endif
END
SUBROUTINE PROC_TWOPART(LA,LB,AMD,Lres,Pres,costheta,nbad)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
COMMON /S_MASS1/ AM(49), AM2(49)
COMMON /RES_FLAG/ FRES(49),XLIMRES(49)
SAVE
DIMENSION Pres(2000,5),Lres(2000)
c***********************************************************
c 2-particle decay of CMF mass AMD INTO M1 + M2
C NUCLEON ENERGY E0 [in GeV];
C E1,E2 [in GeV] are energies of decay products
c LA,LB are code numbers of decay products
c P1(1:5),P2(1:5) are 5-momenta of particles LA,LB;
c resulting momenta are calculated in CM frame;
c costheta is cos of scattering angle in CM frame
c this program also checks if the resulting particles are
c resonances; if yes, it is also allowed to decay a
c mass AMD < M1 + M2 by using the width of the resonance(s)
c***********************************************************
c** Date: 20/01/98 **
c** correct.:19/02/98**
c** author: A.Muecke **
c**********************
nbad = 0
c ND = 2
SM1 = AM(LA)
if (LB.eq.0) then
c... for Landau-Model:
SM2 = 2.D0*AM(7)
else
SM2 = AM(LB)
endif
E1 = (AMD*AMD + SM1*SM1 - SM2*SM2)/AMD/2.D0
E2 = (AMD*AMD + SM2*SM2 - SM1*SM1)/AMD/2.D0
c... check if SM1+SM2 < AMD:
if ((SM1+SM2).gt.AMD) then
c... if one of the decay products is a resonance, this 'problem' can
c be solved by using a reduced mass for the resonance and assume that
c this resonance is produced at its threshold;
if (FRES(LA).eq.1.D0) then
c ... particle LA is a resonance:
SM1 = AMD-SM2
E1 = SM1
E2 = AMD-E1
if (E1.lt.XLIMRES(LA).or.E2.lt.XLIMRES(LB)) nbad = 1
endif
if (FRES(LB).eq.1.D0) then
c ... particle LB is a resonance:
SM2 = AMD-SM1
E2 = SM2
E1 = AMD-E2
if (E1.lt.XLIMRES(LA).or.E2.lt.XLIMRES(LB)) nbad = 1
endif
c ... both particles are NOT resonances: -> error !
if (FRES(LA).eq.0.D0.and.FRES(LB).eq.0.D0) then
print*,'SM1 + SM2 > AMD in PROC_TWOPART',SM1,SM2,AMD,LA,LB
STOP
endif
endif
if (nbad.eq.0) then
PC = SQRT((E1*E1 - SM1*SM1))
Pres(1,4) = E1
Pres(2,4) = E2
Pres(1,5) = SM1
Pres(2,5) = SM2
C *********************************************************
c theta is scattering angle in CM frame:
r = RNDM(0)
P1Z= PC*costheta
P2Z=-PC*costheta
P1X = sqrt(r*(PC*PC-P1Z*P1Z))
P2X = sqrt(r*(PC*PC-P2Z*P2Z))
P1Y = sqrt((1.D0-r)*(PC*PC-P1Z*P1Z))
P2Y = sqrt((1.D0-r)*(PC*PC-P2Z*P2Z))
if(RNDM(0).lt.0.5D0) then
P1X = -P1X
else
P2X = -P2X
endif
if(RNDM(0).lt.0.5D0) then
P1Y = -P1Y
else
P2Y = -P2Y
endif
Pres(1,1) = P1X
Pres(1,2) = P1Y
Pres(1,3) = P1Z
Pres(2,1) = P2X
Pres(2,2) = P2Y
Pres(2,3) = P2Z
Lres(1) = LA
Lres(2) = LB
endif
RETURN
END
subroutine dec_res2(eps_prime,IRES,IRESMAX,L0)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
SAVE
c*****************************************************************************
c*** decides which resonance with ID=IRES in list takes place at eps_prime ***
c*****************************************************************************
c** Date: 20/01/98 **
c** author: A.Muecke **
c**********************
DIMENSION prob_sum(9)
c CHARACTER NAMPRESp*6,NAMPRESn*6
c*** sum of all resonances:
sumres = 0.D0
do 12 j=1,IRESMAX
j10 = j+10
sumres = sumres+crossection(eps_prime,j10,L0)
prob_sum(j) = sumres
12 continue
r = RNDM(0)
IRES = 0
i = 0
prob = 0.D0
10 continue
i = i+1
probold = prob
prob = prob_sum(i)/sumres
if (r.ge.probold.and.r.lt.prob) then
IRES = i
RETURN
endif
if (i.lt.IRESMAX) goto 10
if (r.eq.1.D0) IRES = i
if (IRES.eq.0) then
print*,'no resonance possible !'
STOP
endif
RETURN
END