1
double precision function testamp(p)
2
c*****************************************************************************
3
c Approximates matrix element by propagators
4
c*****************************************************************************
10
include 'maxconfigs.inc'
11
include 'nexternal.inc'
13
parameter (zero = 0d0)
17
double precision p(0:3,nexternal)
22
double precision xp(0:3,-nexternal:nexternal)
23
double precision mpole(-nexternal:0),shat,tsgn
26
double precision prmass(-nexternal:0,lmaxconfigs)
27
double precision prwidth(-nexternal:0,lmaxconfigs)
28
integer pow(-nexternal:0,lmaxconfigs)
33
integer iforest(2,-max_branch:-1,lmaxconfigs)
34
common/to_forest/ iforest
35
integer mapconfig(0:lmaxconfigs), this_config
36
common/to_mconfigs/mapconfig, this_config
44
save prmass,prwidth,pow
45
data first_time /.true./
62
c shat = dot(p(0,1),p(0,2))/(1800)**2
63
shat = dot(p(0,1),p(0,2))/(10)**2
67
do i=-1,-(nexternal-3),-1 !Find all the propagotors
68
if (iforest(1,i,iconfig) .eq. 1) tsgn=-1d0
70
xp(j,i) = xp(j,iforest(1,i,iconfig))
71
$ +tsgn*xp(j,iforest(2,i,iconfig))
73
if (prwidth(i,iconfig) .ne. 0d0 .and. .false.) then
74
testamp=testamp/((dot(xp(0,i),xp(0,i))
75
$ -prmass(i,iconfig)**2)**2
76
$ -(prmass(i,iconfig)*prwidth(i,iconfig))**2)
78
testamp = testamp/((dot(xp(0,i),xp(0,i)) -
79
$ prmass(i,iconfig)**2)
82
testamp=testamp*shat**(pow(i,iconfig))
83
c write(*,*) i,iconfig,pow(i,iconfig),prmass(i,iconfig)
85
c testamp = 1d0/dot(xp(0,-1),xp(0,-1))
90
logical function cut_bw(p)
91
c*****************************************************************************
92
c Approximates matrix element by propagators
93
c*****************************************************************************
99
include 'maxconfigs.inc'
100
include 'nexternal.inc'
101
double precision zero
102
parameter (zero = 0d0)
107
double precision p(0:3,nexternal)
111
double precision xp(0:3,-nexternal:nexternal)
112
double precision mpole(-nexternal:0),shat,tsgn
113
integer i,j,iconfig,iproc
115
double precision prmass(-nexternal:0,lmaxconfigs)
116
double precision prwidth(-nexternal:0,lmaxconfigs)
117
integer pow(-nexternal:0,lmaxconfigs)
118
logical first_time, onshell
119
double precision xmass
122
integer ida(2),idenpart
126
include 'maxamps.inc'
127
integer iforest(2,-max_branch:-1,lmaxconfigs)
128
common/to_forest/ iforest
129
integer sprop(maxsproc,-max_branch:-1,lmaxconfigs)
130
integer tprid(-max_branch:-1,lmaxconfigs)
131
common/to_sprop/sprop,tprid
132
integer mapconfig(0:lmaxconfigs), this_config
133
common/to_mconfigs/mapconfig, this_config
135
integer lbw(0:nexternal) !Use of B.W.
138
logical OnBW(-nexternal:0) !Set if event is on B.W.
139
common/to_BWEvents/ OnBW
143
integer idup(nexternal,maxproc,maxsproc)
144
integer mothup(2,nexternal)
145
integer icolup(2,nexternal,maxflow,maxsproc)
146
include 'leshouche.inc'
148
integer gForceBW(-max_branch:-1,lmaxconfigs) ! Forced BW
149
include 'decayBW.inc'
155
save prmass,prwidth,pow
156
data first_time /.true./
160
cut_bw = .false. !Default is we passed the cut
161
iconfig = this_config
165
do i=-1,-(nexternal-3),-1
166
if (iforest(1,i,iconfig) .eq. 1 .or. prwidth(i,iconfig).le.0) then
170
if (lbw(nbw) .eq. 1) then
171
write(*,*) 'Requiring BW ',i,nbw
172
elseif(lbw(nbw) .eq. 2) then
173
write(*,*) 'Excluding BW ',i,nbw
175
write(*,*) 'No cut BW ',i,nbw
189
c Find non-zero process number
191
if(sprop(iproc,-1,iconfig).ne.0) goto 10
194
c If no non-zero sprop, set iproc to 1
195
if(iproc.gt.maxsproc) iproc=1
196
c Start loop over propagators
197
do i=-1,-(nexternal-3),-1
199
if (iforest(1,i,iconfig) .eq. 1) tsgn=-1d0
201
xp(j,i) = xp(j,iforest(1,i,iconfig))
202
$ +tsgn*xp(j,iforest(2,i,iconfig))
204
if (tsgn .lt. 0d0) cycle
205
if (prwidth(i,iconfig) .gt. 0d0 ) then !This is B.W.
207
c write(*,*) 'Checking BW',nbw
208
xmass = sqrt(dot(xp(0,i),xp(0,i)))
209
c write(*,*) 'xmass',xmass,prmass(i,iconfig)
211
c Here we set if the BW is "on-shell" for LesHouches
213
onshell = (abs(xmass - prmass(i,iconfig)) .lt.
214
$ bwcutoff*prwidth(i,iconfig))
216
c Remove on-shell forbidden s-channels (gForceBW=2) (JA 2/10/11)
217
if(gForceBW(i,iconfig).eq.2) then
221
c Only allow OnBW if no "decay" to identical particle
225
ida(j)=iforest(j,i,iconfig)
227
if(sprop(iproc,i,iconfig).eq.sprop(iproc,ida(j),iconfig))
229
elseif (ida(j).gt.0) then
230
if(sprop(iproc,i,iconfig).eq.IDUP(ida(j),1,iproc))
234
c Always remove if daughter final-state
235
if(idenpart.gt.0) then
237
c Else remove if daughter forced to be onshell
238
elseif(idenpart.lt.0)then
239
if(gForceBW(idenpart, iconfig).eq.1) then
241
c Else remove daughter if forced to be onshell
242
elseif(gForceBW(i, iconfig).eq.1) then
243
OnBW(idenpart)=.false.
244
c Else remove either this resonance or daughter, which is closer to mass shell
245
elseif(abs(xmass-prmass(i,iconfig)).gt.
246
$ abs(sqrt(dot(xp(0,idenpart),xp(0,idenpart)))-
247
$ prmass(i,iconfig))) then
249
c Else remove OnBW for daughter
251
OnBW(idenpart)=.false.
254
else if (gForceBW(i, iconfig).eq.1) then ! .not. onshell
255
c Check if we are supposed to cut forced bw (JA 4/8/11)
257
c write(*,*) 'cut_bw: ',i,gForceBW(i,iconfig),OnBW(i),cut_bw
261
c Here we set onshell for phase space integration (JA 4/8/11)
263
onshell = (abs(xmass - prmass(i,iconfig)) .lt.
264
$ 5d0*prwidth(i,iconfig))
266
if (onshell .and. (lbw(nbw).eq. 2) .or.
267
$ .not. onshell .and. (lbw(nbw).eq. 1)) then
269
c write(*,*) 'cut_bw: ',nbw,xmass,onshell,lbw(nbw),cut_bw
273
c write(*,*) 'final cut_bw: ',nbw,lbw(nbw),xmass,onshell,OnBW(i),cut_bw
279
c*****************************************************************************
280
c Attempts to determine peaks for this configuration
281
c*****************************************************************************
287
include 'maxconfigs.inc'
288
include 'nexternal.inc'
289
include 'maxamps.inc'
290
double precision zero
291
parameter (zero = 0d0)
298
double precision xm(-nexternal:nexternal)
299
double precision xe(-nexternal:nexternal)
300
double precision tsgn, xo, a
301
double precision x1,x2,xk(nexternal)
302
double precision dr,mtot,etot,xqfact
303
double precision spmass
304
integer i, iconfig, l1, l2, j, nt, nbw, iproc
305
integer iden_part(-nexternal+1:nexternal)
307
double precision prmass(-nexternal:0,lmaxconfigs)
308
double precision prwidth(-nexternal:0,lmaxconfigs)
309
integer pow(-nexternal:0,lmaxconfigs)
311
integer idup(nexternal,maxproc,maxsproc)
312
integer mothup(2,nexternal)
313
integer icolup(2,nexternal,maxflow,maxsproc)
314
include 'leshouche.inc'
316
integer gForceBW(-max_branch:-1,lmaxconfigs) ! Forced BW
317
include 'decayBW.inc'
322
integer iforest(2,-max_branch:-1,lmaxconfigs)
323
common/to_forest/ iforest
325
integer sprop(maxsproc,-max_branch:-1,lmaxconfigs)
326
integer tprid(-max_branch:-1,lmaxconfigs)
327
common/to_sprop/sprop,tprid
329
integer mapconfig(0:lmaxconfigs), this_config
330
common/to_mconfigs/mapconfig, this_config
332
real*8 emass(nexternal)
337
double precision etmin(nincoming+1:nexternal),etamax(nincoming+1:nexternal)
338
double precision emin(nincoming+1:nexternal)
339
double precision r2min(nincoming+1:nexternal,nincoming+1:nexternal)
340
double precision s_min(nexternal,nexternal)
341
common/to_cuts/ etmin, emin, etamax, r2min, s_min
343
double precision xqcutij(nexternal,nexternal),xqcuti(nexternal)
344
common/to_xqcuts/xqcutij,xqcuti
346
double precision spole(maxinvar),swidth(maxinvar),bwjac
347
common/to_brietwigner/spole ,swidth ,bwjac
349
integer lbw(0:nexternal) !Use of B.W.
352
double precision stot,m1,m2
353
common/to_stot/stot,m1,m2
367
iconfig = this_config
369
etot = 0d0 !Total energy needed
370
spmass = 0d0 !Keep track of BW masses for shat
372
if(ickkw.eq.2.or.ktscheme.eq.2) xqfact=0.3d0
373
do i=nincoming+1,nexternal !assumes 2 incoming
376
xe(i)=max(emass(i),max(etmin(i),0d0))
377
xe(i)=max(xe(i),max(emin(i),0d0))
378
c-JA 1/2009: Set grid also based on xqcut
379
xe(i)=max(xe(i),xqfact*xqcuti(i))
392
c Find non-zero process number
394
if(sprop(iproc,-1,iconfig).ne.0) goto 10
397
c If no non-zero sprop, set iproc to 1
398
if(iproc.ge.maxsproc.and.sprop(maxsproc,-1,iconfig).eq.0)
401
c Look for identical particles to map radiation processes
402
call idenparts(iden_part, iforest(1,-max_branch,iconfig),
403
$ sprop(1,-max_branch,iconfig), gForceBW(-max_branch,iconfig),
404
$ prwidth(-nexternal,iconfig))
406
c Start loop over propagators
407
do i=-1,-(nexternal-3),-1
408
if (iforest(1,i,iconfig) .eq. 1) tsgn=-1d0
409
if (tsgn .eq. 1d0) then !s channel
410
xm(i) = xm(iforest(1,i,iconfig))+xm(iforest(2,i,iconfig))
411
xe(i) = xe(iforest(1,i,iconfig))+xe(iforest(2,i,iconfig))
414
if (iforest(1,i,iconfig) .gt. 0
415
& .and. iforest(2,i,iconfig) .gt. 0) then
416
c-JA 1/2009: Set deltaR cuts here together with s_min cuts
417
l1 = iforest(1,i,iconfig)
418
l2 = iforest(2,i,iconfig)
419
xm(i)=max(xm(i),sqrt(max(s_min(l1,l2),0d0)))
420
dr = max(r2min(l1,l2)*dabs(r2min(l1,l2)),0d0)*0.8d0
422
& sqrt(max(etmin(l2),0d0)*max(etmin(l1),0d0)*dr))
423
c-JA 1/2009: Set grid also based on xqcut
424
xm(i)=max(xm(i),max(xqcutij(l1,l2),0d0))
426
c write(*,*) 'iconfig,i',iconfig,i
427
c write(*,*) prwidth(i,iconfig),prmass(i,iconfig)
428
if (prwidth(i,iconfig) .gt. 0 ) then
430
c JA 6/8/2011 Set xe(i) for resonances
431
if (lbw(nbw).eq.1) then
432
xm(i) = max(xm(i), prmass(i,iconfig)-5d0*prwidth(i,iconfig))
433
else if (gforcebw(i,iconfig).eq.1) then
434
xm(i) = max(xm(i), prmass(i,iconfig)-bwcutoff*prwidth(i,iconfig))
437
xe(i)=max(xe(i),xm(i))
438
c Check for impossible onshell configurations
439
c Either: required onshell and daughter masses too large
440
c Or: forced and daughter masses too large
441
c Or: required offshell and forced, with bwcutoff.le.5
442
if(prwidth(i,iconfig) .gt. 0.and.
443
$ (lbw(nbw).eq.1.and.
444
$ (prmass(i,iconfig)+5d0*prwidth(i,iconfig).lt.xm(i)
445
$ .or.prmass(i,iconfig)-5d0*prwidth(i,iconfig).gt.stot)
446
$ .or.gforcebw(i,iconfig).eq.1.and.
447
$ prmass(i,iconfig)+bwcutoff*prwidth(i,iconfig).lt.xm(i)
448
$ .or.lbw(nbw).eq.2.and.gforcebw(i,iconfig).eq.1 .and.
451
c Write results.dat and quit
452
call write_null_results()
455
if (prwidth(i,iconfig) .gt. 0 .and. lbw(nbw) .le. 1) then !B.W.
456
if (i .eq. -(nexternal-(nincoming+1))) then !This is s-hat
457
j = 3*(nexternal-2)-4+1 !set i to ndim+1
459
c tjs 11/2008 if require BW then force even if worried about energy
460
c JA 8/2011 don't use BW if mass is > CM energy
462
if(prmass(i,iconfig).ge.xm(i).and.iden_part(i).eq.0.and.
463
$ prmass(i,iconfig).lt.sqrt(stot)
464
$ .or. lbw(nbw).eq.1) then
465
write(*,*) 'Setting PDF BW',j,nbw,prmass(i,iconfig)
466
spole(j)=prmass(i,iconfig)*prmass(i,iconfig)/stot
467
swidth(j) = prwidth(i,iconfig)*prmass(i,iconfig)/stot
469
else if((prmass(i,iconfig)+5d0*prwidth(i,iconfig)).ge.xm(i)
470
$ .and. iden_part(i).eq.0 .or. lbw(nbw).eq.1) then
471
c JA 02/13 Only allow BW if xm below M+5*Gamma
472
write(*,*) 'Setting BW',i,nbw,prmass(i,iconfig)
473
spole(-i)=prmass(i,iconfig)*prmass(i,iconfig)/stot
474
swidth(-i) = prwidth(i,iconfig)*prmass(i,iconfig)/stot
476
c JA 4/1/2011 Set grid in case there is no BW (radiation process)
477
if (swidth(-i) .eq. 0d0 .and.
478
$ i.ne.-(nexternal-(nincoming+1)))then
479
a=prmass(i,iconfig)**2/stot
480
xo = min(xm(i)**2/stot, 1-1d-8)
481
if (xo.eq.0d0) xo=1d0/stot
482
call setgrid(-i,xo,a,1)
485
if (swidth(-i) .ne. 0d0)
486
$ spmass=spmass-xm(i) +
487
$ max(xm(i),prmass(i,iconfig)-5d0*prwidth(i,iconfig))
489
a=prmass(i,iconfig)**2/stot
490
c JA 4/1/2011 always set grid
491
xo = min(xm(i)**2/stot, 1-1d-8)
492
if (xo.eq.0d0) xo=1d0/stot
493
c if (prwidth(i, iconfig) .eq. 0d0.or.iden_part(i).gt.0) then
494
call setgrid(-i,xo,a,1)
496
c write(*,*) 'Using flat grid for BW',i,nbw,
497
c $ prmass(i,iconfig)
502
c write(*,*) 'New mtot',i,mtot,xm(i)
505
c Check closest to p1
508
l2 = iforest(2,i,iconfig) !need dr cut
511
c-JA 1/2009: Set grid also based on xqcut
512
if (l2 .gt. 0) x1 = max(etmin(l2),max(xqfact*xqcuti(l2),0d0))
513
x1 = max(x1, xe(l2)/1d0)
514
if (nt .gt. 1) x1 = max(x1,xk(nt-1))
516
c write(*,*) 'Using 1',l2,x1
519
c Check closest to p2
522
l2 = iforest(2,j,iconfig)
524
c-JA 1/2009: Set grid also based on xqcut
525
if (l2 .gt. 0) x2 = max(etmin(l2),max(xqfact*xqcuti(l2),0d0))
526
c if (l2 .gt. 0) x2 = max(etmin(l2),0d0)
527
x2 = max(x2, xe(l2)/1d0)
528
c if (nt .gt. 1) x2 = max(x2,xk(nt-1))
530
c write(*,*) 'Using 2',l2,x2
534
c Use 1/10000 of sqrt(s) as minimum, to always get integration
538
write(*,*) 'Warning: No cutoff for shat integral found'
539
write(*,*) ' Minimum set to ', xo
541
a=-prmass(i,iconfig)**2/stot
542
c call setgrid(-i,xo,a,pow(i,iconfig))
544
c write(*,*) 'Enter minimum for ',-i, xo
546
if (i .ne. -1 .or. .true.) call setgrid(-i,xo,a,1)
549
c Perform setting for shat (PDF BW or 1/s)
550
if (abs(lpp(1)) .eq. 1 .or. abs(lpp(2)) .eq. 1) then
551
c Set minimum based on: 1) required energy 2) resonances 3) 1/10000 of sqrt(s)
552
i = 3*(nexternal-2) - 4 + 1
553
xo = max(min(etot**2/stot, 1d0-1d-8),1d0/stot)
554
c Take into account special cuts
555
xo = max(xo, xptj*dabs(xptj)/stot)
556
xo = max(xo, xptb*dabs(xptb)/stot)
557
xo = max(xo, xpta*dabs(xpta)/stot)
558
xo = max(xo, xptl*dabs(xptl)/stot)
559
xo = max(xo, xmtc*dabs(xmtc)/stot)
560
xo = max(xo, htjmin**2/stot)
561
xo = max(xo, ptj1min**2/stot)
562
xo = max(xo, (2*ptj2min)**2/stot)
563
xo = max(xo, (3*ptj3min)**2/stot)
564
xo = max(xo, (4*ptj4min)**2/stot)
565
xo = max(xo, ht2min**2/stot)
566
xo = max(xo, ht3min**2/stot)
567
xo = max(xo, ht4min**2/stot)
568
xo = max(xo, misset**2/stot)
569
xo = max(xo, ptllmin**2/stot)
570
xo = max(xo, ptl1min**2/stot)
571
xo = max(xo, (2*ptl2min)**2/stot)
572
xo = max(xo, (3*ptl3min)**2/stot)
573
xo = max(xo, (4*ptl4min)**2/stot)
574
xo = max(xo, mmnl**2/stot)
575
c Include mass scale from BWs
576
xo = max(xo, spmass**2/stot)
577
if (swidth(i).eq.0.and.xo.eq.1d0/stot) then
578
write(*,*) 'Warning: No minimum found for integration'
579
write(*,*) ' Setting minimum to ',1d0/stot
581
c-----------------------
582
c tjs 4/29/2008 use analytic transform for s-hat
583
c-----------------------
584
if (swidth(i) .eq. 0d0) then
586
spole(i)= -2.0d0 ! 1/s pole
587
write(*,*) "Transforming s_hat 1/s ",i,xo
589
write(*,*) "Transforming s_hat BW ",spole(i),swidth(i)
594
c write(*,*) 'Enter minimum for ',-i, xo
596
c if (xo .gt. 0) call setgrid(-i,xo,a,1)
599
c write(*,*) 'Enter minimum for ',-i, xo
601
c if (xo .gt. 0) call setgrid(-i,xo,a,1)
605
subroutine write_null_results()
608
write(*,*),'Impossible BW configuration'
609
open(unit=66,file='results.dat',status='unknown')
610
write(66,'(3e12.5,2i9,i5,i9,3e10.3)')0.,0.,0.,0,0,1,0,0.,0.,0.
611
write(66,'(i4,5e15.5)') 1,0.,0.,0.,0.,0.