~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to Template/LO/SubProcesses/reweight.f

fix on MLM

Show diffs side-by-side

added added

removed removed

Lines of Context:
498
498
      integer jlast(2)
499
499
      integer njetstore(lmaxconfigs),iqjetstore(nexternal-2,lmaxconfigs)
500
500
      real*8 q2bck(2)
501
 
      common /to_rw/jlast,njetstore,iqjetstore,q2bck
 
501
      integer njets,iqjets(nexternal)
 
502
      common /to_rw/jlast,njetstore,iqjetstore,njets,iqjets,q2bck
502
503
      data njetstore/lmaxconfigs*-1/
503
504
      real*8 xptj,xptb,xpta,xptl,xmtc
504
505
      real*8 xetamin,xqcut,deltaeta
526
527
 
527
528
c     Variables for keeping track of jets
528
529
      logical goodjet(n_max_cl)
529
 
      integer njets,iqjets(nexternal)
530
530
      integer fsnum(2),ida(2),imo,jcode
531
531
      logical chclusold,fail,increasecode
532
532
      save chclusold
1128
1128
      integer jlast(2)
1129
1129
      integer njetstore(lmaxconfigs),iqjetstore(nexternal-2,lmaxconfigs)
1130
1130
      real*8 q2bck(2)
1131
 
      common /to_rw/jlast,njetstore,iqjetstore,q2bck
 
1131
      integer njets,iqjets(nexternal)
 
1132
      common /to_rw/jlast,njetstore,iqjetstore,njets,iqjets,q2bck
1132
1133
      integer idup(nexternal,maxproc,maxsproc)
1133
1134
      integer mothup(2,nexternal)
1134
1135
      integer icolup(2,nexternal,maxflow,maxsproc)
1135
1136
      include 'leshouche.inc'
1136
1137
 
1137
1138
C   local variables
1138
 
      integer i, j, idi, idj,ijet
 
1139
      integer i, j, idi, idj
1139
1140
      real*8 PI
1140
1141
      parameter( PI = 3.14159265358979323846d0 )
1141
1142
 
 
1143
      logical setclscales
1142
1144
      integer mapconfig(0:lmaxconfigs), this_config
1143
1145
      integer iforest(2,-max_branch:-1,lmaxconfigs)
1144
1146
      integer sprop(maxsproc,-max_branch:-1,lmaxconfigs)
1196
1198
 
1197
1199
      endif
1198
1200
      
1199
 
c     Store pdf information for systematics studies (initial)
 
1201
 
 
1202
      if(ickkw.le.0)then
 
1203
c     Store pdf information for systematics studies (initial)
 
1204
         if(use_syst)then
 
1205
            do j=1,2
 
1206
                n_pdfrw(j)=1
 
1207
                i_pdgpdf(1,j)=ipdgcl(j,igraphs(1),iproc)
 
1208
                s_xpdf(1,j)=xbk(ib(j))
 
1209
                s_qpdf(1,j)=sqrt(q2fact(j))
 
1210
            enddo
 
1211
           endif
 
1212
         asref=0 ! usefull for syscalc
 
1213
         goto 100
 
1214
      endif
 
1215
 
 
1216
 
 
1217
      if(.not.setclscales(p)) then ! recluster to have the correct iqjets
 
1218
        write(*,*) "Fail to cluster the events from the rewgt function"
 
1219
        stop
 
1220
      endif
 
1221
 
 
1222
c     Store pdf information for systematics studies (initial)
 
1223
c     need to be done after      setclscales since that one clean the syscalc value
1200
1224
      if(use_syst)then
1201
1225
         do j=1,2
1202
1226
            n_pdfrw(j)=1
1206
1230
         enddo
1207
1231
      endif
1208
1232
 
1209
 
      if(ickkw.le.0)then
1210
 
         asref=0 ! usefull for syscalc
1211
 
         goto 100
1212
 
      endif
1213
1233
c   Preparing graph particle information (ipart, needed to keep track of
1214
1234
c   external particle clustering scales)
1215
1235
      do i=1,nexternal
1259
1279
      endif
1260
1280
 
1261
1281
c     Prepare checking for parton vertices
1262
 
      ijet=1
1263
1282
      do i=1,nexternal
1264
1283
         j=ishft(1,i-1)
1265
1284
c        Set jet identities according to chosen subprocess
1270
1289
     $        i,ipdgcl(j,igraphs(1),iproc)
1271
1290
         if(i.le.2)then
1272
1291
            goodjet(j)=isparton(ipdgcl(j,igraphs(1),iproc))
1273
 
         elseif(ijet.le.njetstore(iconfig).and.
1274
 
     $        i.eq. iqjetstore(ijet,iconfig)) then
 
1292
         elseif(iqjets(i).gt.0) then
1275
1293
            goodjet(j)=.true.
1276
 
            ijet=ijet+1
1277
1294
         elseif(isparton(ipdgcl(j,igraphs(1),iproc)).and.
1278
1295
     $          .not.isjet(ipdgcl(j,igraphs(1),iproc))) then
1279
1296
            goodjet(j)=.true.