3 int SANCtable::ns1=0,SANCtable::ns2=0,SANCtable::ns3=0,SANCtable::ncos=0;
4 double SANCtable::smin1=0,SANCtable::smax1=0;
5 double SANCtable::smin2=0,SANCtable::smax2=0;
6 double SANCtable::smin3=0,SANCtable::smax3=0;
7 int SANCtable::iqed=0,SANCtable::iew=0,SANCtable::iborn=0;
8 int SANCtable::gfscheme=0,SANCtable::ifgg=0;
9 double SANCtable::nc=0,SANCtable::fc=0,SANCtable::tlmu2=0;
14 void SANCtable::setDimensions(
int n1,
int n2,
int n3,
int nc)
21 void SANCtable::setRanges(
double sn1,
double sx1,
double sn2,
double sx2,
double sn3,
double sx3)
30 void SANCtable::setFlags()
32 iqed=0;iew=1;iborn=0;gfscheme=0;ifgg=1;
33 nc=1.0;fc=3.0;tlmu2=1e-5;
34 flagset_(&iqed,&iew,&iborn,&gfscheme,&ifgg,&nc,&fc,&tlmu2);
41 void SANCtable::setFixedLength(
int prc)
55 bool SANCtable::addHeader()
57 char path[255],ftime[255];
59 if(ns1==0 || smin1==0)
return false;
60 f<<
"Dimensions: "<<ns1<<
" "<<ns2<<
" "<<ns3<<
" "<<ncos<<endl;
61 f<<
"Ranges: "<<log(smin1)<<
" "<<log(smax1)<<
" "<<smin2<<
" "<<smax2<<
" "<<smin3<<
" "<<smax3<<endl;
64 strftime(ftime,255,
"%d %b %Y, %H:%M:%S, GMT%z",localtime(&utime));
65 f<<
"Timestamp: "<<ftime<<endl;
66 f<<
"Path: "<<path<<endl<<endl;
70 bool SANCtable::addFile(
char *name)
74 if(!d.is_open())
return false;
83 void SANCtable::addRange(
int rangeNo,
bool isLog)
85 double min=0,max=0,steps=0;
86 ofstream::fmtflags last = cout.setf(ios::fixed);
87 f<<
"\nBeginRange"<<rangeNo<<endl;
88 cout<<
"\nBeginRange"<<rangeNo<<endl;
91 case 1: min=smin1; max=smax1; steps=ns1;
break;
92 case 2: min=smin2; max=smax2; steps=ns2;
break;
93 case 3: min=smin3; max=smax3; steps=ns3;
break;
95 double step= (isLog) ? (log(max)-log(min))/(steps-1) : (max-min)/(steps-1);
97 for(
int i=0;i<steps;i++)
99 sloop= (isLog) ? exp(log(min)+i*step) : min+i*step;
101 for(
int j=0;j<ncos;j++)
103 double costhetloop=-1.+1.0/ncos+j*2./ncos;
105 flagset_(&iqed,&iew,&iborn,&gfscheme,&ifgg,&nc,&fc,&tlmu2);
106 double borndivv = Rcalc(flav,sloop,costhetloop);
108 iew = (born) ? 0 : 1;
109 flagset_(&iqed,&iew,&iborn,&gfscheme,&ifgg,&nc,&fc,&tlmu2);
110 double divv = Rcalc(flav,sloop,costhetloop);
115 f<<divv<<
" "<<borndivv<<endl;
121 void SANCtable::open(
char *name)
124 isOpen = f.is_open();
127 void SANCtable::close()
136 double SANCtable::Rcalc(
int flav,
double s,
double cosf)
138 double sig[4][4][2],sum=0.,divv=0.;
139 complex<double> amp[2][2][2][2][2]={0}, sigma[4][2][2]={0}, c;
141 sigma[0][0][0] = complex<double>(1,0);
142 sigma[0][1][1] = complex<double>(1,0);
144 sigma[1][0][1] = complex<double>(1,0);
145 sigma[1][1][0] = complex<double>(1,0);
147 sigma[2][0][1] = complex<double>(0,-1);
148 sigma[2][1][0] = complex<double>(0,1);
150 sigma[3][0][0] = complex<double>(1,0);
151 sigma[3][1][1] = complex<double>(-1,0);
154 paraget_(&mta,&conhc,&pi);
156 double betaf = sqrt(1e0-4e0*mta*mta/s);
157 double t = mta*mta - s/2*(1e0-betaf*cosf);
158 double u = mta*mta - s/2*(1e0+betaf*cosf);
159 for(
int iz = 0;iz<2;iz++)
161 for(
int L1=1;L1<=2;L1++)
163 for(
int L2=1;L2<=2;L2++)
165 for(
int L3=1;L3<=2;L3++)
167 for(
int L4=1;L4<=2;L4++)
170 if(flav==1) downdown_(&L1,&L2,&L3,&L4,&s,&t,&u,&iz,&har,&hai);
171 else upup_(&L1,&L2,&L3,&L4,&s,&t,&u,&iz,&har,&hai);
172 amp[L1-1][L2-1][L3-1][L4-1][iz] = complex<double>(har,hai);
179 for(
int i=0;i<4;i++){
180 for(
int j=0;j<4;j++){
181 for(
int iz = 0;iz<2;iz++)
184 for(
int L1=1;L1<=2;L1++)
186 for(
int L2=1;L2<=2;L2++)
188 for(
int L3=1;L3<=2;L3++)
190 for(
int L4=1;L4<=2;L4++)
191 for(
int M3=1;M3<=2;M3++)
192 for(
int M4=1;M4<=2;M4++)
194 c = amp[L1-1][L2-1][L3-1][L4-1][iz] *
195 conj(amp[L1-1][L2-1][M3-1][M4-1][iz]) *
196 sigma[i][M3-1][L3-1] *
197 sigma[j][M4-1][L4-1];
209 (sig[i][j][1] - sig[i][j][0]) *
212 if(i==0 && j==0) divv=R[0][0];
214 R[i][j]=R[i][j]/divv;