~maddevelopers/mg5amcnlo/Born_smearing

« back to all changes in this revision

Viewing changes to Template/NLO/SubProcesses/fks_singular.f

  • Committer: Rikkert Frederix
  • Date: 2021-03-30 06:21:42 UTC
  • Revision ID: frederix@physik.uzh.ch-20210330062142-rh9fj9d1mogmqqml
Born smearing in y_ij_fks_ev alone. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
2729
2729
      include 'nFKSconfigs.inc'
2730
2730
      include 'fks_info.inc'
2731
2731
      include 'timing_variables.inc'
 
2732
      double precision xi_i_fks_ev,y_ij_fks_ev
 
2733
      double precision p_i_fks_ev(0:3),p_i_fks_cnt(0:3,-2:2)
 
2734
      common/fksvariables/xi_i_fks_ev,y_ij_fks_ev,p_i_fks_ev,p_i_fks_cnt
2732
2735
      integer i,j,ii,jj,i_soft
2733
2736
      logical momenta_equal,pdg_equal,equal,found_S
2734
2737
      external momenta_equal,pdg_equal
2735
2738
      integer iproc_save(fks_configs),eto(maxproc,fks_configs),
2736
2739
     &     etoi(maxproc,fks_configs),maxproc_found
2737
2740
      common/cproc_combination/iproc_save,eto,etoi,maxproc_found
 
2741
      double precision bornsmear_weight
 
2742
      external bornsmear_weight
2738
2743
      call cpu_time(tBefore)
2739
2744
      if (icontr.eq.0) return
2740
2745
c Find the contribution to sum all the S-event ones. This should be one
2762
2767
c to which contribution we can sum the current contribution (if any),
2763
2768
c while for the S-events we can sum it to the 'i_soft' one.
2764
2769
      do i=1,icontr
 
2770
         if (itype(i).eq.2 .and. imode.eq.1) then
 
2771
            wgts(1,i)=wgts(1,i)*BornSmear_weight(xi_i_fks_ev
 
2772
     $           ,y_ij_fks_ev)
 
2773
            do j=1,niproc(i)
 
2774
               parton_iproc(j,i)= parton_iproc(j,i)*
 
2775
     $              BornSmear_weight(xi_i_fks_ev,y_ij_fks_ev)
 
2776
            enddo
 
2777
c$$$            write (*,*) xi_i_fks_ev,y_ij_fks_ev,bornsmear_weight(xi_i_fks_ev,y_ij_fks_ev)
 
2778
         endif
 
2779
      enddo
 
2780
 
 
2781
      do i=1,icontr
2765
2782
         do j=1,niproc(i)
2766
2783
            unwgt(j,i)=0d0
 
2784
            unwgt_noB(j,i)=0d0
 
2785
            unwgt_B(j,i)=0d0
2767
2786
         enddo
2768
2787
         icontr_sum(0,i)=0
2769
2788
         if (H_event(i)) then
2806
2825
c include it here!
2807
2826
                     if (itype(i).eq.14 .and. imode.eq.1 .and. .not.
2808
2827
     $                    only_virt) exit
2809
 
                     unwgt(j,i_soft)=unwgt(j,i_soft)+parton_iproc(jj,i)
 
2828
                     unwgt(j,i_soft)=unwgt(j,i_soft)+ parton_iproc(jj,i)
 
2829
                     if (itype(i).ne.2) then
 
2830
                        unwgt_noB(j,i_soft)=unwgt_noB(j,i_soft)
 
2831
     $                       +parton_iproc(jj,i)
 
2832
                     else
 
2833
                        unwgt_B(j,i_soft)=unwgt_B(j,i_soft)
 
2834
     $                       +parton_iproc(jj,i)
 
2835
                     endif
2810
2836
                  endif
2811
2837
               enddo
2812
2838
            enddo
2887
2913
      include 'orders.inc'
2888
2914
      integer i,j,ict,iamp,ithree,isix
2889
2915
      double precision f(nintegrals),sigint,sigint1,sigint_ABS
2890
 
     $     ,n1body_wgt,tmp_wgt,max_weight
 
2916
     $     ,n1body_wgt,tmp_wgt,max_weight,sigint_noBorn
 
