=== 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 '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-04-24 16:20:19 +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) + stop 1 + 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