forked from alisw/jewel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jewel-2.1.0.f
6839 lines (6449 loc) · 189 KB
/
jewel-2.1.0.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
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C++ Copyright (C) 2016 Korinna C. Zapp [[email protected]] ++
C++ ++
C++ This file is part of JEWEL 2.1.0 ++
C++ ++
C++ The JEWEL homepage is jewel.hepforge.org ++
C++ ++
C++ The medium model was partly implemented by Jochen Klein. ++
C++ Raghav Kunnawalkam Elayavalli helped with the implementation ++
C++ of the V+jet processes. ++
C++ ++
C++ Please follow the MCnet GUIDELINES and cite Eur.Phys.J. C74 ++
C++ (2014) no.2, 2762 [arXiv:1311.0048] for the code and ++
C++ JHEP 1303 (2013) 080 [arXiv:1212.1599] and ++
C++ optionally EPJC C60 (2009) 617 [arXiv:0804.3568] for the ++
C++ physics. The reference for V+jet processes is ++
C++ arXiv:1608.03099. ++
C++ ++
C++ JEWEL relies heavily on PYTHIA 6 for the event generation. The ++
C++ modified version of PYTHIA 6.4.25 that is distributed with ++
C++ JEWEL is, however, not an official PYTHIA release and must not ++
C++ be used for anything else. Please refer to results as ++
C++ "JEWEL+PYTHIA". ++
C++ ++
C++ JEWEL also uses code provided by S. Zhang and J. M. Jing ++
C++ (Computation of Special Functions, John Wiley & Sons, New York, ++
C++ 1996 and http://jin.ece.illinois.edu) for computing the ++
C++ exponential integral Ei(x). ++
C++ ++
C++ ++
C++ JEWEL is free software; you can redistribute it and/or ++
C++ modify it under the terms of the GNU General Public License ++
C++ as published by the Free Software Foundation; either version 2 ++
C++ of the License, or (at your option) any later version. ++
C++ ++
C++ JEWEL is distributed in the hope that it will be useful, ++
C++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++
C++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++
C++ GNU General Public License for more details. ++
C++ ++
C++ You should have received a copy of the GNU General Public ++
C++ License along with this program; if not, write to the Free ++
C++ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, ++
C++ MA 02110-1301 USA ++
C++ ++
C++ Linking JEWEL statically or dynamically with other modules is ++
C++ making a combined work based on JEWEL. Thus, the terms and ++
C++ conditions of the GNU General Public License cover the whole ++
C++ combination. ++
C++ ++
C++ In addition, as a special exception, I give you permission to ++
C++ combine JEWEL with the code for the computation of special ++
C++ functions provided by S. Zhang and J. M. Jing. You may copy and ++
C++ distribute such a system following the terms of the GNU GPL for ++
C++ JEWEL and the licenses of the other code concerned, provided ++
C++ that you include the source code of that other code when and as ++
C++ the GNU GPL requires distribution of source code. ++
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PROGRAM JEWEL
IMPLICIT NONE
C--Common block of Pythia
COMMON/PYJETS/N,NPAD,K(23000,5),P(23000,5),V(23000,5)
INTEGER N,NPAD,K
DOUBLE PRECISION P,V
COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
INTEGER MSTU,MSTJ
DOUBLE PRECISION PARU,PARJ
COMMON/PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
INTEGER MDCY,MDME,KFDP
DOUBLE PRECISION BRAT
COMMON/PYSUBS/MSEL,MSELPD,MSUB(500),KFIN(2,-40:40),CKIN(200)
INTEGER MSEL,MSELPD,MSUB,KFIN
DOUBLE PRECISION CKIN
COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
INTEGER MSTP,MSTI
DOUBLE PRECISION PARP,PARI
COMMON/PYDATR/MRPY(6),RRPY(100)
INTEGER MRPY
DOUBLE PRECISION RRPY
C--identifier of file for hepmc output and logfile
common/hepmcid/hpmcfid,logfid
integer hpmcfid,logfid
C--use nuclear pdf?
COMMON/NPDF/MASS,NSET,EPS09,INITSTR
INTEGER NSET
DOUBLE PRECISION MASS
LOGICAL EPS09
CHARACTER*10 INITSTR
C--number of protons
common/np/nproton
integer nproton
C--organisation of event record
common/evrecord/nsim,npart,offset,hadrotype,sqrts,collider,hadro,
&shorthepmc,channel,isochannel
integer nsim,npart,offset,hadrotype
double precision sqrts
character*4 collider,channel
character*2 isochannel
logical hadro,shorthepmc
C--discard event flag
COMMON/DISC/NDISC,NSTRANGE,NGOOD,errcount,wdisc,DISCARD
LOGICAL DISCARD
INTEGER NDISC,NSTRANGE,NGOOD,errcount
double precision wdisc
C--event weight
COMMON/WEIGHT/EVWEIGHT,sumofweights
double precision EVWEIGHT,sumofweights
C--number of scattering events
COMMON/CHECK/NSCAT,NSCATEFF,NSPLIT
DOUBLE PRECISION NSCAT,NSCATEFF,NSPLIT
C--number of extrapolations in tables
common/extrapolations/ntotspliti,noverspliti,ntotpdf,noverpdf,
&ntotxsec,noverxsec,ntotsuda,noversuda
integer ntotspliti,noverspliti,ntotpdf,noverpdf,
&ntotxsec,noverxsec,ntotsuda,noversuda
C--local variables
integer j,i,kk,poissonian
integer nsimpp,nsimpn,nsimnp,nsimnn,nsimsum,nsimchn
double precision sumofweightstot,wdisctot,scalefac
double precision gettemp,r,tau
character*2 b1,b2
call init()
SUMOFWEIGHTSTOT=0.d0
WDISCTOT=0.d0
C--e+ + e- event generation
if (collider.eq.'EEJJ') then
b1 = 'e+'
b2 = 'e-'
write(logfid,*)
write(logfid,*)
&'####################################################'
write(logfid,*)
write(logfid,*)'generating ',nsim,' events in ',b1,' + ',b2,
&' channel'
write(logfid,*)
write(logfid,*)
&'####################################################'
write(logfid,*)
SUMOFWEIGHTS=0.d0
WDISC=0.d0
call initpythia(b1,b2)
write(logfid,*)
C--e+ + e- event loop
DO 100 J=1,NSIM
call genevent(j,b1,b2)
100 CONTINUE
sumofweightstot = sumofweightstot+sumofweights
wdisctot = wdisctot + wdisc
write(logfid,*)
write(logfid,*)'cross section in e+ + e- channel:',PARI(1),'mb'
write(logfid,*)'sum of event weights in e+ + e- channel:',
& sumofweights-wdisc
write(logfid,*)
else
C--hadronic event generation
if (isochannel.eq.'PP') then
nsimpp = nsim
nsimpn = 0
nsimnp = 0
nsimnn = 0
elseif (isochannel.eq.'PN') then
nsimpp = 0
nsimpn = nsim
nsimnp = 0
nsimnn = 0
elseif (isochannel.eq.'NP') then
nsimpp = 0
nsimpn = 0
nsimnp = nsim
nsimnn = 0
elseif (isochannel.eq.'NN') then
nsimpp = 0
nsimpn = 0
nsimnp = 0
nsimnn = nsim
else
nsimpp = poissonian(nsim*nproton**2/mass**2)
nsimpn = poissonian(nsim*nproton*(mass-nproton*1.d0)/mass**2)
nsimnp = poissonian(nsim*nproton*(mass-nproton*1.d0)/mass**2)
nsimnn = poissonian(nsim*(mass-nproton*1.d0)**2/mass**2)
nsimsum = nsimpp + nsimpn + nsimnp + nsimnn
scalefac = nsim*1.d0/(nsimsum*1.d0)
nsimpp = int(nsimpp*scalefac)
nsimpn = int(nsimpn*scalefac)
nsimnp = int(nsimnp*scalefac)
nsimnn = int(nsimnn*scalefac)
nsimsum = nsimpp + nsimpn + nsimnp + nsimnn
endif
C--loop over channels
do 101 kk=1,4
if (kk.eq.1) then
b1 = 'p+'
b2 = 'p+'
nsimchn = nsimpp
elseif (kk.eq.2) then
b1 = 'p+'
b2 = 'n0'
nsimchn = nsimpn
elseif (kk.eq.3) then
b1 = 'n0'
b2 = 'p+'
nsimchn = nsimnp
else
b1 = 'n0'
b2 = 'n0'
nsimchn = nsimnn
endif
write(logfid,*)
write(logfid,*)
&'####################################################'
write(logfid,*)
write(logfid,*)'generating ',nsimchn,' events in ',
&b1,' + ',b2,' channel'
write(logfid,*)
write(logfid,*)
&'####################################################'
write(logfid,*)
SUMOFWEIGHTS=0.d0
WDISC=0.d0
call initpythia(b1,b2)
write(logfid,*)
C--event loop
DO 102 J=1,nsimchn
call genevent(j,b1,b2)
102 CONTINUE
sumofweightstot = sumofweightstot+sumofweights
wdisctot = wdisctot + wdisc
write(logfid,*)
write(logfid,*)'cross section in ',b1,' + ',b2,' channel:',
& PARI(1),'mb'
write(logfid,*)'sum of event weights in ',b1,' + ',b2,
& ' channel:',sumofweights-wdisc
write(logfid,*)
101 continue
endif
C--finish
WRITE(HPMCFID,'(A)')'HepMC::IO_GenEvent-END_EVENT_LISTING'
WRITE(HPMCFID,*)
CLOSE(HPMCFID,status='keep')
write(logfid,*)
write(logfid,*)'mean number of scatterings:',
& NSCAT/(SUMOFWEIGHTSTOT-WDISCTOT)
write(logfid,*)'mean number of effective scatterings:',
& NSCATEFF/(SUMOFWEIGHTSTOT-WDISCTOT)
write(logfid,*)'mean number of splittings:',
& NSPLIT/(SUMOFWEIGHTSTOT-WDISCTOT)
write(logfid,*)
write(logfid,*)'number of extrapolations in splitting integral: ',
& noverspliti,' (',(noverspliti*1.d0)/(ntotspliti*1.d0),'%)'
write(logfid,*)
& 'number of extrapolations in splitting partonic PDFs: ',
& noverpdf,' (',(noverpdf*1.d0)/(ntotpdf*1.d0),'%)'
write(logfid,*)
& 'number of extrapolations in splitting cross sections: ',
& noverxsec,' (',(noverxsec*1.d0)/(ntotxsec*1.d0),'%)'
write(logfid,*)
& 'number of extrapolations in Sudakov form factor: ',
& noversuda,' (',(noversuda*1.d0)/(ntotsuda*1.d0),'%)'
write(logfid,*)
write(logfid,*)'number of good events: ',ngood
write(logfid,*)'total number of discarded events: ',NDISC
write(logfid,*)'number of events for which conversion '//
&'to hepmc failed: ',NSTRANGE
call printtime
close(logfid,status='keep')
END
***********************************************************************
***********************************************************************
*** END OF MAIN PROGRAM - NOW COME THE SUBROUTINES ****************
***********************************************************************
***********************************************************************
***********************************************************************
*** subroutine init
***********************************************************************
subroutine init()
implicit none
INTEGER PYCOMP
INTEGER NMXHEP
C--Common block of Pythia
COMMON/PYJETS/N,NPAD,K(23000,5),P(23000,5),V(23000,5)
INTEGER N,NPAD,K
DOUBLE PRECISION P,V
COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
INTEGER MSTU,MSTJ
DOUBLE PRECISION PARU,PARJ
COMMON/PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
INTEGER MDCY,MDME,KFDP
DOUBLE PRECISION BRAT
COMMON/PYSUBS/MSEL,MSELPD,MSUB(500),KFIN(2,-40:40),CKIN(200)
INTEGER MSEL,MSELPD,MSUB,KFIN
DOUBLE PRECISION CKIN
COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
INTEGER MSTP,MSTI
DOUBLE PRECISION PARP,PARI
COMMON/PYDATR/MRPY(6),RRPY(100)
INTEGER MRPY
DOUBLE PRECISION RRPY
C--use nuclear pdf?
COMMON/NPDF/MASS,NSET,EPS09,INITSTR
INTEGER NSET
DOUBLE PRECISION MASS
LOGICAL EPS09
CHARACTER*10 INITSTR
C--pdfset
common/pdf/pdfset
integer pdfset
C--number of protons
common/np/nproton
integer nproton
C--Parameter common block
COMMON/PARAM/Q0,LPS,LQCD,LTIME,SCALEFACM,ANGORD,SCATRECOIL,
&ALLHAD,compress,NF
INTEGER NF
DOUBLE PRECISION Q0,LQCD,LTIME,LPS,SCALEFACM
LOGICAL ANGORD,SCATRECOIL,ALLHAD,compress
C--splitting integral
COMMON/SPLITINT/SPLITIGGV(1000,1000),SPLITIQQV(1000,1000),
&SPLITIQGV(1000,1000),QVAL(1000),ZMVAL(1000),QMAX,ZMMIN,NPOINT
INTEGER NPOINT
DOUBLE PRECISION SPLITIGGV,SPLITIQQV,SPLITIQGV,
&QVAL,ZMVAL,QMAX,ZMMIN
C--pdf common block
COMMON/PDFS/QINQX(2,1000),GINQX(2,1000),QINGX(2,1000),
&GINGX(2,1000)
DOUBLE PRECISION QINQX,GINQX,QINGX,GINGX
C--cross secttion common block
COMMON/XSECS/INTQ1(1001,101),INTQ2(1001,101),
&INTG1(1001,101),INTG2(1001,101)
DOUBLE PRECISION INTQ1,INTQ2,INTG1,INTG2
C--Sudakov common block
COMMON/INSUDA/SUDAQQ(1000,2),SUDAQG(1000,2),SUDAGG(1000,2)
&,SUDAGC(1000,2)
DOUBLE PRECISION SUDAQQ,SUDAQG,SUDAGG,SUDAGC
C--exponential integral for negative arguments
COMMON/EXPINT/EIXS(3,1000),VALMAX,NVAL
INTEGER NVAL
DOUBLE PRECISION EIXS,VALMAX
C--discard event flag
COMMON/DISC/NDISC,NSTRANGE,NGOOD,errcount,wdisc,DISCARD
LOGICAL DISCARD
INTEGER NDISC,NSTRANGE,NGOOD,errcount
double precision wdisc
C--factor in front of formation times
COMMON/FTIMEFAC/FTFAC
DOUBLE PRECISION FTFAC
C--factor in front of alphas argument
COMMON/ALPHASFAC/PTFAC
DOUBLE PRECISION PTFAC
C--number of scattering events
COMMON/CHECK/NSCAT,NSCATEFF,NSPLIT
DOUBLE PRECISION NSCAT,NSCATEFF,NSPLIT
C--number of extrapolations in tables
common/extrapolations/ntotspliti,noverspliti,ntotpdf,noverpdf,
&ntotxsec,noverxsec,ntotsuda,noversuda
integer ntotspliti,noverspliti,ntotpdf,noverpdf,
&ntotxsec,noverxsec,ntotsuda,noversuda
C--event weight
COMMON/WEIGHT/EVWEIGHT,sumofweights
double precision EVWEIGHT,sumofweights
C--event weight exponent
COMMON/WEXPO/WEIGHTEX
DOUBLE PRECISION WEIGHTEX
C--identifier of file for hepmc output and logfile
common/hepmcid/hpmcfid,logfid
integer hpmcfid,logfid
C--max rapidity
common/rapmax/etamax
double precision etamax
C--memory for error message from getdeltat
common/errline/errl
integer errl
C--organisation of event record
common/evrecord/nsim,npart,offset,hadrotype,sqrts,collider,hadro,
&shorthepmc,channel,isochannel
integer nsim,npart,offset,hadrotype
double precision sqrts
character*4 collider,channel
character*2 isochannel
logical hadro,shorthepmc
C--Pythia parameters
common/pythiaparams/PTMIN,PTMAX,weighted
double precision PTMIN,PTMAX
LOGICAL WEIGHTED
C--Variables local to this program
INTEGER NJOB,ios,pos,i,j,jj,intmass
DOUBLE PRECISION GETLTIMEMAX,EOVEST,r,pyr
character firstchar
CHARACTER*2 SNSET
CHARACTER*80 PDFFILE,XSECFILE,FILEMED,FILESPLIT,buffer,
&label,value
CHARACTER*100 HEPMCFILE,LOGFILE,FILENAME2
CHARACTER(LEN=100) filename
LOGICAL PDFEXIST,SPLITIEXIST,XSECEXIST
HPMCFID = 4
logfid = 3
C--default settings
nsim = 10000
njob = 0
logfile = 'out.log'
hepmcfile = 'out.hepmc'
filesplit = 'splitint.dat'
pdffile = 'pdfs.dat'
xsecfile = 'xsecs.dat'
filemed = 'medium-params.dat'
nf = 3
lqcd = 0.4
q0 = 1.5
ptmin = 5.
ptmax = 350.
etamax = 3.1
collider = 'PPJJ'
isochannel = 'XX'
channel = 'MUON'
sqrts = 2760
pdfset = 10042
nset = 1
mass = 208.
nproton = 82
weighted = .true.
weightex = 5.
angord = .true.
allhad = .false.
hadro = .true.
hadrotype = 0
shorthepmc = .true.
compress = .true.
lps = lqcd
scatrecoil = .false.
if (.not.hadro) shorthepmc = .true.
SCALEFACM=1.
ptfac=1.
ftfac=1.d0
if (iargc().eq.0) then
write(*,*)'No parameter file given, '//
&'will run with default settings.'
else
call getarg(1,filename)
write(*,*)'Reading parameters from ',filename
open(unit=1,file=filename,status='old',err=110)
do 120 i=1,1000
read(1, '(A)', iostat=ios) buffer
if(ios.ne.0) goto 130
firstchar = buffer(1:1)
if (firstchar.eq.'#') goto 120
pos=scan(buffer,' ')
label=buffer(1:pos)
value=buffer(pos+1:)
if(label.eq."NEVENT")then
read(value,*,iostat=ios) nsim
elseif(label.eq."NJOB")then
read(value,*,iostat=ios) njob
elseif(label.eq."LOGFILE")then
read(value,'(a)',iostat=ios) logfile
elseif(label.eq."HEPMCFILE")then
read(value,'(a)',iostat=ios) hepmcfile
elseif(label.eq."SPLITINTFILE")then
read(value,'(a)',iostat=ios) filesplit
elseif(label.eq."PDFFILE")then
read(value,'(a)',iostat=ios) pdffile
elseif(label.eq."XSECFILE")then
read(value,'(a)',iostat=ios) xsecfile
elseif(label.eq."MEDIUMPARAMS")then
read(value,'(a)',iostat=ios) filemed
elseif(label.eq."NF")then
read(value,*,iostat=ios) nf
elseif(label.eq."LAMBDAQCD")then
read(value,*,iostat=ios) lqcd
elseif(label.eq."Q0")then
read(value,*,iostat=ios) q0
elseif(label.eq."PTMIN")then
read(value,*,iostat=ios) ptmin
elseif(label.eq."PTMAX")then
read(value,*,iostat=ios) ptmax
elseif(label.eq."ETAMAX")then
read(value,*,iostat=ios) etamax
elseif(label.eq."PROCESS")then
read(value,*,iostat=ios) collider
elseif(label.eq."ISOCHANNEL")then
read(value,*,iostat=ios) isochannel
elseif(label.eq."CHANNEL")then
read(value,*,iostat=ios) channel
elseif(label.eq."SQRTS")then
read(value,*,iostat=ios) sqrts
elseif(label.eq."PDFSET")then
read(value,*,iostat=ios) pdfset
elseif(label.eq."NSET")then
read(value,*,iostat=ios) nset
elseif(label.eq."MASS")then
read(value,*,iostat=ios) mass
elseif(label.eq."NPROTON")then
read(value,*,iostat=ios) nproton
elseif(label.eq."WEIGHTED")then
read(value,*,iostat=ios) weighted
elseif(label.eq."WEXPO")then
read(value,*,iostat=ios) weightex
elseif(label.eq."ANGORD")then
read(value,*,iostat=ios) angord
elseif(label.eq."KEEPRECOILS")then
read(value,*,iostat=ios) allhad
elseif(label.eq."HADRO")then
read(value,*,iostat=ios) hadro
elseif(label.eq."HADROTYPE")then
read(value,*,iostat=ios) hadrotype
elseif(label.eq."SHORTHEPMC")then
read(value,*,iostat=ios) shorthepmc
elseif(label.eq."COMPRESS")then
read(value,*,iostat=ios) compress
else
write(*,*)'unknown label ',label
endif
120 continue
110 write(*,*)
& 'Unable to open parameter file, will exit the run.'
call exit(1)
130 close(1,status='keep')
write(*,*)'...done'
endif
if (ptmin.lt.3.d0) ptmin = 3.d0
OPEN(unit=logfid,file=LOGFILE,status='unknown')
MSTU(11)=logfid
call printtime
call printlogo(logfid)
write(logfid,*)
write(logfid,*)'parameters of the run:'
write(logfid,*)'NEVENT = ',nsim
write(logfid,*)'NJOB = ',njob
write(logfid,*)'LOGFILE = ',logfile
write(logfid,*)'HEPMCFILE = ',hepmcfile
write(logfid,*)'SPLITINTFILE = ',filesplit
write(logfid,*)'PDFFILE = ',pdffile
write(logfid,*)'XSECFILE = ',xsecfile
write(logfid,*)'MEDIUMPARAMS = ',filemed
write(logfid,*)'NF = ',nf
write(logfid,*)'LAMBDAQCD = ',lqcd
write(logfid,*)'Q0 = ',q0
write(logfid,*)'PTMIN = ',ptmin
write(logfid,*)'PTMAX = ',ptmax
write(logfid,*)'ETAMAX = ',etamax
write(logfid,*)'PROCESS = ',collider
write(logfid,*)'ISOCHANNEL = ',isochannel
write(logfid,*)'CHANNEL = ',channel
write(logfid,*)'SQRTS = ',sqrts
write(logfid,*)'PDFSET = ',pdfset
write(logfid,*)'NSET = ',nset
write(logfid,*)'MASS = ',mass
write(logfid,*)'NPROTON = ',nproton
write(logfid,*)'WEIGHTED = ',weighted
write(logfid,*)'WEXPO = ',weightex
write(logfid,*)'ANGORD = ',angord
write(logfid,*)'KEEPRECOILS = ',allhad
write(logfid,*)'HADRO = ',hadro
write(logfid,*)'HADROTYPE = ',hadrotype
write(logfid,*)'SHORTHEPMC = ',shorthepmc
write(logfid,*)'COMPRESS = ',compress
write(logfid,*)
call flush(logfid)
if ((collider.ne.'PPJJ').and.(collider.ne.'EEJJ')
& .and.(collider.ne.'PPYJ').and.(collider.ne.'PPYQ')
& .and.(collider.ne.'PPYG')
& .and.(collider.ne.'PPZJ').and.(collider.ne.'PPZQ')
& .and.(collider.ne.'PPZG').and.(collider.ne.'PPWJ')
& .and.(collider.ne.'PPWQ').and.(collider.ne.'PPWG')
& .and.(collider.ne.'PPDY')) then
write(logfid,*)'Fatal error: colliding system unknown, '//
& 'will exit now'
call exit(1)
endif
C--initialize medium
intmass = int(mass)
CALL MEDINIT(FILEMED,logfid,etamax,intmass)
CALL MEDNEXTEVT
OPEN(unit=HPMCFID,file=HEPMCFILE,status='unknown')
WRITE(HPMCFID,*)
WRITE(HPMCFID,'(A)')'HepMC::Version 2.06.05'
WRITE(HPMCFID,'(A)')'HepMC::IO_GenEvent-START_EVENT_LISTING'
NPART=2
if(ptmax.gt.0.)then
EOVEST=MIN(1.5*(PTMAX+50.)*COSH(ETAMAX),sqrts/2.)
else
EOVEST=sqrts/2.
endif
CALL EIXINT
CALL INSUDAINT(EOVEST)
write(logfid,*)
INQUIRE(file=FILESPLIT,exist=SPLITIEXIST)
IF(SPLITIEXIST)THEN
write(logfid,*)'read splitting integrals from ',FILESPLIT
OPEN(unit=10,file=FILESPLIT,status='old')
READ(10,*)QMAX,ZMMIN,NPOINT
DO 893 I=1,NPOINT+1
READ(10,*) QVAL(I),ZMVAL(I)
893 CONTINUE
DO 891 I=1,NPOINT+1
DO 892 J=1,NPOINT+1
READ(10,*)SPLITIGGV(I,J),SPLITIQQV(I,J),SPLITIQGV(I,J)
892 CONTINUE
891 CONTINUE
CLOSE(10,status='keep')
ELSE
write(logfid,*)'have to integrate splitting functions, '//
&'this may take some time'
CALL SPLITFNCINT(EOVEST)
INQUIRE(file=FILESPLIT,exist=SPLITIEXIST)
IF(.NOT.SPLITIEXIST)THEN
write(logfid,*)'write splitting integrals to ',FILESPLIT
OPEN(unit=10,file=FILESPLIT,status='new')
WRITE(10,*)QMAX,ZMMIN,NPOINT
DO 896 I=1,NPOINT+1
WRITE(10,*) QVAL(I),ZMVAL(I)
896 CONTINUE
DO 897 I=1,NPOINT+1
DO 898 J=1,NPOINT+1
WRITE(10,*)SPLITIGGV(I,J),SPLITIQQV(I,J),SPLITIQGV(I,J)
898 CONTINUE
897 CONTINUE
CLOSE(10,status='keep')
ENDIF
ENDIF
write(logfid,*)
INQUIRE(file=PDFFILE,exist=PDFEXIST)
IF(PDFEXIST)THEN
write(logfid,*)'read pdfs from ',PDFFILE
OPEN(unit=10,file=PDFFILE,status='old')
DO 872 I=1,2
DO 873 J=1,1000
READ(10,*)QINQX(I,J),GINQX(I,J),QINGX(I,J),GINGX(I,J)
873 CONTINUE
872 CONTINUE
CLOSE(10,status='keep')
ELSE
write(logfid,*)'have to integrate pdfs, this may take some time'
CALL PDFINT(EOVEST)
INQUIRE(file=PDFFILE,exist=PDFEXIST)
IF(.NOT.PDFEXIST)THEN
write(logfid,*)'write pdfs to ',PDFFILE
OPEN(unit=10,file=PDFFILE,status='new')
DO 876 I=1,2
DO 877 J=1,1000
WRITE(10,*)QINQX(I,J),GINQX(I,J),QINGX(I,J),GINGX(I,J)
877 CONTINUE
876 CONTINUE
CLOSE(10,status='keep')
ENDIF
ENDIF
write(logfid,*)
INQUIRE(file=XSECFILE,exist=XSECEXIST)
IF(XSECEXIST)THEN
write(logfid,*)'read cross sections from ',XSECFILE
OPEN(unit=10,file=XSECFILE,status='old')
DO 881 J=1,1001
DO 885 JJ=1,101
READ(10,*)INTQ1(J,JJ),INTQ2(J,JJ),
&INTG1(J,JJ),INTG2(J,JJ)
885 CONTINUE
881 CONTINUE
CLOSE(10,status='keep')
ELSE
write(logfid,*)'have to integrate cross sections, '//
&'this may take some time'
CALL XSECINT(EOVEST)
INQUIRE(file=XSECFILE,exist=XSECEXIST)
IF(.NOT.XSECEXIST)THEN
write(logfid,*)'write cross sections to ',XSECFILE
OPEN(unit=10,file=XSECFILE,status='new')
DO 883 J=1,1001
DO 884 JJ=1,101
WRITE(10,*)INTQ1(J,JJ),INTQ2(J,JJ),
&INTG1(J,JJ),INTG2(J,JJ)
884 CONTINUE
883 CONTINUE
CLOSE(10,status='keep')
ENDIF
ENDIF
write(logfid,*)
CALL FLUSH(3)
C--initialise random number generator status
IF(NJOB.GT.0)THEN
MRPY(1)=NJOB*1000
MRPY(2)=0
ENDIF
C--Call PYR once for initialization
R=PYR(0)
NDISC=0
NGOOD=0
NSTRANGE=0
ERRCOUNT=0
errl = 0
NSCAT=0.d0
NSCATEFF=0.d0
NSPLIT=0.d0
ntotspliti=0
noverspliti=0
ntotpdf=0
noverpdf=0
ntotxsec=0
noverxsec=0
ntotsuda=0
noversuda=0
IF(NSET.EQ.0)THEN
EPS09=.FALSE.
ELSE
EPS09=.TRUE.
IF(NSET.LT.10)THEN
WRITE(SNSET,'(i1)') NSET
ELSE
WRITE(SNSET,'(i2)') NSET
ENDIF
INITSTR='EPS09LO,'//SNSET
ENDIF
end
***********************************************************************
*** subroutine initpythia
***********************************************************************
subroutine initpythia(beam1,beam2)
implicit none
INTEGER PYCOMP
INTEGER NMXHEP
C--Common block of Pythia
COMMON/PYJETS/N,NPAD,K(23000,5),P(23000,5),V(23000,5)
INTEGER N,NPAD,K
DOUBLE PRECISION P,V
COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
INTEGER MSTU,MSTJ
DOUBLE PRECISION PARU,PARJ
COMMON/PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
INTEGER MDCY,MDME,KFDP
DOUBLE PRECISION BRAT
COMMON/PYSUBS/MSEL,MSELPD,MSUB(500),KFIN(2,-40:40),CKIN(200)
INTEGER MSEL,MSELPD,MSUB,KFIN
DOUBLE PRECISION CKIN
COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
INTEGER MSTP,MSTI
DOUBLE PRECISION PARP,PARI
COMMON/PYDATR/MRPY(6),RRPY(100)
INTEGER MRPY
DOUBLE PRECISION RRPY
C--use nuclear pdf?
COMMON/NPDF/MASS,NSET,EPS09,INITSTR
INTEGER NSET
DOUBLE PRECISION MASS
LOGICAL EPS09
CHARACTER*10 INITSTR
C--pdfset
common/pdf/pdfset
integer pdfset
C--Parameter common block
COMMON/PARAM/Q0,LPS,LQCD,LTIME,SCALEFACM,ANGORD,SCATRECOIL,
&ALLHAD,compress,NF
INTEGER NF
DOUBLE PRECISION Q0,LQCD,LTIME,LPS,SCALEFACM
LOGICAL ANGORD,SCATRECOIL,ALLHAD,compress
C--discard event flag
COMMON/DISC/NDISC,NSTRANGE,NGOOD,errcount,wdisc,DISCARD
LOGICAL DISCARD
INTEGER NDISC,NSTRANGE,NGOOD,errcount
double precision wdisc
C--event weight
COMMON/WEIGHT/EVWEIGHT,sumofweights
double precision EVWEIGHT,sumofweights
C--event weight exponent
COMMON/WEXPO/WEIGHTEX
DOUBLE PRECISION WEIGHTEX
C--memory for error message from getdeltat
common/errline/errl
integer errl
C--organisation of event record
common/evrecord/nsim,npart,offset,hadrotype,sqrts,collider,hadro,
&shorthepmc,channel,isochannel
integer nsim,npart,offset,hadrotype
double precision sqrts
character*4 collider,channel
character*2 isochannel
logical hadro,shorthepmc
C--Pythia parameters
common/pythiaparams/PTMIN,PTMAX,weighted
double precision PTMIN,PTMAX
LOGICAL WEIGHTED
C--Variables local to this program
character*2 beam1,beam2
C--initialise PYTHIA
C--no multiple interactions
MSTP(81) = 0
C--initial state radiation
MSTP(61)=1
C--switch off final state radiation
MSTP(71)=0
C--No hadronisation (yet)
MSTP(111)=0
C--parameter affecting treatment of string corners
PARU(14)=1.
C--Min shat in simulation
CKIN(1)=2.
C--pT-cut
CKIN(3)=PTMIN
CKIN(4)=PTMAX
C--use LHAPDF
MSTP(52)=2
C--choose pdf: CTEQ6ll (LO fit/LO alphas) - 10042
C MSTW2008 (LO central) - 21000
MSTP(51)=PDFSET
IF(COLLIDER.EQ.'PPYQ')THEN
MSEL=0
MSUB(29)=1
ELSEIF(COLLIDER.EQ.'PPYG')THEN
MSEL=0
MSUB(14)=1
MSUB(115)=1
ELSEIF(COLLIDER.EQ.'PPYJ')THEN
MSEL=0
MSUB(14)=1
MSUB(29)=1
MSUB(115)=1
ELSEIF((COLLIDER.EQ.'PPZJ').or.(COLLIDER.EQ.'PPZQ')
& .or.(COLLIDER.EQ.'PPZG')
& .or.(collider.eq.'PPDY'))THEN
MSEL=0
IF((COLLIDER.EQ.'PPZJ').or.(COLLIDER.EQ.'PPZQ')) MSUB(30)=1
IF((COLLIDER.EQ.'PPZJ').or.(COLLIDER.EQ.'PPZG')) MSUB(15)=1
IF(COLLIDER.EQ.'PPDY') MSUB(1)=1
MDME(174,1)=0 !Z decay into d dbar',
MDME(175,1)=0 !Z decay into u ubar',
MDME(176,1)=0 !Z decay into s sbar',
MDME(177,1)=0 !Z decay into c cbar',
MDME(178,1)=0 !Z decay into b bbar',
MDME(179,1)=0 !Z decay into t tbar',
MDME(182,1)=0 !Z decay into e- e+',
MDME(183,1)=0 !Z decay into nu_e nu_ebar',
MDME(184,1)=0 !Z decay into mu- mu+',
MDME(185,1)=0 !Z decay into nu_mu nu_mubar',
MDME(186,1)=0 !Z decay into tau- tau+',
MDME(187,1)=0 !Z decay into nu_tau nu_taubar',
if (channel.EQ.'ELEC')THEN
MDME(182,1)=1
ELSEIF(channel.EQ.'MUON')THEN
MDME(184,1)=1
ENDIF
ELSEIF((COLLIDER.EQ.'PPWJ').or.(COLLIDER.EQ.'PPWQ')
& .or.(COLLIDER.EQ.'PPWG'))THEN
MSEL=0
IF((COLLIDER.EQ.'PPWJ').or.(COLLIDER.EQ.'PPWQ')) MSUB(31)=1
IF((COLLIDER.EQ.'PPWJ').or.(COLLIDER.EQ.'PPWG')) MSUB(16)=1
MDME(190,1)=0 ! W+ decay into dbar u,
MDME(191,1)=0 ! W+ decay into dbar c,
MDME(192,1)=0 ! W+ decay into dbar t,
MDME(194,1)=0 ! W+ decay into sbar u,
MDME(195,1)=0 ! W+ decay into sbar c,
MDME(196,1)=0 ! W+ decay into sbar t,
MDME(198,1)=0 ! W+ decay into bbar u,
MDME(199,1)=0 ! W+ decay into bbar c,
MDME(200,1)=0 ! W+ decay into bbar t,
MDME(202,1)=0 ! W+ decay into b'bar u,
MDME(203,1)=0 ! W+ decay into b'bar c,
MDME(204,1)=0 ! W+ decay into b'bar t,
MDME(206,1)=0 ! W+ decay into e+ nu_e,
MDME(207,1)=0 ! W+ decay into mu+ nu_mu,
MDME(208,1)=0 ! W+ decay into tau+ nu_tau,
MDME(209,1)=0 ! W+ decay into tau'+ nu'_tau,
if (channel.EQ.'ELEC')THEN
MDME(206,1)=1
ELSEIF(channel.EQ.'MUON')THEN
MDME(207,1)=1
ENDIF
ELSE
C--All QCD processes are active
MSEL=1
ENDIF
! MSEL=0
! MSUB(11)=1
! MSUB(12)=1
! MSUB(53)=1
! MSUB(13)=1
! MSUB(68)=1
! MSUB(28)=1
C--weighted events
IF(WEIGHTED) MSTP(142)=1
C--number of errors to be printed
MSTU(22)=MAX(10,INT(5.*NSIM/100.))
C--number of lines in event record
MSTU(4)=23000
MSTU(5)=23000
C--switch off pi0 decay
MDCY(PYCOMP(111),1)=0
C--initialisation call
IF(COLLIDER.EQ.'EEJJ')THEN
OFFSET=9
CALL PYINIT('CMS',beam1,beam2,sqrts)
ELSEIF((COLLIDER.EQ.'PPJJ').OR.(COLLIDER.EQ.'PPYJ').OR.
& (COLLIDER.EQ.'PPYG').OR.(COLLIDER.EQ.'PPYQ'))THEN
OFFSET=8
CALL PYINIT('CMS',beam1,beam2,sqrts)
ELSEIF((COLLIDER.EQ.'PPWJ').OR.(COLLIDER.EQ.'PPZJ').or.
& (COLLIDER.EQ.'PPWQ').OR.(COLLIDER.EQ.'PPZQ').or.
& (COLLIDER.EQ.'PPWG').OR.(COLLIDER.EQ.'PPZG'))THEN
OFFSET=10
CALL PYINIT('CMS',beam1,beam2,sqrts)
elseif (collider.eq.'PPDY') then
CALL PYINIT('CMS',beam1,beam2,sqrts)
ENDIF
end
***********************************************************************
*** subroutine genevent
***********************************************************************
subroutine genevent(j,b1,b2)
implicit none
C--identifier of file for hepmc output and logfile
common/hepmcid/hpmcfid,logfid
integer hpmcfid,logfid
INTEGER PYCOMP
INTEGER NMXHEP
C--Common block of Pythia
COMMON/PYJETS/N,NPAD,K(23000,5),P(23000,5),V(23000,5)
INTEGER N,NPAD,K
DOUBLE PRECISION P,V
COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
INTEGER MSTU,MSTJ
DOUBLE PRECISION PARU,PARJ
COMMON/PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
INTEGER MDCY,MDME,KFDP
DOUBLE PRECISION BRAT
COMMON/PYSUBS/MSEL,MSELPD,MSUB(500),KFIN(2,-40:40),CKIN(200)
INTEGER MSEL,MSELPD,MSUB,KFIN
DOUBLE PRECISION CKIN
COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
INTEGER MSTP,MSTI
DOUBLE PRECISION PARP,PARI
COMMON/PYDATR/MRPY(6),RRPY(100)
INTEGER MRPY
DOUBLE PRECISION RRPY
C--Parameter common block
COMMON/PARAM/Q0,LPS,LQCD,LTIME,SCALEFACM,ANGORD,SCATRECOIL,
&ALLHAD,compress,NF
INTEGER NF
DOUBLE PRECISION Q0,LQCD,LTIME,LPS,SCALEFACM
LOGICAL ANGORD,SCATRECOIL,ALLHAD,compress
C--discard event flag
COMMON/DISC/NDISC,NSTRANGE,NGOOD,errcount,wdisc,DISCARD
LOGICAL DISCARD
INTEGER NDISC,NSTRANGE,NGOOD,errcount