~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to Template/RWGTNLO/rwgt.f

mwrge with 2.7.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
      subroutine initialise(lpp, pdfid)
2
 
      implicit none
3
 
      integer lpp(2)
4
 
      integer pdfid
5
 
CF2PY INTENT(IN) :: LPP(2)
6
 
CF2PY INTENT(IN) :: PDF
7
 
 
8
 
      integer save_lpp(2)
9
 
      common/beam_type/save_lpp
10
 
      double precision value(20)
11
 
      character*20 parm(20)
12
 
c       Save the beam type information        
13
 
        save_lpp(1) = lpp(1)
14
 
        save_lpp(2) = lpp(2)
15
 
 
16
 
c       Initialise the pdf
17
 
        if (abs(lpp(1)).eq.1.or.abs(lpp(2)).eq.1)then
18
 
           value(1)=pdfid
19
 
           parm(1)='DEFAULT'
20
 
           call pdfset(parm,value)
21
 
        endif
22
 
        return
23
 
        end
24
 
 
25
 
      subroutine test_pdf()
26
 
      implicit none 
27
 
      integer lpp(2)
28
 
      double precision pdf, PDG2PDF
29
 
      lpp(1)=1
30
 
      lpp(2) =1
31
 
      call initialise(lpp, 230000)
32
 
      pdf = PDG2PDF(1,1,0.1,100)
33
 
      write(*,*) pdf
34
 
      end
35
 
     
36
 
 
37
 
 
38
 
      subroutine get_wgt(scales2, pdg, bjx, wgt, g, qcdpower, ymur, 
39
 
     &                   ymuf, n_ctr, new_wgt, all_wgt)
40
 
      implicit none
41
 
      double precision scales2(3,n_ctr)
42
 
      integer pdg(2, n_ctr)
43
 
      double precision bjx(2,n_ctr)
44
 
      double precision g(n_ctr)
45
 
      integer qcdpower(n_ctr)
46
 
      double precision wgt(3, n_ctr)
47
 
      double precision ymur, ymuf
48
 
      integer n_ctr
49
 
      double precision new_wgt
50
 
      double precision all_wgt(n_ctr)
51
 
 
52
 
CF2PY INTENT(IN) :: scales2(3, n_ctr)
53
 
CF2PY INTENT(IN) :: pdg(2, n_ctr)
54
 
CF2PY INTENT(IN) :: bjx(2, n_ctr)
55
 
CF2PY INTENT(IN) :: wgt(3, n_ctr)
56
 
CF2PY INTENT(IN) :: g(n_ctr)
57
 
CF2PY INTENT(IN) :: qcdpower(n_ctr)
58
 
CF2PY INTENT(IN) :: ymur
59
 
CF2PY INTENT(IN) :: ymuf
60
 
CF2PY depend(n_ctr) :: scales2, pdg, bjx, qcdpower
61
 
CF2PY INTENT(OUT) :: new_wgt
62
 
CF2PY INTENT(OUT) :: all_wgt(n_ctr)
63
 
 
64
 
 
65
 
      integer save_lpp(2)
66
 
      common/beam_type/save_lpp
67
 
 
68
 
c     LOCAL      
69
 
      integer i,kr
70
 
      double precision mu2_q
71
 
      double precision mu2_r, mu2_f
72
 
      double precision xlum
73
 
      integer lp, pd
74
 
      double precision pi
75
 
      parameter (pi=3.14159265358979323846d0)
76
 
c     debug
77
 
      double precision gs,add_wgt
78
 
c     external
79
 
      double precision alphas, pdg2pdf
80
 
      external alphas, pdg2pdf
81
 
      new_wgt = 0d0
82
 
 
83
 
      do i=1, n_ctr
84
 
         mu2_q=scales2(1,i)
85
 
         mu2_r=scales2(2,i)*ymuR**2
86
 
c Update the strong coupling
87
 
         mu2_f=scales2(3,i)*ymuF**2
88
 
c         gs = sqrt(4d0*pi*alphas(sqrt(mu2_r)))
89
 
c call the PDFs
90
 
         xlum=1d0
91
 
         LP=SIGN(1,save_LPP(1))
92
 
         pd=pdg(1,i)
93
 
         if (pd.eq.21) pd=0
94
 
         xlum=xlum*PDG2PDF(ABS(save_LPP(1)),pd*LP,bjx(1,i)
95
 
     &           ,DSQRT(mu2_f))
96
 
         LP=SIGN(1,save_LPP(2))
97
 
         pd=pdg(2,i)
98
 
         if (pd.eq.21) pd=0
99
 
         xlum=xlum*PDG2PDF(ABS(save_LPP(2)),pd*LP,bjx(2,i)
100
 
     &           ,DSQRT(mu2_f))
101
 
c         write(*,*) "xlum", xlum
102
 
c add the weights to the array
103
 
         add_wgt =  xlum * (wgt(1,i)+wgt(2,i)*log(mu2_r
104
 
     &              /mu2_q)+wgt(3,i)*log(mu2_f/mu2_q))*g(i)
105
 
     &              **QCDpower(i)
106
 
c         write(*,*) i, add_wgt
107
 
         all_wgt(i) = add_wgt
108
 
         new_wgt = new_wgt + add_wgt
109
 
c         wgts(iwgt,i)=wgts(iwgt,i)
110
 
c     &              *rwgt_muR_dep_fac(sqrt(mu2_r(kr)))
111
 
      enddo
112
 
      return
113
 
      end
114