52
52
& ,nexternal-1),p_ev_red1(0:3,nexternal-1)
53
53
integer ninvar, ndim, minconfig, maxconfig
54
54
common/tosigint/ndim
55
integer ncall,itmax,nconfigs,ntry, ngraphs
55
integer ncall,itmax,nconfigs,ntry
56
56
integer icb(nexternal-1,maxswitch),jc(12),nswitch
57
double precision saveamp(maxamps)
57
double precision saveamp(ngraphs)
58
58
integer nmatch, ibase
64
Double Precision amp2(maxamps), jamp2(0:maxamps)
64
Double Precision amp2(ngraphs), jamp2(0:ncolor)
65
65
common/to_amps/ amp2, jamp2
66
66
include 'coupl.inc'
449
447
subroutine clear_events()
452
subroutine write_input(nconfigs)
453
c***************************************************************************
454
c Writes out input file for approximate calculation based on the
455
c number of active configurations
456
c***************************************************************************
462
include '../../Source/run_config.inc'
464
parameter (maxpara=1000)
465
c integer npoint_tot, npoint_min
466
c parameter (npoint_tot=50000, npoint_min=1000)
475
character*20 param(maxpara),value(maxpara)
481
call load_para(npara,param,value)
484
npoints = min_events_subprocess/nconfigs
485
npoints = max(npoints,min_events_channel)
486
open (unit=26, file = 'input_app.txt', status='unknown',
489
write(26,*) npoints_wu,itmax_wu,
490
& ' !Number of events and iterations'
491
write(26,'(f8.4,a)') acc_wu, ' !Accuracy'
492
write(26,*) ' 2 !Grid Adjustment 0=none'
494
write(26,*) npoints,iter_survey,
495
& ' !Number of events and iterations'
496
write(26,*) ' 0.0 !Accuracy'
497
write(26,*) ' 0 !Grid Adjustment 0=none'
499
write(26,*) ' 1 !Suppress Amplitude 1=yes'
500
write(26,*) nhel_survey,' !Helicity Sum/event 0=exact'
504
write(*,*) 'Error opening input_app.txt'
507
451
subroutine write_bash(mapconfig, use_config, pwidth, jcomp
555
499
do i=1,mapconfig(0)
556
500
if (use_config(i) .gt. 0) then
557
call bw_conflict(i,iforest(1,-max_branch,i),lconflict)
558
nbw=0 !Look for B.W. resonances
560
iarray(j)=0 !Assume no cuts on BW
563
if (pwidth(-j,i) .gt. 1d-20) then
565
write(*,*) 'Got bw',-nbw,j
566
if(lconflict(-j).or.gForceBW(-j,i)) then
567
if(lconflict(-j)) write(*,*) 'Got conflict ',-nbw,j
568
if(gForceBW(-j,i)) write(*,*) 'Got forced BW ',-nbw,j
569
iarray(nbw)=1 !Cuts on BW
570
if (nbw .gt. imax) then
571
write(*,*) 'Too many BW w conflicts',nbw,imax
578
do while (.not. done)
579
call enCode(icode,iarray,ibase,imax)
580
c write(*,*) 'mapping',ic,mapconfig(i)
581
c$$$ if (r_from_b(mapconfig(i)) .lt. 10) then
582
c$$$ write(26,'(i1$)') r_from_b(mapconfig(i))
583
c$$$ elseif (r_from_b(mapconfig(i)) .lt. 100) then
584
c$$$ write(26,'(i2$)') r_from_b(mapconfig(i))
585
c$$$ elseif (r_from_b(mapconfig(i)) .lt. 1000) then
586
c$$$ write(26,'(i3$)') r_from_b(mapconfig(i))
587
c$$$ elseif (r_from_b(mapconfig(i)) .lt. 10000) then
588
c$$$ write(26,'(i4$)') r_from_b(mapconfig(i))
589
if (mapconfig(i) .lt. 10) then
590
write(26,'(i1$)') mapconfig(i)
591
elseif (mapconfig(i) .lt. 100) then
592
write(26,'(i2$)') mapconfig(i)
593
elseif (mapconfig(i) .lt. 1000) then
594
write(26,'(i3$)') mapconfig(i)
595
elseif (mapconfig(i) .lt. 10000) then
596
write(26,'(i4$)') mapconfig(i)
598
if (icode .eq. 0) then
599
c write(26,'($a)') '.000'
600
elseif (icode .lt. 10) then
601
write(26,'(a,i1$)') '.00', icode
602
elseif (icode .lt. 100) then
603
write(26,'(a,i2$)') '.0', icode
604
elseif (icode .lt. 1000) then
605
write(26,'(a,i3$)') '.', icode
607
write(*,*) 'Error too many B.W. in symmetry.f',icode
611
call bw_increment_array(iarray,imax,ibase,gForceBW(-imax,i),done)
501
if (mapconfig(i) .lt. 10) then
502
write(26,'(i1$)') mapconfig(i)
503
elseif (mapconfig(i) .lt. 100) then
504
write(26,'(i2$)') mapconfig(i)
505
elseif (mapconfig(i) .lt. 1000) then
506
write(26,'(i3$)') mapconfig(i)
507
elseif (mapconfig(i) .lt. 10000) then
508
write(26,'(i4$)') mapconfig(i)
616
514
if (mapconfig(0) .gt. 9999) then
617
515
write(*,*) 'Only writing first 9999 jobs',mapconfig(0)
620
519
c Now write out the symmetry factors for each graph
622
521
open (unit=26, file = 'symfact.dat', status='unknown')
623
522
do i=1,mapconfig(0)
624
523
if (use_config(i) .gt. 0) then
626
c Need to write appropriate number of BW sets this is
627
c same thing as above for the bash file
629
call bw_conflict(i,iforest(1,-max_branch,i),lconflict)
630
nbw=0 !Look for B.W. resonances
631
if (jcomp .eq. 0 .or. jcomp .eq. 1 .or. .true.) then
633
iarray(j)=0 !Assume no cuts on BW
636
if (pwidth(-j,i) .gt. 1d-20) then
638
write(*,*) 'Got bw',nbw,j
639
if(lconflict(-j).or.gForceBW(-j,i)) then
640
iarray(nbw)=1 !Cuts on BW
641
if (nbw .gt. imax) then
642
write(*,*) 'Too many BW w conflicts',nbw,imax
649
do while (.not. done)
650
call enCode(icode,iarray,ibase,imax)
651
if (icode .gt. 0) then
652
write(26,'(f9.3,i6)') mapconfig(i)+real(icode)/1000.,
655
write(26,'(2i6)') mapconfig(i),use_config(i)
657
call bw_increment_array(iarray,imax,ibase,gForceBW(-imax,i),done)
524
write(26,'(2i6)') mapconfig(i),use_config(i)
660
526
write(26,'(2i6)') mapconfig(i),-mapconfig(-use_config(i))
666
subroutine BW_Conflict(iconfig,itree,lconflict)
667
c***************************************************************************
668
c Determines which BW conflict
669
c***************************************************************************
675
include 'nexternal.inc'
676
double precision zero
678
c include '../../Source/run_config.inc'
682
integer itree(2,-max_branch:-1),iconfig
683
logical lconflict(-max_branch:nexternal)
689
double precision pwidth(-max_branch:-1,lmaxconfigs) !Propagator width
690
double precision pmass(-max_branch:-1,lmaxconfigs) !Propagator mass
691
double precision pow(-max_branch:-1,lmaxconfigs) !Not used, in props.inc
692
double precision xmass(-max_branch:nexternal)
696
include 'coupl.inc' !Mass and width info
700
include 'born_props.inc' !Propagator mass and width information pmass,pwidth
701
write(*,*) 'Checking for BW ',iconfig
707
lconflict(-i) = .false.
710
c Start by determining which propagators are part of the same
711
c chain, or could potentially conflict
714
do while (i .lt. nexternal-3 .and. itree(1,-i) .ne. 1)
715
xmass(-i) = xmass(itree(1,-i))+xmass(itree(2,-i))
716
if (pwidth(-i,iconfig) .gt. 0d0) then
717
if (xmass(-i) .gt. pmass(-i,iconfig)) then !Can't be on shell
719
write(*,*) "Found Conflict", iconfig,i,
720
$ pmass(-i,iconfig),xmass(-i)
723
xmass(-i) = max(xmass(-i),pmass(-i,iconfig)+
724
& 3d0*pwidth(-i,iconfig))
728
c Mark all daughters of conflicted BW as conflicting
731
if (lconflict(-j)) then
732
lconflict(itree(1,-j)) = .true.
733
lconflict(itree(2,-j)) = .true.
734
write(*,*) 'Adding conflict ',itree(1,-j),itree(2,-j)
738
c Only include BW props as conflicting
741
if (lconflict(-j)) then
742
if (pwidth(-j,iconfig) .le. 0) then
743
lconflict(-j) = .false.
744
write(*,*) 'No conflict BW',iconfig,j
746
write(*,*) 'Conflicting BW',iconfig,j
756
subroutine bw_increment_array(iarray,imax,ibase,force,done)
757
c************************************************************************
759
c************************************************************************
764
integer imax !Input, number of elements in iarray
765
integer ibase !Base for incrementing, 0 is skipped
766
logical force(imax) !Force onshell BW, counting from -imax to -1
767
integer iarray(imax) !Output:Array of values being incremented
768
logical done !Output:Set when no more incrementing
785
do while (i .le. imax .and. .not. found)
786
if (iarray(i) .eq. 0) then !don't increment this
788
elseif (iarray(i) .lt. ibase-1 .and. .not. force(imax+1-i)) then
790
iarray(i)=iarray(i)+1