4 int SANCtable::ns1=0,SANCtable::ns2=0,SANCtable::ns3=0,SANCtable::ncos=0;
5 double SANCtable::smin1=0,SANCtable::smax1=0;
6 double SANCtable::smin2=0,SANCtable::smax2=0;
7 double SANCtable::smin3=0,SANCtable::smax3=0;
8 int SANCtable::iqed=0,SANCtable::iew=0,SANCtable::iborn=0;
9 int SANCtable::gfscheme=0,SANCtable::ifgg=0;
10 double SANCtable::nc=0,SANCtable::fc=0,SANCtable::tlmu2=0;
15 void SANCtable::setDimensions(
int n1,
int n2,
int n3,
int nc)
22 void SANCtable::setRanges(
double sn1,
double sx1,
double sn2,
double sx2,
double sn3,
double sx3)
31 void SANCtable::setFlags()
33 iqed=0;iew=1;iborn=0;gfscheme=0;ifgg=1;
34 nc=1.0;fc=3.0;tlmu2=1e-5;
35 flagset_(&iqed,&iew,&iborn,&gfscheme,&ifgg,&nc,&fc,&tlmu2);
42 void SANCtable::setFixedLength(
int prc)
56 bool SANCtable::addHeader()
58 char path[255],ftime[255];
60 if(ns1==0 || smin1==0)
return false;
61 f<<
"Dimensions: "<<ns1<<
" "<<ns2<<
" "<<ns3<<
" "<<ncos<<endl;
62 f<<
"Ranges: "<<log(smin1)<<
" "<<log(smax1)<<
" "<<smin2<<
" "<<smax2<<
" "<<smin3<<
" "<<smax3<<endl;
65 strftime(ftime,255,
"%d %b %Y, %H:%M:%S, GMT%z",localtime(&utime));
66 f<<
"Timestamp: "<<ftime<<endl;
67 f<<
"Path: "<<path<<endl<<endl;
71 bool SANCtable::addFile(
const char *name)
75 if(!d.is_open())
return false;
84 void SANCtable::addRange(
int rangeNo,
bool isLog)
86 double min=0,max=0,steps=0;
87 ofstream::fmtflags last = cout.setf(ios::fixed);
88 f<<
"\nBeginRange"<<rangeNo<<endl;
89 cout<<
"\nBeginRange"<<rangeNo<<endl;
92 case 1: min=smin1; max=smax1; steps=ns1;
break;
93 case 2: min=smin2; max=smax2; steps=ns2;
break;
94 case 3: min=smin3; max=smax3; steps=ns3;
break;
96 double step= (isLog) ? (log(max)-log(min))/(steps-1) : (max-min)/(steps-1);
98 for(
int i=0;i<steps;i++)
100 sloop= (isLog) ? exp(log(min)+i*step) : min+i*step;
102 for(
int j=0;j<ncos;j++)
104 double costhetloop=-1.+1.0/ncos+j*2./ncos;
106 flagset_(&iqed,&iew,&iborn,&gfscheme,&ifgg,&nc,&fc,&tlmu2);
107 double borndivv = Rcalc(flav,sloop,costhetloop);
109 iew = (born) ? 0 : 1;
110 flagset_(&iqed,&iew,&iborn,&gfscheme,&ifgg,&nc,&fc,&tlmu2);
111 double divv = Rcalc(flav,sloop,costhetloop);
116 f<<divv<<
" "<<borndivv<<endl;
122 void SANCtable::open(
const char *name)
125 isOpen = f.is_open();
128 void SANCtable::close()
137 double SANCtable::Rcalc(
int flav,
double s,
double cosf)
139 double sig[4][4][2],sum=0.,divv=0.;
140 complex<double> amp[2][2][2][2][2]={0}, sigma[4][2][2]={0}, c;
142 sigma[0][0][0] = complex<double>(1,0);
143 sigma[0][1][1] = complex<double>(1,0);
145 sigma[1][0][1] = complex<double>(1,0);
146 sigma[1][1][0] = complex<double>(1,0);
148 sigma[2][0][1] = complex<double>(0,-1);
149 sigma[2][1][0] = complex<double>(0,1);
151 sigma[3][0][0] = complex<double>(1,0);
152 sigma[3][1][1] = complex<double>(-1,0);
155 paraget_(&mta,&conhc,&pi);
157 double betaf = sqrt(1e0-4e0*mta*mta/s);
158 double t = mta*mta - s/2*(1e0-betaf*cosf);
159 double u = mta*mta - s/2*(1e0+betaf*cosf);
160 for(
int iz = 0;iz<2;iz++)
162 for(
int L1=1;L1<=2;L1++)
164 for(
int L2=1;L2<=2;L2++)
166 for(
int L3=1;L3<=2;L3++)
168 for(
int L4=1;L4<=2;L4++)
171 if(flav==1) downdown_(&L1,&L2,&L3,&L4,&s,&t,&u,&iz,&har,&hai);
172 else upup_(&L1,&L2,&L3,&L4,&s,&t,&u,&iz,&har,&hai);
173 amp[L1-1][L2-1][L3-1][L4-1][iz] = complex<double>(har,hai);
180 for(
int i=0;i<4;i++){
181 for(
int j=0;j<4;j++){
182 for(
int iz = 0;iz<2;iz++)
185 for(
int L1=1;L1<=2;L1++)
187 for(
int L2=1;L2<=2;L2++)
189 for(
int L3=1;L3<=2;L3++)
191 for(
int L4=1;L4<=2;L4++)
192 for(
int M3=1;M3<=2;M3++)
193 for(
int M4=1;M4<=2;M4++)
195 c = amp[L1-1][L2-1][L3-1][L4-1][iz] *
196 conj(amp[L1-1][L2-1][M3-1][M4-1][iz]) *
197 sigma[i][M3-1][L3-1] *
198 sigma[j][M4-1][L4-1];
210 (sig[i][j][1] - sig[i][j][0]) *
213 if(i==0 && j==0) divv=R[0][0];
215 R[i][j]=R[i][j]/divv;