=== modified file 'Template/LO/Source/dsample.f' --- old/Template/LO/Source/dsample.f 2015-03-26 08:58:13 +0000 +++ new/Template/LO/Source/dsample.f 2015-04-24 15:44:19 +0000 @@ -2052,7 +2052,7 @@ xxmean = tmean/tsigma if (cur_it.ne.2)then - xchi2 = (chi2/xxmean/xxmean-tsigma)/dble(cur_it-2) + xchi2 = dabs(chi2/xxmean/xxmean-tsigma)/dble(cur_it-2) else xchi2 = 0d0 endif @@ -2171,7 +2171,7 @@ endif tmean = tmean / tsigma trmean = trmean / tsigma - chi2 = (chi2 / tmean / tmean - tsigma) / dble(itm - 1) + chi2 = dabs(chi2 / tmean / tmean - tsigma) / dble(itm - 1) tsigma = tmean / sqrt(tsigma) write(*, 80) real(tmean), real(tsigma), real(trmean), real(chi2) 80 format(/1X,79(1H-)/1X,23HAccumulated results: , === modified file 'Template/LO/SubProcesses/setscales.f' --- old/Template/LO/SubProcesses/setscales.f 2015-04-03 11:03:49 +0000 +++ new/Template/LO/SubProcesses/setscales.f 2015-04-29 02:28:52 +0000 @@ -104,7 +104,7 @@ cc USER DEFINE SCALE: END of USER CODE cc ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc endif - + rscale = scalefact*rscale return end === modified file 'madgraph/iolibs/template_files/addmothers.f' --- old/madgraph/iolibs/template_files/addmothers.f 2015-04-07 12:11:42 +0000 +++ new/madgraph/iolibs/template_files/addmothers.f 2015-05-01 00:19:54 +0000 @@ -692,6 +692,7 @@ $ mo_color.eq.8.and.i3.eq.2.and.i3bar.eq.2) then c Replace the maximum index with the minimum one everywhere c (we don't know if we should replace i3 with i3bar or vice versa) + maxcol=max(max3,max3bar) if(maxcol.eq.max3) then mincol=min3bar @@ -704,23 +705,70 @@ $ icol(j,i)=mincol enddo enddo + + if (mincol.eq.0.and.mo_color.eq.3) then +c situation like (possible if they are epsilon in the gluon decay +c (503,0)----------+ggggggggggggg (509,508) +c | +c |(x,y) +c in this case maxcol=509 and mincol=0 +c The correct solution in this case is: +c (503,0)----------+ggggggggggggg (503,508) +c | +c |(0,508) + if(icolmp(2,1).eq.0)then + maxcol = icolmp(1,2) + mincol = icolmp(1,1) + icol(1,ires) = 0 + icol(2,ires) = icolmp(2,2) + elseif(icolmp(1,1).eq.0)then + maxcol = icolmp(2,2) + mincol = icolmp(2,1) + icol(1,ires) = icolmp(1,2) + icol(2,ires) = 0 + elseif(icolmp(2,2).eq.0)then + maxcol = icolmp(1,1) + mincol = icolmp(1,2) + icol(1,ires) = 0 + icol(2,ires) = icolmp(2,1) + elseif(icolmp(1,2).eq.0)then + maxcol = icolmp(2,1) + mincol = icolmp(2,2) + icol(1,ires) = icolmp(1,1) + icol(2,ires) = 0 + else + !should not happen + write(*,*) "weird color combination in addmothers.f" + write(*,*) icolmp(1,1), icolmp(2,1), icolmp(1,2), icolmp(2,2) + call write_error(1001,0,0) + endif +c now maxcol=509 and mincol=503 so replace all occurence of 509-> 503 +c print *,'Replaced ',maxcol,' by ',mincol + do i=ires+1,nexternal + do j=1,2 + if(icol(j,i).eq.maxcol) + $ icol(j,i)=mincol + enddo + enddo + else +c standard case c Fix the color for ires (remember 3<->3bar for t-channels) - icol(1,ires)=0 - icol(2,ires)=0 + icol(1,ires)=0 + icol(2,ires)=0 c print *,'Replaced ',maxcol,' by ',mincol - if(max3.eq.maxcol)then - if(i3-i3bar.ge.0) icol(2,ires)=min3 - if(i3bar-i3.ge.0) icol(1,ires)=max3bar - else - if(i3-i3bar.ge.0) icol(2,ires)=max3 - if(i3bar-i3.ge.0) icol(1,ires)=min3bar + if(max3.eq.maxcol)then + if(i3-i3bar.ge.0) icol(2,ires)=min3 + if(i3bar-i3.ge.0) icol(1,ires)=max3bar + else + if(i3-i3bar.ge.0) icol(2,ires)=max3 + if(i3bar-i3.ge.0) icol(1,ires)=min3bar + endif endif -c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2) +c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2) else c Don't know how to deal with this call write_error(i3,i3bar,mo_color) endif - fix_tchannel_color=maxcolor return @@ -783,7 +831,7 @@ if(n3.le.1.and.n3bar.eq.0) icol(2,ires)=0 if(i3.ne.n3.or.i3bar.ne.n3bar) then - if(n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0)then + if(n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0.and.i3.eq.0)then c This is an epsilon index interaction c write(*,*) i3, n3, i3bar, n3bar, ires maxcolor=maxcolor+1 @@ -792,7 +840,7 @@ maxcolor=maxcolor+1 icol(2,ires)=-maxcolor endif - elseif(n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0)then + elseif(n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0.and.i3bar.eq.0)then c This is an epsilonbar index interaction c write(*,*) i3, n3, i3bar, n3bar, ires maxcolor=maxcolor+1 @@ -804,7 +852,9 @@ elseif(n3.gt.0.and.n3bar.eq.0.and.i3-i3bar.eq.n3.or. $ n3bar.gt.0.and.n3.eq.0.and.i3bar-i3.eq.n3bar.or. $ n3.eq.1.and.n3bar.eq.1.and.i3-i3bar.eq.0.or. - $ n3.eq.0.and.n3bar.eq.0.and.i3-i3bar.eq.0)then + $ n3.eq.0.and.n3bar.eq.0.and.i3-i3bar.eq.0.or. + $ n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0.and.i3bar.ne.0.or. + $ n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0.and.i3.ne.0)then c We have a previous epsilon which gives the wrong pop-up index call fix_s_color_indices(n3,n3bar,i3,i3bar,ncolmp,icolmp, $ ires,icol,is_colors) @@ -850,9 +900,48 @@ if(n3.eq.1.and.n3bar.eq.0.and.i3-i3bar.eq.n3.or. $ n3bar.eq.1.and.n3.eq.0.and.i3bar-i3.eq.n3bar.or. $ n3bar.eq.1.and.n3.eq.1.and.i3bar-i3.eq.0.or. - $ n3bar.eq.0.and.n3.eq.0.and.i3bar-i3.eq.0)then + $ n3bar.eq.0.and.n3.eq.0.and.i3bar-i3.eq.0.or. + $ n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0.and.i3bar.ne.0.or. + $ n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0.and.i3.ne.0)then + + if ((i3.eq.2.or.i3bar.eq.2).and.(n3bar+n3.eq.1))then +c Special case: +c -------------------- (0,503) +c g +c g +c g (504,505) +c +c need to correct to +c ------------------------- (0,503) +c (504,0) g +c g +c g (504,503) + if (i3.eq.2) then + icol(2,ires) = max(icolmp(2,1), icolmp(2,2)) + icol(1,ires) = 0 + maxcol = icolmp(1,2) + mincol = icolmp(1,1) +c replace maxcol by mincol + elseif (i3bar.eq.2) then + icol(1,ires) = max(icolmp(1,1), icolmp(1,2)) + icol(2,ires) = 0 + maxcol = icolmp(2,1) + mincol = icolmp(2,2) + endif +c write(*,*) "replace ", maxcol,"by",mincol + do i=ires+1,nexternal + do j=1,2 + if(icol(j,i).eq.maxcol) + $ icol(j,i)=mincol + enddo + enddo + + + else c Replace the highest 3bar-index with the lowest 3-index, c or vice versa + + maxcol=max(max_n3,max_n3bar) if(maxcol.eq.max_n3) then mincol=min_n3bar @@ -874,7 +963,7 @@ if(n3bar.eq.1) icol(2,ires)=min_n3bar endif c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2) - + endif else c Don't know how to deal with this call write_error(1001,n3,n3bar) @@ -965,7 +1054,7 @@ potential_index(k) = icol(2,j) mothers(1) = i else - stop 1 + call write_error(1001,0,0) endif endif enddo @@ -1131,7 +1220,7 @@ c This should not happen. if (max3bar.eq.0)then write(*,*) "colorflow problem" - stop 3 + call write_error(1001,0,0) endif endif endif