2917
     $     ,sigint_ABS_noBorn
2891
2918
      double precision virtual_over_born
2892
2919
      common /c_vob/   virtual_over_born
 
2920
      double precision xi_i_fks_ev,y_ij_fks_ev
 
2921
      double precision p_i_fks_ev(0:3),p_i_fks_cnt(0:3,-2:2)
 
2922
      common/fksvariables/xi_i_fks_ev,y_ij_fks_ev,p_i_fks_ev,p_i_fks_cnt
2893
2923
      sigint=0d0
2894
2924
      sigint1=0d0
2895
2925
      sigint_ABS=0d0
 
2926
      sigint_noBorn=0d0
 
2927
      sigint_ABS_noBorn=0d0
2896
2928
      n1body_wgt=0d0
2897
2929
      max_weight=0d0
2898
2930
      if (icontr.eq.0) then
2906
2938
            if (icontr_sum(0,i).eq.0) cycle
2907
2939
            do j=1,niproc(i)
2908
2940
               sigint_ABS=sigint_ABS+abs(unwgt(j,i))
 
2941
               sigint_ABS_noBorn=sigint_ABS_noBorn+abs(unwgt_noB(j,i))
2909
2942
               sigint1=sigint1+unwgt(j,i) ! for consistency check
 
2943
               sigint_noBorn=sigint_noBorn+unwgt_noB(j,i)
2910
2944
               max_weight=max(max_weight,abs(unwgt(j,i)))
2911
2945
            enddo
2912
2946
         enddo
2953
2987
            n1body_wgt=n1body_wgt+abs(tmp_wgt)
2954
2988
         enddo
2955
2989
      endif
 
2990
c
 
2991
      if (imode.eq.3) then
 
2992
         j=int(n_BS_xi*xi_i_fks_ev)+1
 
2993
         i=int(n_BS_yij*(y_ij_fks_ev+1d0)/2d0)+1
 
2994
         BornSmear(i,j,1)=BornSmear(i,j,1)+sigint_ABS_noBorn
 
2995
         BornSmear(i,j,2)=BornSmear(i,j,2)+sigint_noBorn
 
2996
      endif
 
2997
      
2956
2998
      f(1)=sigint_ABS
2957
2999
      f(2)=sigint
2958
3000
      f(4)=virtual_over_born
2977
3019
      end
2978
3020
 
2979
3021
 
 
3022
      double precision function BornSmear_weight(xi,y)
 
3023
      use mint_module
 
3024
      implicit none
 
3025
      integer i,j
 
3026
      double precision xi,y
 
3027
      double precision sum_wgts
 
3028
      save sum_wgts
 
3029
      logical firsttime
 
3030
      data firsttime/.true./
 
3031
c
 
3032
c     compute weight normalisation
 
3033
      if (firsttime) then
 
3034
         sum_wgts=0d0
 
3035
         do j=1,n_BS_xi
 
3036
            do i=1,n_BS_yij
 
3037
               sum_wgts=sum_wgts+BornSmear(j,i,0)
 
3038
            enddo
 
3039
         enddo
 
3040
c     check
 
3041
         if(sum_wgts.eq.0d0)then
 
3042
            write(*,*)'Error in bias weight, zero total weight'
 
3043
            stop
 
3044
         endif
 
3045
         firsttime=.false.
 
3046
      endif
 
3047
c
 
3048
c     determine bin corresponding to actual xi and y values
 
3049
      j=int(n_BS_xi*xi)+1
 
3050
      i=int(n_BS_yij*(y+1d0)/2d0)+1
 
3051
c
 
3052
c     output weight at xi and y
 
3053
c$$$      BornSmear_weight=BornSmear(i,j,0)/sum_wgts*n_BS_xi*n_BS_yij
 
3054
      BornSmear_weight=sum(BornSmear(i,1:n_BS_xi,0))/sum_wgts*n_BS_yij
 
3055
c
 
3056
      return
 
3057
      end
 
3058
      
2980
3059
      subroutine pick_unweight_contr(iFKS_picked)
2981
3060
c Randomly pick (weighted by the ABS values) the contribution to a given
2982
3061
c PS point that should be written in the event file.