1
double precision function gamma(q0)
2
c**************************************************
3
c calculates the branching probability
4
c**************************************************
6
include 'nexternal.inc'
13
double precision q0, val, add, add2
14
double precision qr,lf
15
double precision alphas
18
parameter (pi=3.141592654d0)
22
if (Q1<m_qmass(iipdg)) return
23
m_lastas=Alphas(alpsfact*q0)
24
val=2d0*m_colfac(iipdg)*m_lastas/PI/q0
25
c if (m_mode & bpm::power_corrs) then
27
if(m_pca(iipdg,iimode).eq.0)then
32
val=val*(m_dlog(iipdg)*(1d0+m_kfac*m_lastas/(2d0*PI))*lf+m_slog(iipdg)
33
$ +qr*(m_power(iipdg,1,iimode)+qr*(m_power(iipdg,2,iimode)
34
$ +qr*m_power(iipdg,3,iimode))))
36
c val=val*m_dlog*(1d0+m_kfac*m_lastas/(2d0*PI))*log(Q1/q0)+m_slog;
38
if(m_qmass(iipdg).gt.0d0)then
39
val=val+m_colfac(iipdg)*m_lastas/PI/q0*(0.5-q0/m_qmass(iipdg)*
40
$ atan(m_qmass(iipdg)/q0)-
41
$ (1.0-0.5*(q0/m_qmass(iipdg))**2)*log(1.0+(m_qmass(iipdg)/q0)**2))
47
if(m_qmass(abs(i)).gt.0d0)then
48
add2=m_colfac(i)*m_lastas/PI/q0/
49
$ (1.0+(m_qmass(abs(i))/q0)**2)*
50
$ (1.0-1.0/3.0/(1.0+(m_qmass(abs(i))/q0)**2))
52
add2=2d0*m_colfac(i)*m_lastas/PI/q0*(m_slog(i)
53
$ +qr*(m_power(i,1,iimode)+qr*(m_power(i,2,iimode)
54
$ +qr*m_power(i,3,iimode))))
63
if (btest(mlevel,6)) then
64
write(*,*)' \\Delta^I_{',iipdg,'}(',
65
& q0,',',q1,') -> ',gamma
66
write(*,*) val,m_lastas,m_dlog(iipdg),m_slog(iipdg)
67
write(*,*) m_power(iipdg,1,iimode),m_power(iipdg,2,iimode),m_power(iipdg,3,iimode)
73
double precision function sud(q0,Q11,ipdg,imode)
74
c**************************************************
75
c actually calculates is sudakov weight
76
c**************************************************
79
include 'nexternal.inc'
83
double precision q0, Q11
84
double precision gamma,DGAUSS
95
sud=exp(-DGAUSS(gamma,q0,Q1,eps))
97
if (btest(mlevel,6)) then
98
write(*,*)' \\Delta^',imode,'_{',ipdg,'}(',
99
& 2*log10(q0/q1),') -> ',sud
105
double precision function sudwgt(q0,q1,q2,ipdg,imode)
106
c**************************************************
107
c calculates is sudakov weight
108
c**************************************************
110
include 'message.inc'
112
double precision q0, q1, q2
119
if(q2.lt.q1.and.btest(mlevel,4))
120
$ write(*,*)'Warning! q2 < q1 in sudwgt. Return 1.'
124
sudwgt=sud(q0,q2,ipdg,imode)/sud(q0,q1,ipdg,imode)
126
if (btest(mlevel,5)) then
127
write(*,*)' \\Delta^',imode,'_{',ipdg,'}(',
128
& q0,',',q1,',',q2,') -> ',sudwgt
134
logical function isqcd(ipdg)
135
c**************************************************
136
c determines whether particle is qcd particle
137
c**************************************************
142
isqcd=(iabs(get_color(ipdg)).gt.1)
147
logical function isjet(ipdg)
148
c**************************************************
149
c determines whether particle is qcd jet particle
150
c**************************************************
160
if (irfl.gt.maxjetflavor.and.irfl.ne.21) isjet=.false.
161
c write(*,*)'isjet? pdg = ',ipdg,' -> ',irfl,' -> ',isjet
166
logical function isparton(ipdg)
167
c**************************************************
168
c determines whether particle is qcd jet particle
169
c**************************************************
180
if (irfl.gt.max(asrwgtflavor,maxjetflavor).and.irfl.ne.21)
182
c write(*,*)'isparton? pdg = ',ipdg,' -> ',irfl,' -> ',isparton
188
subroutine ipartupdate(p,imo,ida1,ida2,ipdg,ipart)
189
c**************************************************
190
c Traces particle lines according to CKKW rules
191
c**************************************************
195
include 'nexternal.inc'
196
include 'message.inc'
198
double precision p(0:3,nexternal)
199
integer imo,ida1,ida2,i,idmo,idda1,idda2
200
integer ipdg(n_max_cl),ipart(2,n_max_cl)
206
if (btest(mlevel,4)) then
207
write(*,*) ' updating ipart for: ',ida1,ida2,' -> ',imo
210
if (btest(mlevel,4)) then
211
write(*,*) ' daughters: ',(ipart(i,ida1),i=1,2),(ipart(i,ida2),i=1,2)
214
c IS clustering - just transmit info on incoming line
215
if((ipart(1,ida1).ge.1.and.ipart(1,ida1).le.2).or.
216
$ (ipart(1,ida2).ge.1.and.ipart(1,ida2).le.2))then
218
if(ipart(1,ida1).le.2.and.ipart(1,ida2).le.2)then
219
c This is last clustering - keep mother ipart
220
ipart(1,imo)=ipart(1,imo)
221
elseif(ipart(1,ida2).ge.1.and.ipart(1,ida2).le.2)then
222
ipart(1,imo)=ipart(1,ida2)
223
elseif(ipart(1,ida1).ge.1.and.ipart(1,ida1).le.2)then
224
ipart(1,imo)=ipart(1,ida1)
227
$ write(*,*) ' -> ',(ipart(i,imo),i=1,2)
232
if(idmo.eq.21.and.idda1.eq.21.and.idda2.eq.21)then
233
c gluon -> 2 gluon splitting: Choose hardest gluon
234
if(p(1,ipart(1,ida1))**2+p(2,ipart(1,ida1))**2.gt.
235
$ p(1,ipart(1,ida2))**2+p(2,ipart(1,ida2))**2) then
236
ipart(1,imo)=ipart(1,ida1)
237
ipart(2,imo)=ipart(2,ida1)
239
ipart(1,imo)=ipart(1,ida2)
240
ipart(2,imo)=ipart(2,ida2)
242
else if(idmo.eq.21.and.idda1.eq.-idda2)then
243
c gluon -> quark anti-quark: use both, but take hardest as 1
244
if(p(1,ipart(1,ida1))**2+p(2,ipart(1,ida1))**2.gt.
245
$ p(1,ipart(1,ida2))**2+p(2,ipart(1,ida2))**2) then
246
ipart(1,imo)=ipart(1,ida1)
247
ipart(2,imo)=ipart(1,ida2)
249
ipart(1,imo)=ipart(1,ida2)
250
ipart(2,imo)=ipart(1,ida1)
252
else if(idmo.eq.idda1.or.idmo.eq.idda1+sign(1,idda2))then
253
c quark -> quark-gluon or quark-Z or quark-h or quark-W
254
ipart(1,imo)=ipart(1,ida1)
256
else if(idmo.eq.idda2.or.idmo.eq.idda2+sign(1,idda1))then
257
c quark -> gluon-quark or Z-quark or h-quark or W-quark
258
ipart(1,imo)=ipart(1,ida2)
262
ipart(1,imo)=ipart(1,ida1)
263
ipart(2,imo)=ipart(1,ida2)
266
if (btest(mlevel,4)) then
267
write(*,*) ' -> ',(ipart(i,imo),i=1,2)
273
logical function isjetvx(imo,ida1,ida2,ipdg,ipart,islast)
274
c***************************************************
275
c Checks if a qcd vertex generates a jet
276
c***************************************************
280
include 'nexternal.inc'
282
integer imo,ida1,ida2,idmo,idda1,idda2,i
283
integer ipdg(n_max_cl),ipart(2,n_max_cl)
284
logical isqcd,isjet,islast
292
if(islast.or..not.isqcd(idmo).or..not.isqcd(idda1).or.
293
& .not.isqcd(idda2)) then
299
if((ipart(1,ida1).ge.1.and.ipart(1,ida1).le.2).or.
300
$ (ipart(1,ida2).ge.1.and.ipart(1,ida2).le.2))then
301
c Check if ida1 is outgoing parton or ida2 is outgoing parton
302
if(ipart(1,ida2).ge.1.and.ipart(1,ida2).le.2.and.isjet(idda1).or.
303
$ ipart(1,ida1).ge.1.and.ipart(1,ida1).le.2.and.isjet(idda2))then
312
if(isjet(idda1).or.isjet(idda2))then
321
logical function ispartonvx(imo,ida1,ida2,ipdg,ipart,islast)
322
c***************************************************
323
c Checks if a qcd vertex generates a jet
324
c***************************************************
328
include 'nexternal.inc'
330
integer imo,ida1,ida2,idmo,idda1,idda2,i
331
integer ipdg(n_max_cl),ipart(2,n_max_cl)
332
logical isqcd,isparton,islast
333
external isqcd,isparton
340
if(.not.isqcd(idmo).or..not.isqcd(idda1).or.
341
& .not.isqcd(idda2)) then
347
if((ipart(1,ida1).ge.1.and.ipart(1,ida1).le.2).or.
348
$ (ipart(1,ida2).ge.1.and.ipart(1,ida2).le.2))then
349
c Check if ida1 is outgoing parton or ida2 is outgoing parton
350
if(.not.islast.and.ipart(1,ida2).ge.1.and.ipart(1,ida2).le.2.and.isparton(idda1).or.
351
$ ipart(1,ida1).ge.1.and.ipart(1,ida1).le.2.and.isparton(idda2))then
360
if(isparton(idda1).or.isparton(idda2))then
369
logical function setclscales(p)
370
c**************************************************
371
c Calculate dynamic scales based on clustering
372
c Also perform xqcut and xmtc cuts
373
c**************************************************
376
include 'message.inc'
378
include 'maxconfigs.inc'
379
include 'nexternal.inc'
380
include 'maxamps.inc'
381
include 'cluster.inc'
387
DOUBLE PRECISION P(0:3,NEXTERNAL)
390
C Present process number
391
INTEGER IMIRROR,IPROC
392
COMMON/TO_MIRROR/IMIRROR, IPROC
395
integer i, j, idi, idj
397
parameter( PI = 3.14159265358979323846d0 )
399
integer mapconfig(0:lmaxconfigs), this_config
400
integer iforest(2,-max_branch:-1,lmaxconfigs)
401
real*8 xptj,xptb,xpta,xptl,xmtc
402
real*8 xetamin,xqcut,deltaeta
403
common /to_specxpt/xptj,xptb,xpta,xptl,xmtc,xetamin,xqcut,deltaeta
404
c q2bck holds the central q2fact scales
406
common /to_q2bck/q2bck
407
double precision asref, pt2prev(n_max_cl),pt2min
408
integer n, ibeam(2), iqcd(0:2)!, ilast(0:nexternal)
409
integer idfl, idmap(-nexternal:nexternal)
410
integer ipart(2,n_max_cl)
411
double precision xnow(2)
412
integer jlast(2),jfirst(2),jcentral(2),nwarning
413
logical qcdline(2),partonline(2)
418
logical isqcd,isjet,isparton,cluster,isjetvx
419
double precision alphas
420
external isqcd, isjet, isparton, cluster, isjetvx, alphas
424
if(ickkw.le.0.and.xqcut.le.0d0.and.q2fact(1).gt.0.and.scale.gt.0) return
427
c Cluster the configuration
430
c if (.not.clustered) then
431
clustered = cluster(p(0,1))
432
if(.not.clustered) then
433
open(unit=26,file='../../../error',status='unknown',err=999)
434
write(26,*) 'Error: Clustering failed in cluster.f.'
435
write(*,*) 'Error: Clustering failed in cluster.f.'
437
999 write(*,*) 'error'
444
if (btest(mlevel,1)) then
445
write(*,*)'setclscales: identified tree {'
447
write(*,*)' ',i,': ',idacl(i,1),'(',ipdgcl(idacl(i,1),igraphs(1),iproc),')',
448
$ '&',idacl(i,2),'(',ipdgcl(idacl(i,2),igraphs(1),iproc),')',
449
$ ' -> ',imocl(i),'(',ipdgcl(imocl(i),igraphs(1),iproc),')',
450
$ ', ptij = ',dsqrt(pt2ijcl(i))
452
write(*,*)' process: ',iproc
453
write(*,*)' graphs (',igraphs(0),'):',(igraphs(i),i=1,igraphs(0))
457
c If last clustering is s-channel QCD (e.g. ttbar) use mt2last instead
458
c (i.e. geom. average of transverse mass of t and t~)
459
if(mt2last.gt.4d0 .and. nexternal.gt.3) then
460
if(isqcd(ipdgcl(idacl(nexternal-3,1),igraphs(1),iproc))
461
$ .and. isqcd(ipdgcl(idacl(nexternal-3,2),igraphs(1),iproc))
462
$ .and. isqcd(ipdgcl(imocl(nexternal-3),igraphs(1),iproc)))then
463
mt2ij(nexternal-2)=mt2last
464
mt2ij(nexternal-3)=mt2last
465
if (btest(mlevel,3)) then
466
write(*,*)' setclscales: set last vertices to mtlast: ',sqrt(mt2last)
471
C If we have fixed factorization scale, for ickkw>0 means central
472
C scale, i.e. last two scales (ren. scale for these vertices are
473
C anyway already set by "scale" above)
475
if(fixed_fac_scale.and.first)then
479
else if(fixed_fac_scale) then
486
ibeam(i)=ishft(1,i-1)
490
partonline(i)=isparton(ipdgcl(ibeam(i),igraphs(1),iproc))
491
qcdline(i)=isqcd(ipdgcl(ibeam(i),igraphs(1),iproc))
494
c Go through clusterings and set factorization scales for use in dsig
495
if (nexternal.eq.3) goto 10
499
if (isqcd(ipdgcl(idacl(n,i),igraphs(1),iproc)).and.
500
$ idacl(n,i).eq.ibeam(j).and.qcdline(j)) then
501
c is emission - this is what we want
502
c Total pdf weight is f1(x1,pt2E)*fj(x1*z,Q)/fj(x1*z,pt2E)
503
c f1(x1,pt2E) is given by DSIG, just need to set scale.
505
if(jfirst(j).eq.0)then
506
if(isjetvx(imocl(n),idacl(n,1),idacl(n,2),
507
$ ipdgcl(1,igraphs(1),iproc),ipart,n.eq.nexternal-2)) then
513
if(partonline(j))then
514
c Stop fact scale where parton line stops
516
partonline(j)=isjet(ipdgcl(imocl(n),igraphs(1),iproc))
518
c Trace QCD line through event
520
qcdline(j)=isqcd(ipdgcl(imocl(n),igraphs(1),iproc))
526
10 if(jfirst(1).le.0) jfirst(1)=jlast(1)
527
if(jfirst(2).le.0) jfirst(2)=jlast(2)
530
$ write(*,*) 'jfirst is ',jfirst(1),jfirst(2),
531
$ ' jlast is ',jlast(1),jlast(2),
532
$ ' and jcentral is ',jcentral(1),jcentral(2)
534
c Set central scale to mT2
535
if(jcentral(1).gt.0) then
536
if(mt2ij(jcentral(1)).gt.0d0)
537
$ pt2ijcl(jcentral(1))=mt2ij(jcentral(1))
539
if(jcentral(2).gt.0)then
540
if(mt2ij(jcentral(2)).gt.0d0)
541
$ pt2ijcl(jcentral(2))=mt2ij(jcentral(2))
543
if(btest(mlevel,4))then
544
print *,'jlast, jcentral: ',(jlast(i),i=1,2),(jcentral(i),i=1,2)
545
if(jlast(1).gt.0) write(*,*)'pt(jlast 1): ', sqrt(pt2ijcl(jlast(1)))
546
if(jlast(2).gt.0) write(*,*)'pt(jlast 2): ', sqrt(pt2ijcl(jlast(2)))
547
if(jcentral(1).gt.0) write(*,*)'pt(jcentral 1): ', sqrt(pt2ijcl(jcentral(1)))
548
if(jcentral(2).gt.0) write(*,*)'pt(jcentral 2): ', sqrt(pt2ijcl(jcentral(2)))
550
c Check xqcut for vertices with jet daughters only
557
$ write(*,*) 'ibeam(1,2), daughter, mother:',
558
$ ibeam(1),ibeam(2),idacl(n,j),imocl(n)
559
if (n.lt.nexternal-2) then
560
if(n.ne.jlast(1).and.n.ne.jlast(2).and.
561
$ isjet(ipdgcl(idacl(n,j),igraphs(1),iproc)).and.
562
$ (idacl(n,3-j).eq.ibeam(1).or.
563
$ idacl(n,3-j).eq.ibeam(2)).and.
564
$ sqrt(pt2ijcl(n)).lt.xqcut)then
567
$ write(*,*) 'Failed xqcut: ',n, ipdgcl(idacl(n,1),igraphs(1),iproc),
568
$ ipdgcl(idacl(n,2),igraphs(1),iproc), xqcut
574
if (idacl(n,j).eq.ibeam(1).and.imocl(n).ne.ibeam(2))
576
if (idacl(n,j).eq.ibeam(2).and.imocl(n).ne.ibeam(1))
579
if (n.lt.nexternal-2) then
580
if(n.ne.jlast(1).and.n.ne.jlast(2).and.
581
$ isjet(ipdgcl(idacl(n,1),igraphs(1),iproc)).and.
582
$ isjet(ipdgcl(idacl(n,2),igraphs(1),iproc)).and.
583
$ idacl(n,1).ne.ibeam(1).and.idacl(n,1).ne.ibeam(2).and.
584
$ idacl(n,2).ne.ibeam(1).and.idacl(n,2).ne.ibeam(2).and.
585
$ sqrt(pt2ijcl(n)).lt.xqcut)then
588
$ write(*,*) 'Failed xqcut: ',n, ipdgcl(idacl(n,1),igraphs(1),iproc),
589
$ ipdgcl(idacl(n,2),igraphs(1),iproc), xqcut
598
c JA: Check xmtc cut for central process
599
if(xmtc**2.gt.0) then
600
if(jcentral(1).gt.0.and.pt2ijcl(jcentral(1)).lt.xmtc**2
601
$ .or.jcentral(2).gt.0.and.pt2ijcl(jcentral(2)).lt.xmtc**2)then
604
if(btest(mlevel,3)) write(*,*)'Failed xmtc cut ',
605
$ sqrt(pt2ijcl(jcentral(1))),sqrt(pt2ijcl(jcentral(1))),
611
if(ickkw.eq.0.and.(fixed_fac_scale.or.q2fact(1).gt.0).and.
612
$ (fixed_ren_scale.or.scale.gt.0)) return
614
c Ensure that last scales are at least as big as first scales
616
$ pt2ijcl(jlast(1))=max(pt2ijcl(jlast(1)),pt2ijcl(jfirst(1)))
618
$ pt2ijcl(jlast(2))=max(pt2ijcl(jlast(2)),pt2ijcl(jfirst(2)))
620
c Set renormalization scale to geom. aver. of central scales
621
c if both beams are qcd
622
if(scale.eq.0d0) then
623
if(jcentral(1).gt.0.and.jcentral(2).gt.0) then
624
scale=(pt2ijcl(jcentral(1))*pt2ijcl(jcentral(2)))**0.25d0
625
elseif(jcentral(1).gt.0) then
626
scale=sqrt(pt2ijcl(jcentral(1)))
627
elseif(jcentral(2).gt.0) then
628
scale=sqrt(pt2ijcl(jcentral(2)))
630
scale=sqrt(pt2ijcl(nexternal-2))
632
scale = scalefact*scale
634
$ G = SQRT(4d0*PI*ALPHAS(scale))
637
$ write(*,*) 'Set ren scale to ',scale
639
if(ickkw.gt.0.and.q2fact(1).gt.0) then
640
c Use the fixed or previously set scale for central scale
641
if(jcentral(1).gt.0) pt2ijcl(jcentral(1))=q2fact(1)
642
if(jcentral(2).gt.0.and.jcentral(2).ne.jcentral(1))
643
$ pt2ijcl(jcentral(2))=q2fact(2)
646
if(nexternal.eq.3.and.nincoming.eq.2.and.q2fact(1).eq.0) then
647
q2fact(1)=pt2ijcl(nexternal-2)
648
q2fact(2)=pt2ijcl(nexternal-2)
651
if(q2fact(1).eq.0d0) then
652
c Use the geom. average of central scale and first non-radiation vertex
653
if(jlast(1).gt.0) q2fact(1)=sqrt(pt2ijcl(jlast(1))*pt2ijcl(jcentral(1)))
654
if(jlast(2).gt.0) q2fact(2)=sqrt(pt2ijcl(jlast(2))*pt2ijcl(jcentral(2)))
655
if(jcentral(1).gt.0.and.jcentral(1).eq.jcentral(2))then
656
c We have a qcd line going through the whole event, use single scale
657
q2fact(1)=max(q2fact(1),q2fact(2))
661
if(.not. fixed_fac_scale) then
662
q2fact(1)=scalefact**2*q2fact(1)
663
q2fact(2)=scalefact**2*q2fact(2)
667
$ write(*,*) 'Set central fact scales to ',sqrt(q2bck(1)),sqrt(q2bck(2))
670
if(jcentral(1).eq.0.and.jcentral(2).eq.0)then
671
if(q2fact(1).gt.0)then
672
pt2ijcl(nexternal-2)=q2fact(1)
673
pt2ijcl(nexternal-3)=q2fact(1)
675
q2fact(1)=pt2ijcl(nexternal-2)
678
elseif(ickkw.eq.2.or.pdfwgt)then
679
c Use the minimum scale found for fact scale in ME
680
if(jlast(1).gt.0.and.jfirst(1).lt.jlast(1))
681
$ q2fact(1)=min(pt2ijcl(jfirst(1)),q2fact(1))
682
if(jlast(2).gt.0.and.jfirst(2).lt.jlast(2))
683
$ q2fact(2)=min(pt2ijcl(jfirst(2)),q2fact(2))
686
c Check that factorization scale is >= 2 GeV
687
if(lpp(1).ne.0.and.q2fact(1).lt.4d0.or.
688
$ lpp(2).ne.0.and.q2fact(2).lt.4d0)then
689
if(nwarning.le.10) then
691
write(*,*) 'Warning: Too low fact scales: ',
692
$ sqrt(q2fact(1)), sqrt(q2fact(2))
694
if(nwarning.eq.11) then
696
write(*,*) 'No more warnings written out this run.'
704
$ write(*,*) 'Set fact scales to ',sqrt(q2fact(1)),sqrt(q2fact(2))
708
double precision function rewgt(p)
709
c**************************************************
710
c reweight the hard me according to ckkw
711
c employing the information in common/cl_val/
712
c**************************************************
715
include 'message.inc'
717
include 'maxconfigs.inc'
718
include 'nexternal.inc'
719
include 'maxamps.inc'
720
include 'cluster.inc'
726
DOUBLE PRECISION P(0:3,NEXTERNAL)
729
C Present process number
730
INTEGER IMIRROR,IPROC
731
COMMON/TO_MIRROR/IMIRROR, IPROC
733
COMMON /SubProc/ IPSEL
734
INTEGER SUBDIAG(MAXSPROC),IB(2)
735
COMMON/TO_SUB_DIAG/SUBDIAG,IB
737
c q2bck holds the central q2fact scales
739
common /to_q2bck/q2bck
740
double precision stot,m1,m2
741
common/to_stot/stot,m1,m2
744
integer i, j, idi, idj
746
parameter( PI = 3.14159265358979323846d0 )
748
integer mapconfig(0:lmaxconfigs), this_config
749
integer iforest(2,-max_branch:-1,lmaxconfigs)
750
integer sprop(maxsproc,-max_branch:-1,lmaxconfigs)
751
integer tprid(-max_branch:-1,lmaxconfigs)
752
include 'configs.inc'
753
real*8 xptj,xptb,xpta,xptl,xmtc
754
real*8 xetamin,xqcut,deltaeta
755
common /to_specxpt/xptj,xptb,xpta,xptl,xmtc,xetamin,xqcut,deltaeta
756
double precision asref, pt2prev(n_max_cl),pt2pdf(n_max_cl),pt2min
757
integer n, ibeam(2), iqcd(0:2)!, ilast(0:nexternal)
758
integer idfl, idmap(-nexternal:nexternal)
759
c ipart gives external particle number chain
760
integer ipart(2,n_max_cl)
761
double precision xnow(2)
762
double precision xtarget,tmp,pdfj1,pdfj2,q2now,etot
767
logical isqcd,isjet,isparton,isjetvx,ispartonvx
768
double precision alphas,getissud,pdg2pdf, sudwgt
770
external isqcd,isjet,isparton,ispartonvx
771
external alphas, isjetvx, getissud, pdg2pdf, xran1, sudwgt
776
if(ickkw.le.0) return
778
c Set mimimum kt scale, depending on highest mult or not
779
if(hmult.or.ickkw.eq.1)then
785
$ write(*,*) 'pt2min set to ',pt2min
787
c Set etot, used for non-radiating partons
790
c Since we use pdf reweighting, need to know particle identities
791
if (btest(mlevel,1)) then
792
write(*,*) 'Set process number ',ipsel
795
c Preparing graph particle information (ipart, needed to keep track of
796
c external particle clustering scales)
798
c ilast(i)=ishft(1,i)
799
pt2prev(ishft(1,i-1))=0d0
802
pt2prev(ishft(1,i-1))=
803
$ max(pt2min,p(0,i)**2-p(1,i)**2-p(2,i)**2-p(3,i)**2)
805
pt2pdf(ishft(1,i-1))=pt2prev(ishft(1,i-1))
807
pt2pdf(ishft(1,i-1))=0d0
809
ptclus(i)=sqrt(pt2prev(ishft(1,i-1)))
811
$ write(*,*) 'Set ptclus for ',i,' to ', ptclus(i)
812
ipart(1,ishft(1,i-1))=i
813
ipart(2,ishft(1,i-1))=0
815
$ write(*,*) 'Set ipart for ',ishft(1,i-1),' to ',
816
$ ipart(1,ishft(1,i-1)),ipart(2,ishft(1,i-1))
821
if (btest(mlevel,1)) then
822
write(*,*)'rewgt: identified tree {'
824
write(*,*)' ',i,': ',idacl(i,1),'(',ipdgcl(idacl(i,1),igraphs(1),iproc),')',
825
$ '&',idacl(i,2),'(',ipdgcl(idacl(i,2),igraphs(1),iproc),')',
826
$ ' -> ',imocl(i),'(',ipdgcl(imocl(i),igraphs(1),iproc),')',
827
$ ', ptij = ',dsqrt(pt2ijcl(i))
829
write(*,*)' graphs (',igraphs(0),'):',(igraphs(i),i=1,igraphs(0))
832
c Set x values for the two sides, for IS Sudakovs
836
if(btest(mlevel,3))then
837
write(*,*) 'Set x values to ',xnow(1),xnow(2)
840
c Prepare for resetting q2fact based on PDF reweighting
846
c Set strong coupling used
850
c Perform alpha_s reweighting based on type of vertex
852
c scale for alpha_s reweighting
854
if(n.eq.nexternal-2) then
857
if (btest(mlevel,3)) then
858
write(*,*)' ',n,': ',idacl(n,1),'(',ipdgcl(idacl(n,1),igraphs(1),iproc),
859
& ')&',idacl(n,2),'(',ipdgcl(idacl(n,2),igraphs(1),iproc),
860
& ') -> ',imocl(n),'(',ipdgcl(imocl(n),igraphs(1),iproc),
861
& '), ptij = ',dsqrt(q2now)
863
c perform alpha_s reweighting only for vertices where a parton is produced
864
c and not for the last clustering (use non-fixed ren. scale for these)
865
if (n.lt.nexternal-2)then
866
if(ispartonvx(imocl(n),idacl(n,1),idacl(n,2),
867
$ ipdgcl(1,igraphs(1),iproc),ipart,.false.)) then
869
rewgt=rewgt*alphas(alpsfact*sqrt(q2now))/asref
870
if (btest(mlevel,3)) then
871
write(*,*)' reweight vertex: ',ipdgcl(imocl(n),igraphs(1),iproc),
872
$ ipdgcl(idacl(n,1),igraphs(1),iproc),ipdgcl(idacl(n,2),igraphs(1),iproc)
873
write(*,*)' as: ',alphas(alpsfact*dsqrt(q2now)),
874
& '/',asref,' -> ',alphas(alpsfact*dsqrt(q2now))/asref
875
write(*,*)' and G=',SQRT(4d0*PI*ALPHAS(scale))
879
c Update starting values for FS parton showering
882
if(ipart(j,idacl(n,i)).gt.0.and.ipart(j,idacl(n,i)).gt.2)then
883
ptclus(ipart(j,idacl(n,i)))=
884
$ max(ptclus(ipart(j,idacl(n,i))),dsqrt(pt2ijcl(n)))
886
$ (.not.isqcd(ipdgcl(imocl(n),igraphs(1),iproc)).or.
887
$ ipart(1,idacl(n,3-i)).le.2.and.
888
$ .not.isqcd(ipdgcl(idacl(n,3-i),igraphs(1),iproc)).or.
889
$ isbw(imocl(n))))then
890
c For particles originating in non-qcd t-channel vertices or decay vertices,
891
c set origination scale to machine energy since we don't want these
892
c to be included in matching.
893
ptclus(ipart(j,idacl(n,i)))=etot
896
$ write(*,*) 'Set ptclus for ',ipart(j,idacl(n,i)),
897
$ ' to ', ptclus(ipart(j,idacl(n,i))),
898
$ ipdgcl(imocl(n),igraphs(1),iproc),
899
$ isqcd(ipdgcl(imocl(n),igraphs(1),iproc)),isbw(imocl(n))
903
c Special case for last 1,2->i vertex
904
if(n.eq.nexternal-2)then
905
ptclus(ipart(1,imocl(n)))=
906
$ max(ptclus(ipart(1,imocl(n))),dsqrt(pt2ijcl(n)))
908
$ (.not.isqcd(ipdgcl(idacl(n,1),igraphs(1),iproc)).or.
909
$ .not.isqcd(ipdgcl(idacl(n,2),igraphs(1),iproc))))then
910
c For particles originating in non-qcd vertices or decay vertices,
911
c set origination scale to machine energy since we don't want these
912
c to be included in matching.
913
ptclus(ipart(1,imocl(n)))=etot
916
$ write(*,*) 'Set ptclus for ',ipart(1,imocl(n)),
917
$ ' to ', ptclus(ipart(1,imocl(n))),
918
$ ipdgcl(idacl(n,1),igraphs(1),iproc),
919
$ ipdgcl(idacl(n,2),igraphs(1),iproc)
921
c Update particle tree map
922
call ipartupdate(p,imocl(n),idacl(n,1),idacl(n,2),
923
$ ipdgcl(1,igraphs(1),iproc),ipart)
924
if(ickkw.eq.2.or.pdfwgt) then
925
c Perform PDF and, if ickkw=2, Sudakov reweighting
928
c write(*,*)'weight ',idacl(n,i),', ptij=',pt2prev(idacl(n,i))
929
if (isqcd(ipdgcl(idacl(n,i),igraphs(1),iproc))) then
930
if(ickkw.eq.2.and.pt2min.eq.0d0) then
933
$ write(*,*) 'pt2min set to ',pt2min
935
if(ickkw.eq.2.and.pt2prev(idacl(n,i)).eq.0d0)
936
$ pt2prev(idacl(n,i))=
937
$ max(pt2min,p(0,i)**2-p(1,i)**2-p(2,i)**2-p(3,i)**2)
939
if (isparton(ipdgcl(idacl(n,i),igraphs(1),iproc)).and
940
$ .idacl(n,i).eq.ibeam(j)) then
941
c is sudakov weight - calculate only once for each parton
942
c line where parton line ends with change of parton id or
943
c non-radiation vertex
946
c Perform Sudakov reweighting if ickkw=2
947
if(ickkw.eq.2.and.(ipdgcl(idacl(n,i),igraphs(1),iproc).ne.
948
$ ipdgcl(imocl(n),igraphs(1),iproc).or.
949
$ .not.isjetvx(imocl(n),idacl(n,1),idacl(n,2),
950
$ ipdgcl(1,igraphs(1),iproc),ipart,n.eq.nexternal-2)).and.
951
$ pt2prev(idacl(n,i)).lt.pt2ijcl(n))then
952
tmp=min(1d0,max(getissud(ibeam(j),ipdgcl(idacl(n,i),
953
$ igraphs(1),iproc),xnow(j),xnow(3-j),pt2ijcl(n)),1d-20)/
954
$ max(getissud(ibeam(j),ipdgcl(idacl(n,i),
955
$ igraphs(1),iproc),xnow(j),xnow(3-j),pt2prev(idacl(n,i))),1d-20))
957
pt2prev(imocl(n))=pt2ijcl(n)
958
if (btest(mlevel,3)) then
959
write(*,*)' reweight line: ',ipdgcl(idacl(n,i),igraphs(1),iproc), idacl(n,i)
960
write(*,*)' pt2prev, pt2new, x1, x2: ',pt2prev(idacl(n,i)),pt2ijcl(n),xnow(j),xnow(3-j)
961
write(*,*)' Sud: ',tmp
962
write(*,*)' -> rewgt: ',rewgt
964
else if(ickkw.eq.2) then
965
pt2prev(imocl(n))=pt2prev(idacl(n,i))
967
c End Sudakov reweighting when we reach a non-radiation vertex
968
if(ickkw.eq.2.and..not.
969
$ ispartonvx(imocl(n),idacl(n,1),idacl(n,2),
970
$ ipdgcl(1,igraphs(1),iproc),ipart,n.eq.nexternal-2)) then
971
pt2prev(imocl(n))=1d30
972
if (btest(mlevel,3)) then
973
write(*,*)' rewgt: ending reweighting for vx ',
974
$ idacl(n,1),idacl(n,2),imocl(n),
975
$ ' with ids ',ipdgcl(idacl(n,1),igraphs(1),iproc),
976
$ ipdgcl(idacl(n,2),igraphs(1),iproc),ipdgcl(imocl(n),igraphs(1),iproc)
980
c Total pdf weight is f1(x1,pt2E)*fj(x1*z,Q)/fj(x1*z,pt2E)
981
c f1(x1,pt2E) is given by DSIG, already set scale for that
982
if (zcl(n).gt.0d0.and.zcl(n).lt.1d0) then
983
xnow(j)=xnow(j)*zcl(n)
986
q2now=min(pt2ijcl(n), q2bck(j))
987
c Set PDF scale to central factorization scale
988
c if non-radiating vertex or last 2->2
989
if(.not.isjetvx(imocl(n),idacl(n,1),idacl(n,2),
990
$ ipdgcl(1,igraphs(1),iproc),ipart,n.eq.nexternal-2)) then
994
$ write(*,*)' set q2now for pdf to ',sqrt(q2now)
995
if(q2fact(j).eq.0d0.and.ickkw.eq.2)then
996
q2fact(j)=pt2min ! Starting scale for PS
997
pt2pdf(imocl(n))=q2now
999
$ write(*,*)' set fact scale ',j,
1000
$ ' for PS scale to: ',sqrt(q2fact(j))
1001
else if(pt2pdf(idacl(n,i)).eq.0d0)then
1002
pt2pdf(imocl(n))=q2now
1003
if (btest(mlevel,3))
1004
$ write(*,*)' set pt2pdf for ',imocl(n),
1005
$ ' to: ',sqrt(pt2pdf(imocl(n)))
1006
else if(pt2pdf(idacl(n,i)).lt.q2now
1007
$ .and.isjet(ipdgcl(idacl(n,i),igraphs(1),iproc))) then
1008
pdfj1=pdg2pdf(abs(lpp(IB(j))),ipdgcl(idacl(n,i),
1009
$ igraphs(1),iproc)*sign(1,lpp(IB(j))),
1010
$ xnow(j),sqrt(q2now))
1011
pdfj2=pdg2pdf(abs(lpp(IB(j))),ipdgcl(idacl(n,i),
1012
$ igraphs(1),iproc)*sign(1,lpp(IB(j))),
1013
$ xnow(j),sqrt(pt2pdf(idacl(n,i))))
1014
if(pdfj2.lt.1d-10)then
1015
c Scale too low for heavy quark
1017
if (btest(mlevel,3))
1018
$ write(*,*) 'Too low scale for quark pdf: ',
1019
$ sqrt(pt2pdf(idacl(n,i))),pdfj2,pdfj1
1022
rewgt=rewgt*pdfj1/pdfj2
1023
if (btest(mlevel,3)) then
1024
write(*,*)' reweight ',n,i,ipdgcl(idacl(n,i),igraphs(1),iproc),' by pdfs: '
1025
write(*,*)' x, ptprev, ptnew: ',xnow(j),
1026
$ sqrt(pt2pdf(idacl(n,i))),sqrt(q2now)
1027
write(*,*)' PDF: ',pdfj1,' / ',pdfj2
1028
write(*,*)' -> rewgt: ',rewgt
1029
c write(*,*)' (compare for glue: ',
1030
c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2pdf(idacl(n,i)))),' / ',
1031
c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2ijcl(n)))
1032
c write(*,*)' = ',pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2pdf(idacl(n,i))))/
1033
c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2ijcl(n)))
1034
c write(*,*)' -> ',pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2pdf(idacl(n,i))))/
1035
c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2ijcl(n)))*rewgt,' )'
1037
c Set scale for mother as this scale
1038
pt2pdf(imocl(n))=q2now
1039
else if(pt2pdf(idacl(n,i)).ge.q2now) then
1040
c If no reweighting, just copy daughter scale for mother
1041
pt2pdf(imocl(n))=pt2pdf(idacl(n,i))
1047
if(ickkw.eq.2.and.pt2prev(idacl(n,i)).lt.pt2ijcl(n).and.
1048
$ (isvx.or.ipdgcl(idacl(n,i),igraphs(1),iproc).ne.ipdgcl(imocl(n),igraphs(1),iproc).or.
1049
$ (ipdgcl(idacl(n,i),igraphs(1),iproc).ne.
1050
$ ipdgcl(idacl(n,3-i),igraphs(1),iproc).and.
1051
$ pt2prev(idacl(n,i)).gt.pt2prev(idacl(n,3-i))))) then
1052
tmp=sudwgt(sqrt(pt2min),sqrt(pt2prev(idacl(n,i))),
1053
& dsqrt(pt2ijcl(n)),ipdgcl(idacl(n,i),igraphs(1),iproc),1)
1055
if (btest(mlevel,3)) then
1056
write(*,*)' reweight fs line: ',ipdgcl(idacl(n,i),igraphs(1),iproc), idacl(n,i)
1057
write(*,*)' pt2prev, pt2new: ',pt2prev(idacl(n,i)),pt2ijcl(n)
1058
write(*,*)' Sud: ',tmp
1059
write(*,*)' -> rewgt: ',rewgt
1061
pt2prev(imocl(n))=pt2ijcl(n)
1063
pt2prev(imocl(n))=pt2prev(idacl(n,i))
1068
if (ickkw.eq.2.and.n.eq.nexternal-2.and.isqcd(ipdgcl(imocl(n),igraphs(1),iproc)).and.
1069
$ pt2prev(imocl(n)).lt.pt2ijcl(n)) then
1070
tmp=sudwgt(sqrt(pt2min),sqrt(pt2prev(imocl(n))),
1071
& dsqrt(pt2ijcl(n)),ipdgcl(imocl(n),igraphs(1),iproc),1)
1073
if (btest(mlevel,3)) then
1074
write(*,*)' reweight last fs line: ',ipdgcl(imocl(n),igraphs(1),iproc), imocl(n)
1075
write(*,*)' pt2prev, pt2new: ',pt2prev(imocl(n)),pt2ijcl(n)
1076
write(*,*)' Sud: ',tmp
1077
write(*,*)' -> rewgt: ',rewgt
1083
if(ickkw.eq.2.and.lpp(1).eq.0.and.lpp(2).eq.0)then
1086
else if (ickkw.eq.1.and.pdfwgt) then
1089
if (btest(mlevel,3))
1090
$ write(*,*)' set fact scales for PS to ',
1091
$ sqrt(q2fact(1)),sqrt(q2fact(2))
1094
if (btest(mlevel,3)) then
1095
write(*,*)'} -> w = ',rewgt