11const unsigned char MinorBase::ti2[8]={0, 1, 3, 6, 10, 15, 21, 28};
12const unsigned char MinorBase::ti3[8]={0, 1, 4, 10, 20, 35, 56, 84};
13const unsigned char MinorBase::ti4[8]={0, 1, 5, 15, 35, 70, 126, 210};
14const unsigned char MinorBase::ti5[8]={0, 1, 6, 21, 56, 126, 252, 0};
117 while (ic < 3 &&
nc < 3) {
118 if (free[
nc]==set[ic]) {
119 for (
int cc=
nc; cc<3; cc++) {
138 : kinem(k), pm5(mptr5), ps(
s), pt(
t), pu(u), offs(is)
154 : kinem(k), pm5(mptr5), ps(
s), pt(
t), offs(is)
173 : kinem(k), pm5(mptr5), ps(
s), offs(is)
191double Minor5::M4ii(
int u,
int v,
int i)
196double Minor5::M4ui(
int u,
int v,
int i)
201double Minor5::M4vi(
int u,
int v,
int i)
206double Minor5::M4uu(
int u,
int v,
int i)
211double Minor5::M4vu(
int u,
int v,
int i)
216double Minor5::M4vv(
int u,
int v,
int i)
226#define k5s1 s12,p3,p4,p5,s45,s34,m2,m3,m4,m5
227#define k5s2 p1,s23,p4,p5,s45,s15,m1,m3,m4,m5
228#define k5s3 p1,p2,s34,p5,s12,s15,m1,m2,m4,m5
229#define k5s4 p1,p2,p3,s45,s12,s23,m1,m2,m3,m5
230#define k5s5 p2,p3,p4,s15,s23,s34,m2,m3,m4,m1
232#define k5st12 s45,p4, p5, m3,m4,m5
233#define k5st13 s12,s34,p5, m2,m4,m5
234#define k5st14 s12,p3, s45,m2,m3,m5
235#define k5st15 p3, p4, s34,m3,m4,m2
236#define k5st23 p1, s15,p5, m1,m4,m5
237#define k5st24 p1, s23,s45,m1,m3,m5
238#define k5st25 s23,p4, s15,m3,m4,m1
239#define k5st34 p1, p2, s12,m1,m2,m5
240#define k5st35 p2, s34,s15,m2,m4,m1
241#define k5st45 p2, p3, s23,m2,m3,m1
243#define k5stu123 p5, m4, m5
244#define k5stu124 s45, m3, m5
245#define k5stu125 p4, m4, m3
246#define k5stu134 s12, m2, m5
247#define k5stu135 s34, m4, m2
248#define k5stu145 p3, m3, m2
249#define k5stu234 p1, m1, m5
250#define k5stu235 s15, m4, m1
251#define k5stu245 s23, m3, m1
252#define k5stu345 p2, m2, m1
254#define m5create4(s) \
256 Kinem4 k4=Kinem4(k5s##s); \
257 Minor4::Ptr minor=Minor4::create(k4,self,s, offs); \
258 MCache::insertMinor4(k4,minor); \
261#define m5create3(s,t) \
263 Kinem3 k3=Kinem3(k5st##s##t); \
264 Minor3::Ptr minor=Minor3::create(k3,self,s,t, offs); \
265 MCache::INSERTMINOR3(k3,minor); \
268#define m5create2(s,t,u) \
270 Kinem2 k2=Kinem2(k5stu##s##t##u); \
271 Minor2::Ptr minor=Minor2::create(k2,self,s,t,u, offs); \
272 MCache::INSERTMINOR2(k2,minor); \
279Minor5::Minor5(
const Kinem5& k) : kinem(k), smax(5), pmaxS4(), pmaxS3()
281#ifdef USE_GOLEM_MODE_6
284 const double p1=kinem.p1();
285 const double p2=kinem.p2();
286 const double p3=kinem.p3();
287 const double p4=kinem.p4();
288 const double p5=kinem.p5();
289 const double s12=kinem.s12();
290 const double s23=kinem.s23();
291 const double s34=kinem.s34();
292 const double s45=kinem.s45();
293 const double s15=kinem.s15();
294 const double m1=kinem.m1();
295 const double m2=kinem.m2();
296 const double m3=kinem.m3();
297 const double m4=kinem.m4();
298 const double m5=kinem.m5();
304 Cay[10]=
m1+m5-
p1; Cay[11]=
m2+m5-
s12; Cay[12]=
m3+m5-s45; Cay[13]=
m4+m5-p5; Cay[14]=2*m5;
345Minor5::Minor5(
const Kinem4& k) : smax(1), pmaxS4(), pmaxS3()
347#ifdef USE_GOLEM_MODE_6
351 const double p3=k.
p2();
352 const double p4=k.
p3();
353 const double p5=k.
p4();
354 const double s12=k.
p1();
355 const double s34=k.
s23();
356 const double s45=k.
s12();
357 const double m2=k.
m1();
358 const double m3=k.
m2();
359 const double m4=k.
m3();
360 const double m5=k.
m4();
361 kinem=
Kinem5(0.,0.,
p3,
p4,p5,
s12,0.,s34,s45,0.,0.,
m2,
m3,
m4,m5);
364 Cay[ 1]=
m2; Cay[ 2]=2*
m2;
367 Cay[10]=m5; Cay[11]=
m2+m5-
s12; Cay[12]=
m3+m5-s45; Cay[13]=
m4+m5-p5; Cay[14]=2*m5;
403 for (
int i=1; i<=
DCay-1; i++) {
404 for (
int ip=i+1; ip<=
DCay-1; ip++) {
405 const double m1=kinem.
mass(i);
406 const double m2=kinem.
mass(ip);
407 const double maxM =
m1>
m2 ?
m1 :
m2;
412 for (
int i=1; i<=
DCay-1; i++) {
413 for (
int j=i; j<=
DCay-1; j++) {
414 const double cay=fabs(
Cay[
nss(i,j)]);
415 for (
int s=1;
s<=smax;
s++) {
416 if (
s==i ||
s==j)
continue;
417 if (pmaxS4[
s-1] < cay) pmaxS4[
s-1]=cay;
419 if (
t==i ||
t==j)
continue;
420 const int idx =
im2(
s,
t)-5;
421 if (pmaxS3[idx] < cay ) pmaxS3[idx]=cay;
426 if (not fEval[E_M1] ) {
430 for (
int s=1;
s<=smax;
s++) {
431 pmaxS4[
s-1]=fabs(pmaxS4[
s-1]*
M1(
s,
s)/
M2(0,
s,0,
s));
433 const int idx=
im2(
s,
t)-5;
437 for (
int ii=1; ii<=
DCay-1; ii++) {
438 if (i==
s || i==
t)
continue;
439 const double val=fabs(
M3(0,
s,
t,ii,
s,
t));
447 const double maxcay3=pmaxS3[idx];
448 const double dstst=
M2(
s,
t,
s,
t);
449 const double ds0ts0t=
M3(0,
s,
t,0,
s,
t);
451 pmaxS3[idx]=fabs((maxcay3*dstst)/ds0ts0t);
452 pmaxT3[idx]=fabs(ds0ts0t/(maxcay3*
M3(0,
s,
t,i,
s,
t)));
453 pmaxU3[idx]=fabs(dstst/
M3(0,
s,
t,i,
s,
t));
474 if (sign==0)
return 0;
479 return pM2[
is(uidx,lidx)]*sign;
486double Minor5::M3(
int i,
int j,
int k,
int l,
int m,
int n)
489 if (sign==0)
return 0;
494 return pM3[
is(uidx,lidx)]*sign;
503 if (not fEval[E_M2] ) {
507 for (
int i=0; i<=
DCay-1; i++) {
508 for (
int l=0; l<=i; l++) {
509 pM1[
iss(l,i)]=std::numeric_limits<double>::quiet_NaN();
523 for (
int m=1; m<=
DCay-1; m++) {
530 for (
int i=1; i<=smax; i++) {
531 for (
int l=0; l<=i; l++) {
533 for (
int m=1; m<=
DCay-1; m++) {
549 if (fabs(
p1) > fabs(
p2)) {
550 if (fabs(
p1) > fabs(
p3)) {
551 const double diff=(
p1 -
p2 -
p3);
552 const double subs=(-4.)*
p2*
p3;
556 const double diff=(
p3 -
p2 -
p1);
557 const double subs=(-4.)*
p2*
p1;
562 if (fabs(
p2) > fabs(
p3)) {
563 const double diff=(
p2 -
p1 -
p3);
564 const double subs=(-4.)*
p1*
p3;
568 const double diff=(
p3 -
p2 -
p1);
569 const double subs=(-4.)*
p2*
p1;
582 if (not fEval[E_M3] ) {
586 for (
int i=0; i<=
DCay-1; i++) {
587 for (
int j=i+1; j<=
DCay-1; j++) {
588 const int uidx=
im2(i,j);
589 for (
int l=0; l<=
DCay-1; l++) {
590 for (
int m=l+1; m<=
DCay-1; m++) {
592 if (lidx > uidx)
continue;
593 pM2[
is(uidx,lidx)]=std::numeric_limits<double>::quiet_NaN();
602 for (
int j=i+1; j<=
DCay-1; j++) {
603 const int uidx=
im2(i,j);
604 const int k = (j==1 ? 2 : 1);
605 for (
int l=0; l<=smax; l++) {
606 for (
int m=l+1; m<=
DCay-1; m++) {
608 if (lidx > uidx)
continue;
610 double m2ele=
M3(i,j,k,l,m,0);
614 pM2[
is(uidx,lidx)]=m2ele;
620 for (
int i=1; i<=smax; i++) {
621 for (
int j=i+1; j<=
DCay-1; j++) {
622 const int uidx=
im2(i,j);
623 for (
int l=0; l<=smax; l++) {
624 for (
int m=l+1; m<=
DCay-1; m++) {
626 if (lidx > uidx)
continue;
630 m2ele+=
M3(i,j,k,l,m,
n);
632 pM2[
is(uidx,lidx)]=m2ele;
647 for (
int i=0; i<=
DCay-1; i++) {
648 for (
int j=i+1; j<=
DCay-1; j++) {
649 for (
int k=j+1; k<=
DCay-1; k++) {
650 const int uidx=
im3(i,j,k);
651 for (
int l=0; l<=
DCay-1; l++) {
652 for (
int m=l+1; m<=
DCay-1; m++) {
653 for (
int n=m+1;
n<=
DCay-1;
n++) {
655 if (lidx > uidx)
continue;
656 pM3[
is(uidx,lidx)]=std::numeric_limits<double>::quiet_NaN();
667 for (
int j=i+1; j<=
DCay-2; j++) {
668 for (
int k=j+1; k<=
DCay-1; k++) {
669 const int uidx=
im3(i,j,k);
673 for (
int m=l+1; m<=
DCay-2; m++) {
674 for (
int n=m+1;
n<=
DCay-1;
n++) {
676 if (lidx > uidx)
continue;
686 int powsign=-2*((i+j+k+l+m+
n)&0x1)+1;
689 pM3[
is(uidx,lidx)]=powsign*(
690 + (+
Kay(nu[0],nd[1])*
Kay(nu[1],nd[2])
691 -
Kay(nu[0],nd[2])*
Kay(nu[1],nd[1]))*
Kay(nu[2],nd[0])
692 + (+
Kay(nu[0],nd[2])*
Kay(nu[1],nd[0])
693 -
Kay(nu[0],nd[0])*
Kay(nu[1],nd[2]))*
Kay(nu[2],nd[1])
694 + (+
Kay(nu[0],nd[0])*
Kay(nu[1],nd[1])
695 -
Kay(nu[0],nd[1])*
Kay(nu[1],nd[0]))*
Kay(nu[2],nd[2])
700 for (
int l=1; l<=smax; l++) {
701 for (
int m=l+1; m<=
DCay-2; m++) {
702 for (
int n=m+1;
n<=
DCay-1;
n++) {
704 if (lidx > uidx)
continue;
714 int powsign=-2*((i+j+k+l+m+
n)&0x1)+1;
717 pM3[
is(uidx,lidx)]=powsign*(
718 + (+
Kay(nu[0],nd[1])*
Kay(nu[1],nd[2])
719 -
Kay(nu[0],nd[2])*
Kay(nu[1],nd[1]))
721 -
Kay(nu[1],nd[2]))*
Kay(nu[2],nd[1])
723 -
Kay(nu[0],nd[1]))*
Kay(nu[2],nd[2])
732 for (
int i=1; i<=smax; i++) {
733 for (
int j=i+1; j<=
DCay-2; j++) {
734 for (
int k=j+1; k<=
DCay-1; k++) {
735 const int uidx=
im3(i,j,k);
739 for (
int m=l+1; m<=
DCay-2; m++) {
740 for (
int n=m+1;
n<=
DCay-1;
n++) {
742 if (lidx > uidx)
continue;
752 int powsign=-2*((i+j+k+l+m+
n)&0x1)+1;
755 pM3[
is(uidx,lidx)]=powsign*(
757 -
Kay(nu[1],nd[1]))*
Kay(nu[2],nd[0])
759 -
Kay(nu[1],nd[2]))*
Kay(nu[2],nd[1])
761 -
Kay(nu[1],nd[0]))*
Kay(nu[2],nd[2])
766 for (
int l=1; l<=smax; l++) {
767 for (
int m=l+1; m<=
DCay-2; m++) {
768 for (
int n=m+1;
n<=
DCay-1;
n++) {
770 if (lidx > uidx)
continue;
780 int powsign=-2*((i+j+k+l+m+
n)&0x1)+1;
783 pM3[
is(uidx,lidx)]=powsign*(
811 if (not fEval[E_I4s+
ep]) {
814 return pI4s[
ep][
s-1];
816void Minor5::I4sEval(
int ep)
819 double p1=kinem.
p1();
820 double p2=kinem.
p2();
821 double p3=kinem.
p3();
822 double p4=kinem.
p4();
823 double p5=kinem.
p5();
826 double s34=kinem.
s34();
827 double s45=kinem.
s45();
828 double s15=kinem.
s15();
829 double m1=kinem.
m1();
830 double m2=kinem.
m2();
831 double m3=kinem.
m3();
832 double m4=kinem.
m4();
833 double m5=kinem.
m5();
835 pI4s[
ep][1-1]=
ICache::getI4(
ep,
Kinem4(
s12,
p3,
p4,p5,s45,s34,m5,
m2,
m3,
m4));
837 pI4s[
ep][2-1]=
ICache::getI4(
ep,
Kinem4(
p1,
s23,
p4,p5,s45,s15,m5,
m1,
m3,
m4));
838 pI4s[
ep][3-1]=
ICache::getI4(
ep,
Kinem4(
p1,
p2,s34,p5,
s12,s15,m5,
m1,
m2,
m4));
839 pI4s[
ep][4-1]=
ICache::getI4(
ep,
Kinem4(
p1,
p2,
p3,s45,
s12,
s23,m5,
m1,
m2,
m3));
840 pI4s[
ep][5-1]=
ICache::getI4(
ep,
Kinem4(
p2,
p3,
p4,s15,
s23,s34,
m1,
m2,
m3,
m4));
842 fEval[E_I4s+
ep]=
true;
852 if (not fEval[E_I3st+
ep]) {
855 int idx =
im2(
s,
t)-5;
856 return pI3st[
ep][idx];
859void Minor5::I3stEval(
int ep)
862 double p1=kinem.
p1();
863 double p2=kinem.
p2();
864 double p3=kinem.
p3();
865 double p4=kinem.
p4();
866 double p5=kinem.
p5();
869 double s34=kinem.
s34();
870 double s45=kinem.
s45();
871 double s15=kinem.
s15();
872 double m1=kinem.
m1();
873 double m2=kinem.
m2();
874 double m3=kinem.
m3();
875 double m4=kinem.
m4();
876 double m5=kinem.
m5();
891 fEval[E_I3st+
ep]=
true;
900 assert(
t!=u && u!=
s &&
s!=
t);
903 if (not fEval[E_I2stu+
ep]) {
906 int idx=
im3(
s,
t,u)-10;
907 return pI2stu[
ep][idx];
910void Minor5::I2stuEval(
int ep)
913 double p1=kinem.
p1();
914 double p2=kinem.
p2();
915 double p3=kinem.
p3();
916 double p4=kinem.
p4();
917 double p5=kinem.
p5();
920 double s34=kinem.
s34();
921 double s45=kinem.
s45();
922 double s15=kinem.
s15();
923 double m1=kinem.
m1();
924 double m2=kinem.
m2();
925 double m3=kinem.
m3();
926 double m4=kinem.
m4();
927 double m5=kinem.
m5();
942 fEval[E_I2stu+
ep]=
true;
959 if (not fEval[E_I4Ds+
ep]) {
962 return pI4Ds[
ep][
s-1];
965void Minor5::I4DsEval(
const int ep)
968 for (
int s=1;
s<=smax;
s++) {
969 const double dss=
M1(
s,
s);
970 const double d0s0s=
M2(0,
s, 0,
s);
974 for (
int t=1;
t<=5;
t++) {
981 const double x=dss/d0s0s;
982 if (pmaxS4[
s-1] <=
deps1) {
989 for (
int t=1;
t<=5;
t++) {
1001#define stepI4D(n,a,b) \
1004 for (int t=1; t<=5; t++) { \
1005 if (t==s) continue; \
1006 dv+=dsts0[t]*(a*I3D##n##st(0, s, t) - b*I3D##n##st(1, s, t)); \
1037 pI4Ds[
ep][
s-1]=ivalue;
1039 fEval[E_I4Ds+
ep]=
true;
1049 if (not fEval[E_I4Dsi+
ep]) {
1052 return pI4Dsi[
ep][i-1][
s-1];
1055void Minor5::I4DsiEval(
int ep)
1057 for (
int s=1;
s<=smax;
s++) {
1058 for (
int i=1; i<=
CIDX; i++) {
1062 if (pmaxS4[
s-1] <=
deps1 || (fabs(
M1(
s,
s))<1e-11 && fabs(
M2(0,
s,0,
s))>0) ) {
1064 for (
int t=1;
t<=5;
t++) {
1069 ivalue=sum1/
M2(0,
s, 0,
s);
1072 for (
int t=1;
t<=5;
t++) {
1077 ivalue=sum1/
M1(
s,
s);
1079 pI4Dsi[
ep][i-1][
s-1]=ivalue;
1082 fEval[E_I4Dsi+
ep]=
true;
1099 if (
ep==1)
return -0.5;
1100 else if (
ep==2)
return 0;
1101 if (not fEval[E_I3Dst+
ep]) {
1104 int idx =
im2(
s,
t)-5;
1105 return pI3Dst[
ep][idx];
1108void Minor5::I3DstEval(
int ep)
1111 for (
int s=1;
s<=smax;
s++) {
1112 for (
int t=
s+1;
t<=5;
t++) {
1113 int idx =
im2(
s,
t)-5;
1114 const double dstst=
M2(
s,
t,
s,
t);
1115 const double d0st0st=
M3(0,
s,
t,0,
s,
t);
1118 if ( pmaxT3[idx]!=0 && ( pmaxT3[idx] <=
epsir1 && pmaxU3[idx] <=
epsir1 ) ) {
1121 int iu[3]={i-1,
s-1,
t-1};
1123 tswap(iu[0],iu[2],tmp);
1124 tswap(iu[1],iu[2],tmp);
1125 tswap(iu[0],iu[1],tmp);
1130 const double Dii=M4ii(u,
v,i);
1131 const double Dui=M4ui(u,
v,i);
1132 const double Dvi=M4vi(u,
v,i);
1136 ivalue=0.5*sum1/
M3(0,
s,
t,i,
s,
t);
1137 }
else if (pmaxS3[idx] <=
ceps) {
1139 const double x=dstst/d0st0st;
1144 for (
int u=1; u<=5; u++) {
1145 if (u==
t || u==
s)
continue;
1146 dstust0[u]=
M3(
s,
t,u,
s,
t,0);
1147 sum1+=dstust0[u]*
I2Dstu(0,
s,
t, u);
1156#define stepI3D(n,a,b) \
1159 for (int u=1; u<=5; u++) { \
1160 if (u==t || u==s) continue; \
1161 dv+=dstust0[u]*(a*I2D##n##stu(0, s, t, u) - b*I2D##n##stu(1, s, t, u)); \
1186 ivalue=sump/d0st0st;
1190 for (
int u=1; u<=5; u++) {
1191 if (u==
t || u==
s)
continue;
1195 ivalue=sum1/(2*dstst)-0.5;
1197 pI3Dst[
ep][idx]=ivalue;
1200 fEval[E_I3Dst+
ep]=
true;
1210 if (
ep==1)
return 1./6.;
1211 else if (
ep==2)
return 0;
1212 if (not fEval[E_I4D2s+
ep]) {
1215 return pI4D2s[
ep][
s-1];
1218void Minor5::I4D2sEval(
int ep) {
1219 for (
int s=1;
s<=smax;
s++) {
1220 const double dss=
M1(
s,
s);
1221 const double d0s0s=
M2(0,
s, 0,
s);
1225 for (
int t=1;
t<=5;
t++) {
1230 ivalue=sum1/(3*dss)+1./9.;
1232 const double x=dss/d0s0s;
1233 if (pmaxS4[
s-1] <=
deps2) {
1240 for (
int t=1;
t<=5;
t++) {
1252#define stepI4D(n,a,b) \
1255 for (int t=1; t<=5; t++) { \
1256 if (t==s) continue; \
1257 dv+=dsts0[t]*(a*I3D##n##st(0, s, t) - b*I3D##n##st(1, s, t)); \
1286 pI4D2s[
ep][
s-1]=ivalue;
1288 fEval[E_I4D2s+
ep]=
true;
1305 if (
ep!=0)
return 0;
1306 if (not fEval[E_I4D2si+
ep]) {
1309 return pI4D2si[
ep][i-1][
s-1];
1312void Minor5::I4D2siEval(
int ep)
1314 for (
int s=1;
s<=smax;
s++) {
1315 for (
int i=1; i<=
CIDX; i++) {
1319 if (pmaxS4[
s-1] <=
deps2 || (fabs(
M1(
s,
s))<1e-11 && fabs(
M2(0,
s,0,
s))>0) ) {
1321 for (
int t=1;
t<=5;
t++) {
1326 ivalue=sum1/
M2(0,
s, 0,
s);
1329 for (
int t=1;
t<=5;
t++) {
1334 ivalue=sum1/
M1(
s,
s);
1347 pI4D2si[
ep][i-1][
s-1]=ivalue;
1350 fEval[E_I4D2si+
ep]=
true;
1359 assert(
s!=
t &&
s!=i &&
t!=i);
1360 if (not fEval[E_I3Dsti+
ep]) {
1363 int idx =
im2(
s,
t)-5;
1364 return pI3Dsti[
ep][i-1][idx];
1367void Minor5::I3DstiEval(
int ep)
1369 for (
int i=1; i<=
CIDX; i++) {
1370 for (
int s=1;
s<=smax;
s++) {
if (i==
s)
continue;
1371 for (
int t=
s+1;
t<=5;
t++) {
if (i==
t)
continue;
1372 int idx =
im2(
s,
t)-5;
1374 const double ds0ts0t=
M3(
s,0,
t,
s,0,
t);
1375 if (
ep!=0 && fabs(ds0ts0t) >
m3eps) {
1376 pI3Dsti[
ep][i-1][idx]=0;
1383 ( (pmaxT3[idx]==0 || (pmaxT3[idx] >
epsir2 || pmaxU3[idx] >
epsir2))
1384 && pmaxS3[idx] >
ceps ) ) {
1387 for (
int u=1; u<=5; u++) {
1388 if (u==
t || u==
s)
continue;
1395 int iu[3]={i-1,
s-1,
t-1};
1397 tswap(iu[0],iu[2],tmp);
1398 tswap(iu[1],iu[2],tmp);
1399 tswap(iu[0],iu[1],tmp);
1405 if ( pmaxT3[idx] <=
epsir2 && pmaxU3[idx] <=
epsir2 ) {
1411 ncomplex const I2Uterm=I2stui(
ep,
s,
t,u,i,
v)+2.*I2stui(
ep+1,
s,
t,u,i,
v);
1412 ncomplex const I2Vterm=I2stui(
ep,
s,
t,
v,i,u)+2.*I2stui(
ep+1,
s,
t,
v,i,u);
1414 const double Dii=M4ii(u,
v,i);
1415 const double Dui=M4ui(u,
v,i);
1416 const double Dvi=M4vi(u,
v,i);
1421 const double Dui=M4ui(u,
v,i);
1422 const double Duu=M4uu(u,
v,i);
1423 const double Dvu=M4vu(u,
v,i);
1427 }
else { assert(j==
v);
1428 const double Dvi=M4vi(u,
v,i);
1429 const double Dvu=M4vu(u,
v,i);
1430 const double Dvv=M4vv(u,
v,i);
1435 ivalue=sum1/(
M3(
s,0,
t,
s,j,
t));
1439 const double Dii=M4ii(u,
v,i);
1440 const double Dui=M4ui(u,
v,i);
1441 const double Dvi=M4vi(u,
v,i);
1446 ivalue=sum1/ds0ts0t;
1449 pI3Dsti[
ep][i-1][idx]=ivalue;
1453 fEval[E_I3Dsti+
ep]=
true;
1462 if (
s==i ||
s==j)
return 0;
1463 if (not fEval[E_I4D2sij+
ep]) {
1466 return pI4D2sij[
ep][
is(i-1,j-1)][
s-1];
1469void Minor5::I4D2sijEval(
int ep)
1471 for (
int s=1;
s<=smax;
s++) {
1473 for (
int i=1; i<=
CIDX; i++) {
if (
s==i)
continue;
1474 for (
int j=i; j<=
CIDX; j++) {
if (
s==j)
continue;
1477 if (pmaxS4[
s-1] <=
deps2 || (fabs(
M1(
s,
s))<1e-11 && fabs(
M2(0,
s,0,
s))>0) ) {
1479 for (
int t=1;
t<=5;
t++) {
1480 if (
t==
s ||
t==i)
continue;
1485 ivalue=sum1/
M2(0,
s, 0,
s);
1488 for (
int t=1;
t<=5;
t++) {
1489 if (
t==
s ||
t==i)
continue;
1494 ivalue=sum1/
M1(
s,
s);
1496 pI4D2sij[
ep][
iss(i-1,j-1)][
s-1]=ivalue;
1500 fEval[E_I4D2sij+
ep]=
true;
1516 assert(
t!=u && u!=
s &&
s!=
t);
1517 if (
ep==2)
return 0;
1518 if (not fEval[E_I2Dstu+
ep]) {
1519 I2DstuEval(0,
ep,1,2,3,4,5,kinem.
p5());
1520 I2DstuEval(1,
ep,1,2,4,3,5,kinem.
s45());
1521 I2DstuEval(2,
ep,1,2,5,3,4,kinem.
p4());
1523 I2DstuEval(3,
ep,1,3,4,2,5,kinem.
s12());
1524 I2DstuEval(4,
ep,1,3,5,2,4,kinem.
s34());
1526 I2DstuEval(5,
ep,1,4,5,2,3,kinem.
p3());
1529 I2DstuEval(6,
ep,2,3,4,1,5,kinem.
p1());
1530 I2DstuEval(7,
ep,2,3,5,1,4,kinem.
s15());
1532 I2DstuEval(8,
ep,2,4,5,1,3,kinem.
s23());
1535 I2DstuEval(9,
ep,3,4,5,1,2,kinem.
p2());
1538 fEval[E_I2Dstu+
ep]=
true;
1540 int idx=
im3(
s,
t,u)-10;
1541 return pI2Dstu[
ep][idx];
1544void Minor5::I2DstuEval(
int idx,
int ep,
int s,
int t,
int u,
int m,
int n,
double qsq)
1548 const double dstustu=-2*qsq;
1550 const double msq1=kinem.
mass(m);
1551 const double msq2=kinem.
mass(
n);
1552 const double s_cutoff=
seps1*pmaxM2[
im2(m,
n)-5];
1554 if (fabs(dstustu) <= s_cutoff) {
1555 const double mm12=msq1-msq2;
1556 if (fabs(mm12) <
meps) {
1560 sum1= - 0.25*( msq1 + msq2 )
1583 else { assert(
ep==1);
1586 pI2Dstu[
ep][idx]=sum1;
1596 if (
ep==2)
return 0;
1597 if (not fEval[E_I3D2st+
ep]) {
1600 int idx =
im2(
s,
t)-5;
1601 return pI3D2st[
ep][idx];
1604void Minor5::I3D2stEval(
int ep)
1606 for (
int s=1;
s<=smax;
s++) {
1607 for (
int t=
s+1;
t<=5;
t++) {
1608 int idx =
im2(
s,
t)-5;
1612 const double dstst=
M2(
s,
t,
s,
t);
1613 const double d0st0st=
M3(0,
s,
t,0,
s,
t);
1615 if ( pmaxT3[idx]!=0 && ( pmaxT3[idx] <=
epsir1 && pmaxU3[idx] <=
epsir1 ) ) {
1618 int iu[3]={i-1,
s-1,
t-1};
1620 tswap(iu[0],iu[2],tmp);
1621 tswap(iu[1],iu[2],tmp);
1622 tswap(iu[0],iu[1],tmp);
1627 const double Dii=M4ii(u,
v,i);
1628 const double Dui=M4ui(u,
v,i);
1629 const double Dvi=M4vi(u,
v,i);
1633 ivalue=0.25*sum1/
M3(0,
s,
t,i,
s,
t);
1634 }
else if (pmaxS3[idx] <=
ceps) {
1636 const double x=dstst/d0st0st;
1641 for (
int u=1; u<=5; u++) {
1642 if (u==
t || u==
s)
continue;
1643 dstust0[u]=
M3(
s,
t,u,
s,
t,0);
1653#define stepI3D(n,a,b) \
1656 for (int u=1; u<=5; u++) { \
1657 if (u==t || u==s) continue; \
1658 dv+=dstust0[u]*(a*I2D##n##stu(0, s, t, u) - b*I2D##n##stu(1, s, t, u)); \
1683 ivalue=sump/d0st0st;
1687 for (
int u=1; u<=5; u++) {
1688 if (u==
t || u==
s)
continue;
1692 ivalue=sum1/(4*dstst)+
I3D2st(
ep+1,
s,
t)*0.5;
1702 pI3D2st[
ep][idx]=ivalue;
1705 fEval[E_I3D2st+
ep]=
true;
1714 if (
ep==2)
return 0;
1715 if (not fEval[E_I4D3s+
ep]) {
1718 return pI4D3s[
ep][
s-1];
1720void Minor5::I4D3sEval(
int ep)
1722 for (
int s=1;
s<=smax;
s++) {
1723 const double dss=
M1(
s,
s);
1724 const double d0s0s=
M2(0,
s, 0,
s);
1729 for (
int t=1;
t<=5;
t++) {
1734 ivalue=sum1/(5*dss)+2.*
I4D3s(
ep+1,
s)/5.;
1736 const double x=dss/d0s0s;
1737 if (pmaxS4[
s-1] <=
deps3) {
1744 for (
int t=1;
t<=5;
t++) {
1756#define stepI4D(n,a,b) \
1759 for (int t=1; t<=5; t++) { \
1760 if (t==s) continue; \
1761 dv+=dsts0[t]*(a*I3D##n##st(0, s, t) - b*I3D##n##st(1, s, t)); \
1794 for (
int i=1; i<=5; i++) {
if (i==
s)
continue;
1795 for (
int j=i; j<=5; j++) {
if (j==
s)
continue;
1801 pI4D3s[
ep][
s-1]=ivalue;
1803 fEval[E_I4D3s+
ep]=
true;
1812 assert(
s!=
t &&
s!=i &&
t!=i);
1813 if (
ep==1)
return 1./6.;
1814 else if (
ep==2)
return 0.;
1815 if (not fEval[E_I3D2sti+
ep]) {
1818 int idx =
im2(
s,
t)-5;
1819 return pI3D2sti[
ep][i-1][idx];
1822void Minor5::I3D2stiEval(
int ep)
1824 for (
int i=1; i<=
CIDX; i++) {
1825 for (
int s=1;
s<=smax;
s++) {
if (i==
s)
continue;
1826 for (
int t=
s+1;
t<=5;
t++) {
if (i==
t)
continue;
1827 int idx =
im2(
s,
t)-5;
1830 if ( (pmaxT3[idx]==0 || (pmaxT3[idx] >
epsir2 || pmaxU3[idx] >
epsir2))
1831 && pmaxS3[idx] >
ceps ) {
1834 for (
int u=1; u<=5; u++) {
1835 if (u==
t || u==
s)
continue;
1842 int iu[3]={i-1,
s-1,
t-1};
1844 tswap(iu[0],iu[2],tmp);
1845 tswap(iu[1],iu[2],tmp);
1846 tswap(iu[0],iu[1],tmp);
1852 if ( pmaxT3[idx] <=
epsir2 && pmaxU3[idx] <=
epsir2 ) {
1861 const double Dii=M4ii(u,
v,i);
1862 const double Dui=M4ui(u,
v,i);
1863 const double Dvi=M4vi(u,
v,i);
1868 const double Dui=M4ui(u,
v,i);
1869 const double Duu=M4uu(u,
v,i);
1870 const double Dvu=M4vu(u,
v,i);
1874 }
else { assert(j==
v);
1875 const double Dvi=M4vi(u,
v,i);
1876 const double Dvv=M4vv(u,
v,i);
1877 const double Dvu=M4vu(u,
v,i);
1882 ivalue=sum1/(3*
M3(
s,0,
t,
s,j,
t));
1885 const double Dii=M4ii(u,
v,i);
1886 const double Dui=M4ui(u,
v,i);
1887 const double Dvi=M4vi(u,
v,i);
1893 ivalue=sum1/
M3(
s,0,
t,
s,0,
t);
1896 pI3D2sti[
ep][i-1][idx]=ivalue;
1900 fEval[E_I3D2sti+
ep]=
true;
1910 if (
ep==1)
return -1./24.;
1911 else if (
ep==2)
return 0;
1912 if (not fEval[E_I4D3si+
ep]) {
1915 return pI4D3si[
ep][i-1][
s-1];
1918void Minor5::I4D3siEval(
int ep)
1920 for (
int s=1;
s<=smax;
s++) {
1921 for (
int i=1; i<=
CIDX; i++) {
1925 if (pmaxS4[
s-1] <=
deps3) {
1927 for (
int t=1;
t<=5;
t++) {
1932 ivalue=sum1/
M2(0,
s, 0,
s);
1935 for (
int t=1;
t<=5;
t++) {
1940 ivalue=sum1/
M1(
s,
s);
1942 pI4D3si[
ep][i-1][
s-1]=ivalue;
1945 fEval[E_I4D3si+
ep]=
true;
1954 if (
s==i ||
s==j)
return 0;
1955 else if (
ep!=0)
return 0;
1956 if (not fEval[E_I4D3sij+
ep]) {
1959 return pI4D3sij[
ep][
is(i-1,j-1)][
s-1];
1962void Minor5::I4D3sijEval(
int ep)
1964 for (
int s=1;
s<=smax;
s++) {
1966 for (
int i=1; i<=
CIDX; i++) {
if (
s==i)
continue;
1967 for (
int j=i; j<=
CIDX; j++) {
if (
s==j)
continue;
1970 if (pmaxS4[
s-1] <=
deps3) {
1972 for (
int t=1;
t<=5;
t++) {
1973 if (
t==
s ||
t==i)
continue;
1978 ivalue=sum1/
M2(0,
s,0,
s);
1981 for (
int t=1;
t<=5;
t++) {
1982 if (
t==
s ||
t==i)
continue;
1987 ivalue=sum1/
M1(
s,
s);
1989 pI4D3sij[
ep][
iss(i-1,j-1)][
s-1]=ivalue;
1993 fEval[E_I4D3sij+
ep]=
true;
2003 assert(
s!=
t &&
t!=u && u!=
s &&
s!=i &&
t!=i && u!=i);
2005 if (
ep==2)
return 0;
2006 if (not fEval[E_I2Dstui+
ep]) {
2007 I2DstuiEval(
ep,1,4,5,2,3,kinem.
p3());
2008 I2DstuiEval(
ep,1,3,5,2,4,kinem.
s34());
2009 I2DstuiEval(
ep,1,3,4,2,5,kinem.
s12());
2010 I2DstuiEval(
ep,1,4,5,3,2,kinem.
p3());
2011 I2DstuiEval(
ep,1,2,5,3,4,kinem.
p4());
2012 I2DstuiEval(
ep,1,2,4,3,5,kinem.
s45());
2013 I2DstuiEval(
ep,1,3,5,4,2,kinem.
s34());
2014 I2DstuiEval(
ep,1,2,5,4,3,kinem.
p4());
2015 I2DstuiEval(
ep,1,2,3,4,5,kinem.
p5());
2016#ifdef USE_ZERO_CHORD
2017 I2DstuiEval(
ep,1,3,4,5,2,kinem.
s12());
2018 I2DstuiEval(
ep,1,2,4,5,3,kinem.
s45());
2019 I2DstuiEval(
ep,1,2,3,5,4,kinem.
p5());
2023 I2DstuiEval(
ep,3,4,5,1,2,kinem.
p2());
2024 I2DstuiEval(
ep,2,4,5,1,3,kinem.
s23());
2025 I2DstuiEval(
ep,2,3,5,1,4,kinem.
s15());
2026 I2DstuiEval(
ep,2,3,4,1,5,kinem.
p1());
2027 I2DstuiEval(
ep,3,4,5,2,1,kinem.
p2());
2028 I2DstuiEval(
ep,2,4,5,3,1,kinem.
s23());
2029 I2DstuiEval(
ep,2,3,5,4,1,kinem.
s15());
2030#ifdef USE_ZERO_CHORD
2031 I2DstuiEval(
ep,2,3,4,5,1,kinem.
p1());
2035 fEval[E_I2Dstui+
ep]=
true;
2038 return pI2Dstui[
ep][i-1][ip-1];
2041void Minor5::I2DstuiEval(
int ep,
int s,
int t,
int u,
int i,
int ip,
double qsq)
2045 const double dstustu=-2*qsq;
2046 const double msq1=kinem.
mass(i);
2047 const double msq2=kinem.
mass(ip);
2048 const double s_cutoff=
seps1*pmaxM2[
im2(i,ip)-5];
2050 if (fabs(dstustu) <= s_cutoff) {
2051 const double mm12=msq1-msq2;
2052 if (fabs(mm12) <
meps) {
2060 sum1=(msq1 + msq2)/(4*msq1 - 4*msq2)
2073 else { assert(
ep==1);
2074 if ( fabs(qsq) <
meps
2083 pI2Dstui[
ep][i-1][ip-1]=sum1;
2092 assert(
s!=
t &&
s!=i &&
s!=j &&
t!=i &&
t!=j);
2093 if (not fEval[E_I3D2stij+
ep]) {
2096 int idx =
im2(
s,
t)-5;
2097 return pI3D2stij[
ep][
is(i-1,j-1)][idx];
2100void Minor5::I3D2stijEval(
int ep)
2102 for (
int s=1;
s<=smax;
s++) {
2103 for (
int t=
s+1;
t<=5;
t++) {
2104 int idx =
im2(
s,
t)-5;
2106 const double ds0ts0t=
M3(
s,0,
t,
s,0,
t);
2107 if (
ep!=0 && fabs(ds0ts0t) >
m3eps) {
2109 pI3D2stij[
ep][ij][idx]=0;
2114 const double dstst=
M2(
s,
t,
s,
t);
2116 for (
int i=1; i<=
CIDX; i++) {
if (i==
s || i==
t)
continue;
2117 for (
int j=i; j<=
CIDX; j++) {
if (j==
s || j==
t)
continue;
2120 if (pmaxS3[idx] >
ceps ||
ep!=0) {
2123 for (
int u=1; u<=5; u++) {
2124 if (u==
t || u==
s || u==i)
continue;
2127 sum1+=-
M3(
s,0,
t,
s,j,
t)*
I3Dsti(
ep,
s,
t, i)+
M3(
s,i,
t,
s,j,
t)*
I3Dst(
ep,
s,
t);
2131 int iu[3]={j-1,
s-1,
t-1};
2133 tswap(iu[0],iu[2],tmp);
2134 tswap(iu[1],iu[2],tmp);
2135 tswap(iu[0],iu[1],tmp);
2140 const double Djj=M4ii(u,
v,j);
2141 const double Duj=M4ui(u,
v,j);
2142 const double Dvj=M4vi(u,
v,j);
2143 if ( fabs(ds0ts0t) > 0. ) {
2159 sum1+=
M3(
s,0,
t,
s,j,
t)*(-3.*
I3D2sti(
ep,
s,
t, i)+2.*
I3D2sti(
ep+1,
s,
t, i));
2162 ivalue=sum1/ds0ts0t;
2164 ivalue=std::numeric_limits<double>::quiet_NaN();
2168 pI3D2stij[
ep][
iss(i-1,j-1)][idx]=ivalue;
2173 fEval[E_I3D2stij+
ep]=
true;
2182 if (
s==i ||
s==j ||
s==k)
return 0;
2183 if (not fEval[E_I4D3sijk+
ep]) {
2186 return pI4D3sijk[
ep][
is(i-1,j-1,k-1)][
s-1];
2189void Minor5::I4D3sijkEval(
int ep)
2191 for (
int s=1;
s<=smax;
s++) {
2193 for (
int i=1; i<=
CIDX; i++) {
if (i==
s)
continue;
2194 for (
int j=i; j<=
CIDX; j++) {
if (j==
s)
continue;
2195 for (
int k=j; k<=
CIDX; k++) {
if (k==
s)
continue;
2198 if (pmaxS4[
s-1] <=
deps3) {
2200 for (
int t=1;
t<=5;
t++) {
2201 if (
s==
t ||
t==i ||
t==j)
continue;
2212 ivalue=sum1/
M2(
s,0,
s,0);
2215 for (
int t=1;
t<=5;
t++) {
2216 if (
t==
s ||
t==i ||
t==j)
continue;
2220 sum1+=
M2(
s,i,
s,k)*
I4D2si(
ep,
s,j)+
M2(
s,j,
s,k)*
I4D2si(
ep,
s,i);
2221 ivalue=sum1/
M1(
s,
s);
2223 pI4D3sijk[
ep][
iss(i-1,j-1,k-1)][
s-1]=ivalue;
2228 fEval[E_I4D3sijk+
ep]=
true;
2244 assert(
t!=u && u!=
s &&
s!=
t);
2245 if (
ep==2)
return 0;
2246 if (not fEval[E_I2D2stu+
ep]) {
2247 I2D2stuEval(0,
ep,1,2,3,4,5,kinem.
p5());
2248 I2D2stuEval(1,
ep,1,2,4,3,5,kinem.
s45());
2249 I2D2stuEval(2,
ep,1,2,5,3,4,kinem.
p4());
2251 I2D2stuEval(3,
ep,1,3,4,2,5,kinem.
s12());
2252 I2D2stuEval(4,
ep,1,3,5,2,4,kinem.
s34());
2254 I2D2stuEval(5,
ep,1,4,5,2,3,kinem.
p3());
2257 I2D2stuEval(6,
ep,2,3,4,1,5,kinem.
p1());
2258 I2D2stuEval(7,
ep,2,3,5,1,4,kinem.
s15());
2260 I2D2stuEval(8,
ep,2,4,5,1,3,kinem.
s23());
2263 I2D2stuEval(9,
ep,3,4,5,1,2,kinem.
p2());
2266 fEval[E_I2D2stu+
ep]=
true;
2268 int idx=
im3(
s,
t,u)-10;
2269 return pI2D2stu[
ep][idx];
2272void Minor5::I2D2stuEval(
int idx,
int ep,
int s,
int t,
int u,
int m,
int n,
double qsq)
2276 const double dstustu=-2*qsq;
2277 const double msq1=kinem.
mass(m);
2278 const double msq2=kinem.
mass(
n);
2279 const double s_cutoff=
seps1*pmaxM2[
im2(m,
n)-5];
2281 if (fabs(dstustu) <= s_cutoff) {
2282 const double mm12=msq1-msq2;
2283 if (fabs(mm12) <
meps) {
2287 sum1= 5*(msq1*msq1 + msq1*msq2 + msq2*msq2)/36
2310 else { assert(
ep==1);
2311 const double y11=
Cay[
nss(m,m)];
2312 const double y12=
Cay[
nss(m,
n)];
2314 sum1= ( 3*( y11*(y11+y12)+(y12+y22)*y22)+2*y12*y12+y11*y22 )/120;
2316 pI2D2stu[
ep][idx]=sum1;
2326 if (
ep==2)
return 0;
2327 if (not fEval[E_I3D3st+
ep]) {
2330 int idx =
im2(
s,
t)-5;
2331 return pI3D3st[
ep][idx];
2334void Minor5::I3D3stEval(
int ep)
2336 for (
int s=1;
s<=smax;
s++) {
2337 for (
int t=
s+1;
t<=5;
t++) {
2338 int idx =
im2(
s,
t)-5;
2342 const double dstst=
M2(
s,
t,
s,
t);
2343 const double d0st0st=
M3(0,
s,
t,0,
s,
t);
2345 if ( pmaxT3[idx]!=0 && ( pmaxT3[idx] <=
epsir1 && pmaxU3[idx] <=
epsir1 ) ) {
2348 int iu[3]={i-1,
s-1,
t-1};
2350 tswap(iu[0],iu[2],tmp);
2351 tswap(iu[1],iu[2],tmp);
2352 tswap(iu[0],iu[1],tmp);
2357 const double Dii=M4ii(u,
v,i);
2358 const double Dui=M4ui(u,
v,i);
2359 const double Dvi=M4vi(u,
v,i);
2363 ivalue=sum1/(6*
M3(0,
s,
t,i,
s,
t));
2364 }
else if (pmaxS3[idx] <=
ceps) {
2366 const double x=dstst/d0st0st;
2373 for (
int u=1; u<=5; u++) {
2374 if (u==
t || u==
s)
continue;
2375 dstust0[u]=
M3(
s,
t,u,
s,
t,0);
2385#define stepI3D(n,a,b) \
2388 for (int u=1; u<=5; u++) { \
2389 if (u==t || u==s) continue; \
2390 dv+=dstust0[u]*(a*I2D##n##stu(0, s, t, u) - b*I2D##n##stu(1, s, t, u)); \
2415 ivalue=sump/d0st0st;
2419 for (
int u=1; u<=5; u++) {
2420 if (u==
t || u==
s)
continue;
2431 const double y11=
Cay[
nss(nu[0],nu[0])];
2432 const double y12=
Cay[
nss(nu[0],nu[1])];
2433 const double y13=
Cay[
nss(nu[0],nu[2])];
2434 const double y22=
Cay[
nss(nu[1],nu[1])];
2435 const double y23=
Cay[
nss(nu[1],nu[2])];
2436 const double y33=
Cay[
nss(nu[2],nu[2])];
2437 ivalue=-(+3*(y11*(y11+y12+y13)+y22*(y12+y22+y23)+y33*(y13+y23+y33))
2438 +2*(y12*(y12+y23)+y13*(y12+y13)+y23*(y13+y23))
2439 + (y11*(y22+y23)+y22*(y13+y33)+y33*(y11+y12))
2442 pI3D3st[
ep][idx]=ivalue;
2445 fEval[E_I3D3st+
ep]=
true;
2454 if (
ep==2)
return 0;
2455 if (not fEval[E_I4D4s+
ep]) {
2458 return pI4D4s[
ep][
s-1];
2461void Minor5::I4D4sEval(
int ep)
2463 for (
int s=1;
s<=smax;
s++) {
2464 const double dss=
M1(
s,
s);
2465 const double d0s0s=
M2(0,
s, 0,
s);
2470 for (
int t=1;
t<=5;
t++) {
2475 ivalue=sum1/(7*dss)+2.*
I4D4s(
ep+1,
s)/7.;
2477 const double x=dss/d0s0s;
2478 if (pmaxS4[
s-1] <=
deps3) {
2485 for (
int t=1;
t<=5;
t++) {
2497#define stepI4D(n,a,b) \
2500 for (int t=1; t<=5; t++) { \
2501 if (t==s) continue; \
2502 dv+=dsts0[t]*(a*I3D##n##st(0, s, t) - b*I3D##n##st(1, s, t)); \
2536 for (
int i=1; i<=5; i++) {
if (i==
s)
continue;
2537 for (
int j=i; j<=5; j++) {
if (j==
s)
continue;
2538 for (
int k=j; k<=5; k++) {
if (k==
s)
continue;
2539 for (
int l=k; l<=5; l++) {
if (l==
s)
continue;
2549 pI4D4s[
ep][
s-1]=ivalue;
2551 fEval[E_I4D4s+
ep]=
true;
2562 if (
ep==2)
return 0;
2563 if (not fEval[E_I4D4si+
ep]) {
2566 return pI4D4si[
ep][i-1][
s-1];
2569void Minor5::I4D4siEval(
int ep)
2571 for (
int s=1;
s<=smax;
s++) {
2572 for (
int i=1; i<=
CIDX; i++) {
if (
s==i)
continue;
2576 if (pmaxS4[
s-1] <=
deps3) {
2578 for (
int t=1;
t<=5;
t++) {
2583 ivalue=sum1/
M2(0,
s, 0,
s);
2586 for (
int t=1;
t<=5;
t++) {
2598 for (
int j=1; j<=5; j++) {
2601 for (
int k=j; k<=5; k++) {
2608 pI4D4si[
ep][i-1][
s-1]=ivalue;
2611 fEval[E_I4D4si+
ep]=
true;
2620 assert(
s!=
t &&
s!=i &&
t!=i);
2621 if (
ep==2)
return 0.;
2622 if (not fEval[E_I3D3sti+
ep]) {
2625 int idx =
im2(
s,
t)-5;
2626 return pI3D3sti[
ep][i-1][idx];
2629void Minor5::I3D3stiEval(
int ep)
2631 for (
int i=1; i<=
CIDX; i++) {
2632 for (
int s=1;
s<=smax;
s++) {
if (i==
s)
continue;
2633 for (
int t=
s+1;
t<=5;
t++) {
if (i==
t)
continue;
2634 int idx =
im2(
s,
t)-5;
2638 if ( (pmaxT3[idx]==0 || (pmaxT3[idx] >
epsir2 || pmaxU3[idx] >
epsir2))
2639 && pmaxS3[idx] >
ceps ) {
2642 for (
int u=1; u<=5; u++) {
2643 if (u==
t || u==
s)
continue;
2650 int iu[3]={i-1,
s-1,
t-1};
2652 tswap(iu[0],iu[2],tmp);
2653 tswap(iu[1],iu[2],tmp);
2654 tswap(iu[0],iu[1],tmp);
2660 if ( pmaxT3[idx] <=
epsir2 && pmaxU3[idx] <=
epsir2 ) {
2669 const double Dii=M4ii(u,
v,i);
2670 const double Dui=M4ui(u,
v,i);
2671 const double Dvi=M4vi(u,
v,i);
2676 const double Dui=M4ui(u,
v,i);
2677 const double Duu=M4uu(u,
v,i);
2678 const double Dvu=M4vu(u,
v,i);
2682 }
else { assert(j==
v);
2683 const double Dvi=M4vi(u,
v,i);
2684 const double Dvv=M4vv(u,
v,i);
2685 const double Dvu=M4vu(u,
v,i);
2690 ivalue=sum1/(5*
M3(
s,0,
t,
s,j,
t));
2693 const double Dii=M4ii(u,
v,i);
2694 const double Dui=M4ui(u,
v,i);
2695 const double Dvi=M4vi(u,
v,i);
2701 ivalue=sum1/
M3(
s,0,
t,
s,0,
t);
2709 int j= nu[1]==i ? nu[0] : nu[1];
2710 int k= nu[2]==i ? nu[0] : nu[2];
2715 pI3D3sti[
ep][i-1][idx]=ivalue;
2719 fEval[E_I3D3sti+
ep]=
true;
2728 if (
s==i ||
s==j)
return 0;
2729 if (
ep==1)
return ( i==j ? 1./60. : 1./120. );
2730 else if (
ep==2)
return 0;
2731 if (not fEval[E_I4D4sij+
ep]) {
2734 return pI4D4sij[
ep][
is(i-1,j-1)][
s-1];
2737void Minor5::I4D4sijEval(
int ep)
2739 for (
int s=1;
s<=smax;
s++) {
2741 for (
int i=1; i<=
CIDX; i++) {
if (
s==i)
continue;
2742 for (
int j=i; j<=
CIDX; j++) {
if (
s==j)
continue;
2745 if (pmaxS4[
s-1] <=
deps3) {
2747 for (
int t=1;
t<=5;
t++) {
2748 if (
t==
s ||
t==i)
continue;
2753 ivalue=sum1/
M2(0,
s,0,
s);
2756 for (
int t=1;
t<=5;
t++) {
2757 if (
t==
s ||
t==i)
continue;
2765 pI4D4sij[
ep][
iss(i-1,j-1)][
s-1]=ivalue;
2769 fEval[E_I4D4sij+
ep]=
true;
2778 assert(
s!=
t &&
t!=u && u!=
s &&
s!=i &&
t!=i && u!=i);
2779 if (
ep==2)
return 0;
2780 if (not fEval[E_I2D2stui+
ep]) {
2781 I2D2stuiEval(
ep,1,4,5,2,3,kinem.
p3());
2782 I2D2stuiEval(
ep,1,3,5,2,4,kinem.
s34());
2783 I2D2stuiEval(
ep,1,3,4,2,5,kinem.
s12());
2784 I2D2stuiEval(
ep,1,4,5,3,2,kinem.
p3());
2785 I2D2stuiEval(
ep,1,2,5,3,4,kinem.
p4());
2786 I2D2stuiEval(
ep,1,2,4,3,5,kinem.
s45());
2787 I2D2stuiEval(
ep,1,3,5,4,2,kinem.
s34());
2788 I2D2stuiEval(
ep,1,2,5,4,3,kinem.
p4());
2789 I2D2stuiEval(
ep,1,2,3,4,5,kinem.
p5());
2790#ifdef USE_ZERO_CHORD
2791 I2D2stuiEval(
ep,1,3,4,5,2,kinem.
s12());
2792 I2D2stuiEval(
ep,1,2,4,5,3,kinem.
s45());
2793 I2D2stuiEval(
ep,1,2,3,5,4,kinem.
p5());
2797 I2D2stuiEval(
ep,3,4,5,1,2,kinem.
p2());
2798 I2D2stuiEval(
ep,2,4,5,1,3,kinem.
s23());
2799 I2D2stuiEval(
ep,2,3,5,1,4,kinem.
s15());
2800 I2D2stuiEval(
ep,2,3,4,1,5,kinem.
p1());
2801 I2D2stuiEval(
ep,3,4,5,2,1,kinem.
p2());
2802 I2D2stuiEval(
ep,2,4,5,3,1,kinem.
s23());
2803 I2D2stuiEval(
ep,2,3,5,4,1,kinem.
s15());
2804#ifdef USE_ZERO_CHORD
2805 I2D2stuiEval(
ep,2,3,4,5,1,kinem.
p1());
2809 fEval[E_I2D2stui+
ep]=
true;
2812 return pI2D2stui[
ep][i-1][ip-1];
2815void Minor5::I2D2stuiEval(
int ep,
int s,
int t,
int u,
int i,
int ip,
double qsq)
2819 const double dstustu=-2*qsq;
2820 const double msq1=kinem.
mass(i);
2821 const double msq2=kinem.
mass(ip);
2822 const double s_cutoff=
seps1*pmaxM2[
im2(i,ip)-5];
2824 if (fabs(dstustu) <= s_cutoff) {
2825 const double mm12=msq1-msq2;
2826 if (fabs(mm12) <
meps) {
2829 else { assert(
ep==0);
2830 sum1=(4*msq1*msq1-5*(msq1+msq2)*msq2)/(36*mm12)
2843 else { assert(
ep==1);
2844 if ( fabs(qsq) <
meps
2853 pI2D2stui[
ep][i-1][ip-1]=sum1;
2863 assert(
s!=
t &&
s!=i &&
s!=j &&
t!=i &&
t!=j);
2864 if (
ep==1)
return ( i==j ? -1./12. : -1./24. );
2865 else if (
ep==2)
return 0;
2866 if (not fEval[E_I3D3stij+
ep]) {
2869 int idx =
im2(
s,
t)-5;
2870 return pI3D3stij[
ep][
is(i-1,j-1)][idx];
2873void Minor5::I3D3stijEval(
int ep)
2875 for (
int s=1;
s<=smax;
s++) {
2876 for (
int t=
s+1;
t<=5;
t++) {
2877 int idx =
im2(
s,
t)-5;
2878 const double dstst=
M2(
s,
t,
s,
t);
2880 for (
int i=1; i<=
CIDX; i++) {
if (i==
s || i==
t)
continue;
2881 for (
int j=i; j<=
CIDX; j++) {
if (j==
s || j==
t)
continue;
2884 if ( (pmaxT3[idx]==0 || (pmaxT3[idx] >
epsir2 || pmaxU3[idx] >
epsir2))
2885 && pmaxS3[idx] >
ceps ) {
2888 for (
int u=1; u<=5; u++) {
2889 if (u==
t || u==
s || u==i)
continue;
2892 sum1+=-
M3(
s,0,
t,
s,j,
t)*
I3D2sti(
ep,
s,
t, i)+
M3(
s,i,
t,
s,j,
t)*
I3D2st(
ep,
s,
t);
2896 int iu[3]={j-1,
s-1,
t-1};
2898 tswap(iu[0],iu[2],tmp);
2899 tswap(iu[1],iu[2],tmp);
2900 tswap(iu[0],iu[1],tmp);
2906 const double Djj=M4ii(u,
v,j);
2907 const double Duj=M4ui(u,
v,j);
2908 const double Dvj=M4vi(u,
v,j);
2909 if ( pmaxT3[idx] <=
epsir2 && pmaxU3[idx] <=
epsir2 ) {
2916 +Duj*(
I2D2stuij(
ep,
s,
t,u,j,j)+0.5*
I2D2stuij(
ep+1,
s,
t,u,j,j))
2917 +Dvj*(
I2D2stuij(
ep,
s,
t,
v,j,j)+0.5*
I2D2stuij(
ep+1,
s,
t,
v,j,j));
2919 const double Duu=M4uu(u,
v,j);
2920 const double Duv=M4vu(u,
v,j);
2922 +Duu*(
I2D2stuij(
ep,
s,
t,u,j,j)+0.5*
I2D2stuij(
ep+1,
s,
t,u,j,j))
2923 +Duv*(
I2D2stuij(
ep,
s,
t,
v,j,j)+0.5*
I2D2stuij(
ep+1,
s,
t,
v,j,j));
2925 const double Dvv=M4vv(u,
v,j);
2926 const double Dvu=M4vu(u,
v,j);
2928 +Dvu*(
I2D2stuij(
ep,
s,
t,u,j,j)+0.5*
I2D2stuij(
ep+1,
s,
t,u,j,j))
2929 +Dvv*(
I2D2stuij(
ep,
s,
t,
v,j,j)+0.5*
I2D2stuij(
ep+1,
s,
t,
v,j,j));
2935 +Dvj*(
I2D2stuij(
ep,
s,
t,
v,i,j)+0.5*
I2D2stuij(
ep+1,
s,
t,
v,i,j));
2938 +Duj*(
I2D2stuij(
ep,
s,
t,u,i,j)+0.5*
I2D2stuij(
ep+1,
s,
t,u,i,j));
2942 const double Duu=M4uu(u,
v,j);
2943 const double Duv=M4vu(u,
v,j);
2946 +Duv*(
I2D2stuij(
ep,
s,
t,
v,i,j)+0.5*
I2D2stuij(
ep+1,
s,
t,
v,i,j));
2948 const double Dvv=M4vv(u,
v,j);
2949 const double Dvu=M4vu(u,
v,j);
2952 +Dvu*(
I2D2stuij(
ep,
s,
t,u,i,j)+0.5*
I2D2stuij(
ep+1,
s,
t,u,i,j));
2956 const double Duu=M4uu(u,
v,j);
2957 const double Duv=M4vu(u,
v,j);
2960 +Duu*(
I2D2stuij(
ep,
s,
t,u,i,j)+0.5*
I2D2stuij(
ep+1,
s,
t,u,i,j));
2962 const double Dvv=M4vv(u,
v,j);
2963 const double Dvu=M4vu(u,
v,j);
2966 +Dvv*(
I2D2stuij(
ep,
s,
t,
v,i,j)+0.5*
I2D2stuij(
ep+1,
s,
t,
v,i,j));
2969 ivalue=sum1/(4*
M3(
s,0,
t,
s,k,
t));
2987 sum1+=
M3(
s,0,
t,
s,j,
t)*(-5.*
I3D3sti(
ep,
s,
t, i)+2.*
I3D3sti(
ep+1,
s,
t, i));
2988 ivalue=sum1/
M3(
s,0,
t,
s,0,
t);
2991 pI3D3stij[
ep][
iss(i-1,j-1)][idx]=ivalue;
2996 fEval[E_I3D3stij+
ep]=
true;
3005 if (
s==i ||
s==j ||
s==k)
return 0;
3006 if (
ep==2)
return 0;
3007 if (not fEval[E_I4D4sijk+
ep]) {
3010 return pI4D4sijk[
ep][
is(i-1,j-1,k-1)][
s-1];
3013void Minor5::I4D4sijkEval(
int ep)
3015 for (
int s=1;
s<=smax;
s++) {
3017 for (
int i=1; i<=
CIDX; i++) {
if (i==
s)
continue;
3018 for (
int j=i; j<=
CIDX; j++) {
if (j==
s)
continue;
3019 for (
int k=j; k<=
CIDX; k++) {
if (k==
s)
continue;
3022 if (pmaxS4[
s-1] <=
deps3) {
3024 for (
int t=1;
t<=5;
t++) {
3025 if (
s==
t ||
t==i ||
t==j)
continue;
3033 ivalue=sum1/
M2(
s,0,
s,0);
3036 for (
int t=1;
t<=5;
t++) {
3037 if (
t==
s ||
t==i ||
t==j)
continue;
3041 sum1+=
M2(
s,i,
s,k)*
I4D3si(
ep,
s,j)+
M2(
s,j,
s,k)*
I4D3si(
ep,
s,i);
3042 ivalue=sum1/
M1(
s,
s);
3044 pI4D4sijk[
ep][
iss(i-1,j-1,k-1)][
s-1]=ivalue;
3049 fEval[E_I4D4sijk+
ep]=
true;
3058 assert(
s!=
t &&
t!=u && u!=
s &&
s!=i &&
t!=i && u!=i &&
s!=j &&
t!=j && u!=j);
3059 if (
ep==2)
return 0;
3060 if (not fEval[E_I2D2stuij+
ep]) {
3061 I2D2stuijEval(
ep,1,2,3,4,5,kinem.
p5());
3062 I2D2stuijEval(
ep,1,2,4,3,5,kinem.
s45());
3063 I2D2stuijEval(
ep,1,2,5,3,4,kinem.
p4());
3064 I2D2stuijEval(
ep,1,2,5,4,3,kinem.
p4());
3066 I2D2stuijEval(
ep,1,3,4,2,5,kinem.
s12());
3067 I2D2stuijEval(
ep,1,3,5,2,4,kinem.
s34());
3068 I2D2stuijEval(
ep,1,3,5,4,2,kinem.
s34());
3070 I2D2stuijEval(
ep,1,4,5,2,3,kinem.
p3());
3071 I2D2stuijEval(
ep,1,4,5,3,2,kinem.
p3());
3073#ifdef USE_ZERO_CHORD
3074 I2D2stuijEval(
ep,1,2,3,5,4,kinem.
p5());
3075 I2D2stuijEval(
ep,1,2,4,5,3,kinem.
s45());
3076 I2D2stuijEval(
ep,1,3,4,5,2,kinem.
s12());
3079 I2D2stuijEval(
ep,2,3,4,1,5,kinem.
p1());
3080 I2D2stuijEval(
ep,2,3,5,1,4,kinem.
s15());
3081 I2D2stuijEval(
ep,2,3,5,4,1,kinem.
s15());
3082 I2D2stuijEval(
ep,2,4,5,1,3,kinem.
s23());
3083 I2D2stuijEval(
ep,2,4,5,3,1,kinem.
s23());
3084 I2D2stuijEval(
ep,3,4,5,1,2,kinem.
p2());
3085 I2D2stuijEval(
ep,3,4,5,2,1,kinem.
p2());
3086#ifdef USE_ZERO_CHORD
3087 I2D2stuijEval(
ep,2,3,4,5,1,kinem.
p1());
3091 fEval[E_I2D2stuij+
ep]=
true;
3094 return pI2D2stuij[
ep][i-1][ip-1][i==j ? 0 : 1];
3097void Minor5::I2D2stuijEval(
int ep,
int s,
int t,
int u,
int i,
int ip,
double qsq)
3102 const double dstustu=-2*qsq;
3103 const double msq1=kinem.
mass(i);
3104 const double msq2=kinem.
mass(ip);
3105 const double s_cutoff=
seps2*pmaxM2[
im2(i,ip)-5];
3107 if (fabs(dstustu) <= s_cutoff) {
3108 const double mm12=msq1-msq2;
3109 if (fabs(mm12) <
meps) {
3118 sum0=2.*( (-4*msq1*msq1 + 5*msq1*msq2 + 5*msq2*msq2)/6.
3123 sum1=(-(msq1*msq1 + 10*msq1*msq2 + msq2*msq2)/6. +
3146 else { assert(
ep==1);
3147 if ( fabs(qsq) <
meps
3158 pI2D2stuij[
ep][i-1][ip-1][0]=sum0;
3159 pI2D2stuij[
ep][i-1][ip-1][1]=sum1;
3168 assert(
s!=
t &&
s!=i &&
s!=j &&
s!=k &&
t!=i &&
t!=j &&
t!=k);
3169 if (not fEval[E_I3D3stijk+
ep]) {
3172 int idx =
im2(
s,
t)-5;
3173 return pI3D3stijk[
ep][
is(i-1,j-1,k-1)][idx];
3176void Minor5::I3D3stijkEval(
int ep)
3178 for (
int s=1;
s<=smax;
s++) {
3179 for (
int t=
s+1;
t<=5;
t++) {
3180 int idx =
im2(
s,
t)-5;
3182 const double ds0ts0t=
M3(
s,0,
t,
s,0,
t);
3183 if (
ep!=0 && fabs(ds0ts0t) >
m3eps) {
3185 pI3D3stijk[
ep][ijk][idx]=0;
3190 const double dstst=
M2(
s,
t,
s,
t);
3191 for (
int i=1; i<=
CIDX; i++) {
if (i==
s || i==
t)
continue;
3192 for (
int j=i; j<=
CIDX; j++) {
if (j==
s || j==
t)
continue;
3193 for (
int k=j; k<=
CIDX; k++) {
if (k==
s || k==
t)
continue;
3196 if (pmaxS3[idx] >
ceps ||
ep!=0) {
3199 for (
int u=1; u<=5; u++) {
3200 if (u==
s || u==
t || u==i || u==j)
continue;
3201 sum1+=
M3(
s,u,
t,
s,k,
t)*
I2D2stuij(
ep,
s,
t, u, i, j);
3204 sum1+=
M3(
s,i,
t,
s,k,
t)*
I3D2sti(
ep,
s,
t, j)+
M3(
s,j,
t,
s,k,
t)*
I3D2sti(
ep,
s,
t, i);
3208 int iu[3]={k-1,
s-1,
t-1};
3210 tswap(iu[0],iu[2],tmp);
3211 tswap(iu[1],iu[2],tmp);
3212 tswap(iu[0],iu[1],tmp);
3217 const double Dkk=M4ii(u,
v,k);
3218 const double Duk=M4ui(u,
v,k);
3219 const double Dvk=M4vi(u,
v,k);
3220 if ( fabs(ds0ts0t) > 0. ) {
3253 sum1+=
M3(
s,0,
t,
s,k,
t)*(-4.*
I3D3stij(
ep,
s,
t, i, j)+2.*
I3D3stij(
ep+1,
s,
t, i, j));
3256 ivalue=sum1/ds0ts0t;
3258 ivalue=std::numeric_limits<double>::quiet_NaN();
3262 pI3D3stijk[
ep][
iss(i-1,j-1,k-1)][idx]=ivalue;
3268 fEval[E_I3D3stijk+
ep]=
true;
3277 if (
s==i ||
s==j ||
s==k ||
s==l)
return 0;
3278 if (not fEval[E_I4D4sijkl+
ep]) {
3281 return pI4D4sijkl[
ep][
is(i-1,j-1,k-1,l-1)][
s-1];
3284void Minor5::I4D4sijklEval(
int ep)
3286 for (
int s=1;
s<=smax;
s++) {
3288 for (
int i=1; i<=
CIDX; i++) {
if (
s==i)
continue;
3289 for (
int j=i; j<=
CIDX; j++) {
if (
s==j)
continue;
3290 for (
int k=j; k<=
CIDX; k++) {
if (
s==k)
continue;
3291 for (
int l=k; l<=
CIDX; l++) {
if (
s==l)
continue;
3294 if (pmaxS4[
s-1] <=
deps3) {
3296 for (
int t=1;
t<=5;
t++) {
3297 if (
s==
t ||
t==i ||
t==j ||
t==k)
continue;
3298 sum1+=
M3(
s,0,
t,
s,0,l)*
I3D3stijk(
ep,
s,
t,i,j,k);
3304 sum1+=
M2(
s,0,
s,l)*(-4.*
I4D4sijk(
ep,
s, i, j, k)+2.*
I4D4sijk(
ep+1,
s, i, j, k));
3309 ivalue=sum1/
M2(
s,0,
s,0);
3312 for (
int t=1;
t<=5;
t++) {
3313 if (
t==
s ||
t==i ||
t==j ||
t==k)
continue;
3320 ivalue=sum1/
M1(
s,
s);
3322 pI4D4sijkl[
ep][
iss(i-1,j-1,k-1,l-1)][
s-1]=ivalue;
3328 fEval[E_I4D4sijkl+
ep]=
true;
double imag(const EvtComplex &c)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
static ncomplex getI2(int ep, const Kinem2 &k)
static ncomplex getI4(int ep, const Kinem4 &k)
static ncomplex getI3(int ep, const Kinem3 &k)
static ncomplex getI1(int ep, const Kinem1 &k)
ncomplex I2stu(int ep, int s, int t, int u)
double M2(int i, int j, int l, int m) PURE
ncomplex I2D2stui(int ep, int s, int t, int u, int i)
ncomplex I4D3sijk(int ep, int s, int i, int j, int k)
ncomplex I4D3s(int ep, int s)
ncomplex I3st(int ep, int s, int t)
ncomplex I2D3stu(int ep, int s, int t, int u)
ncomplex I4D2si(int ep, int s, int i)
ncomplex I3D3stijk(int ep, int s, int t, int i, int j, int k)
ncomplex I4D3sij(int ep, int s, int i, int j)
ncomplex I3Dsti(int ep, int s, int t, int i)
ncomplex I3D3sti(int ep, int s, int t, int i)
ncomplex I3D2sti(int ep, int s, int t, int i)
ncomplex I3D2stij(int ep, int s, int t, int i, int j)
ncomplex I4D4sijk(int ep, int s, int i, int j, int k)
ncomplex I4s(int ep, int s)
double M1(int i, int l) PURE
double gram3(double p1, double p2, double p3) PURE
ncomplex I4D3si(int ep, int s, int i)
ncomplex I3D3st(int ep, int s, int t)
ncomplex I4D2sij(int ep, int s, int i, int j)
ncomplex I4D4sij(int ep, int s, int i, int j)
ncomplex I2D2stuij(int ep, int s, int t, int u, int i, int j)
ncomplex I4D4si(int ep, int s, int i)
ncomplex I4Ds(int ep, int s)
ncomplex I2D2stu(int ep, int s, int t, int u)
ncomplex I2Dstui(int ep, int s, int t, int u, int i)
ncomplex I4D4s(int ep, int s)
ncomplex I4D4sijkl(int ep, int s, int i, int j, int k, int l)
ncomplex I4Dsi(int ep, int s, int i)
ncomplex I2Dstu(int ep, int s, int t, int u)
double M3(int i, int j, int k, int l, int m, int n) PURE
ncomplex I3D4st(int ep, int s, int t)
ncomplex I3D2st(int ep, int s, int t)
ncomplex I3D3stij(int ep, int s, int t, int i, int j)
ncomplex I4D2s(int ep, int s)
ncomplex I3Dst(int ep, int s, int t)
static int iss(int i, int j) CONST
static void Rescale(double factor)
static const double epsir2
static const unsigned char idxtbl[64]
static void freeidxM3(int set[], int free[])
static const double epsir1
static const double seps1
static const double seps2
static int signM3ud(int i, int j, int k, int l, int m, int n) CONST
static int nss(int i, int j) CONST
static int im2(int i, int j) CONST
static const double deps3
static int is(int i, int j) CONST
static const double deps1
static int signM2ud(int i, int j, int l, int m) CONST
static const double deps2
static int im3(int i, int j, int k) CONST
double Kay(int i, int j) PURE
double Cay[(DCay-1) *(DCay)/2]
std::complex< double > ncomplex
#define m5create2(s, t, u)
double double double double double * m3
double double double * p4
double double double double * s12
double double double double double * s23
double double double double double double double double double * m4