~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to Template/NLO/FixedOrderAnalysis/dbook.f

Small modification to allow for variable bin sizes for
MG5_aMC+aMCfast+APPLGrid fNLO runs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
c     initialization
125
125
      IMPLICIT NONE
126
126
      include 'dbook.inc'
 
127
c     APPLgrid commons
 
128
      include "reweight_appl.inc"
 
129
      include "appl_common.inc"
 
130
      integer iappl
 
131
      common /for_applgrid/ iappl
127
132
c
128
133
c     LOCAL
129
134
c
134
139
      NHIST=0
135
140
      DO 1, I=1,NPLOTS             
136
141
   1  BOOK(I)=' NO'
 
142
C     Initialize the number of bins of the aMCfast grids
 
143
      if(iappl.ne.0) appl_obs_nbins = 0
137
144
      END  
138
145
 
139
146
 
1019
1026
 
1020
1027
      subroutine bookup(n,string,del,xl,xu)
1021
1028
      implicit none
1022
 
      integer n,n_by4
 
1029
      integer i,n,n_by4
1023
1030
      character*(*) string
1024
1031
      double precision del,xl,xu
1025
1032
c     APPLgrid commons
1033
1040
      if(iappl.ne.0.and.index(string,"central").ne.0.and.
1034
1041
     1                  index(string,"Born").eq.0)then
1035
1042
c     Observable parameters
1036
 
         appl_obs_nbins = int( ( xu -xl ) / del / 0.999999d0 )
1037
 
         appl_obs_min   = xl
1038
 
         appl_obs_max   = appl_obs_nbins * del + xl
1039
 
         if(abs(appl_obs_max-xu).gt.0.001d0*del)then
 
1043
c     Compute number of bins and edges only if they have not been given by the user.
 
1044
         if(appl_obs_nbins.eq.0)then
 
1045
            appl_obs_nbins = int( ( xu - xl ) / del / 0.999999d0 )
 
1046
c     compute bin edges
 
1047
            do i=0,appl_obs_nbins
 
1048
               appl_obs_bins(i) = xl + i * del
 
1049
            enddo
 
1050
         endif
 
1051
         appl_obs_min = appl_obs_bins(0)
 
1052
         appl_obs_max = appl_obs_bins(appl_obs_nbins)
 
1053
         if(abs(appl_obs_max-xu).gt.0.00000001d0)then
1040
1054
            write(*,*) 'APPLgrid Histogram: ', 
1041
1055
     1                 'Change of the upper limit:',xu,'-->',
1042
 
     2                 appl_obs_max
 
1056
     2                  appl_obs_max
1043
1057
         endif
1044
1058
c     Initialize APPLgrid routines
1045
1059
         call APPL_init
1046
1060
c     Keep track of the position of this histogram
1047
1061
         nh_obs = nh_obs + 1
1048
1062
         ih_obs(nh_obs) = n
 
1063
c     Reset number of bins to zero
 
1064
         appl_obs_nbins = 0
1049
1065
      endif
1050
1066
      n_by4=4*(n-1)+1
1051
1067
      call bookup4(n_by4,string,del,xl,xu)