int numcheck(void) { if(getDynamicVP()) return 1; cleanDecayTable(); ForceUG=forceUG; { char mmenu[]="\026" " Parameters " " All Constraints " " Masses,Widths,Branch."; int m0=1,err; void (*F10)(int); void (*F6)(int); F10=f3_key[7]; F6=f3_key[3]; f3_key[3]=localF6; chdir("results"); outputDir="./"; err=calcMainFunc(); if(Warnings) messanykey(5,10,Warnings); for(;m0;) { menu1(56,7,"",mmenu,"s_num_*",NULL,&m0); if(err && (m0==2||m0==3)) { char txt[100]; sprintf(txt," Can not calculate %s ",varNames[err]); messanykey(12,15,txt); } switch(m0) { case 1: if(changeParam(56,8)) { cleanDecayTable(); err=calcMainFunc(); if(Warnings) messanykey(5,10,Warnings); } break; case 2: if(nModelFunc) {if(!err ) show_dependence(56,8);} else messanykey(5,10,"There are no public constraints in this model."); break; case 3: if(!err) show_spectrum(56,8); break; } } chdir(".."); outputDir="results/"; f3_key[7]=F10; f3_key[3]=F6; } return 0; }
int HBblocks(char * fname) { FILE * f=fopen(fname,"w"); double tb,sb,cb,Q; if(!f) return 1; Q=findValW("Q"); fprintf(f,"Block Mass\n 25 %E # Higgs Mass\n\n",findValW("Mh")); slhaDecayPrint("h",f); slhaDecayPrint("t",f); slhaDecayPrint("~H+",f); // MbSM=findValW("Mb"); fprintf(f,"Block HiggsBoundsInputHiggsCouplingsBosons\n"); fprintf(f,"# Effective coupling normalised to SM one and squared\n"); fprintf(f,"# For (*) normalized on Sin(2*W)\n"); fprintf(f," %12.4E 3 25 24 24 # higgs-W-W \n", 1. ); fprintf(f," %12.4E 3 25 23 23 # higgs-Z-Z \n", 1. ); fprintf(f," %12.4E 3 25 25 23 # higgs-higgs-Z \n", 0. ); { assignVal("Q",pMass("h")); calcMainFunc(); fprintf(f," %12.4E 3 25 21 21 # higgs-gluon-gluon\n", 1. ); fprintf(f," %12.4E 3 25 22 22 # higgs-gamma-gamma\n", SQR(findValW("LAAh")/findValW("LAAhSM")) ); } fprintf(f,"Block HiggsBoundsInputHiggsCouplingsFermions\n"); fprintf(f,"# Effective coupling normalised to SM one and squared\n"); fprintf(f," %12.4E %12.4E 3 25 5 5 # higgs-b-b \n" ,1.,0.); fprintf(f," %12.4E %12.4E 3 25 6 6 # higgs-top-top \n",1.,0.); fprintf(f," %12.4E %12.4E 3 25 15 15 # higgs-tau-tau \n",1.,0.); assignValW("Q",Q); calcMainFunc(); fclose(f); return 0; }
static double calcwidth12(void) { int i,nsub; double width12 = 0.; double selChan=0; int first=1; int N1; err_code = 0; for(nsub=1;nsub<=nprc_int;nsub++) widths[nsub-1]=0; for(nsub=1;nsub<=nprc_int;nsub++) { REAL m1, m2, m3; double GG; if(strcmp(pinf_int(nsub,1,&m1,&N1),inParticle)==0) { if(first) { if(EffQmass&&Q) setQforParticle(Q,inParticle); if(calcMainFunc()>0) { messanykey(15,15,"Can not calculate constraints"); return 0;} if(calcFunc_int()>0) { messanykey(15,15,"Can not calculate constraints"); return 0;} if(Q) GG=sqrt(4*M_PI*alpha_2(*Q)); else GG=sqrt(4*M_PI*alpha_2(m1)); first=0; } pinf_int(nsub,1,&m1,NULL);pinf_int(nsub,2,&m2,NULL);pinf_int(nsub,3,&m3,NULL); if (m1 <=m2 + m3) widths[nsub-1] = 0.0; else { double md=m2-m3; double ms=m2+m3; double pRestOut=sqrt((m1*m1 - ms*ms)*(m1*m1-md*md))/(2*m1); double totcoef= pRestOut/(8. * M_PI * m1*m1); for(i=1;i<12;i++) pvect3[i]=0; pvect3[0]=m1; pvect3[7]=pRestOut; pvect3[4]=sqrt(pRestOut*pRestOut+m2*m2); pvect3[11]=-pRestOut; pvect3[8]=sqrt(pRestOut*pRestOut+m3*m3); widths[nsub-1] = totcoef * sqme_int(nsub,GG,pvect3,NULL,&err_code); if(err_code != 0) { errormessage(); widths[nsub-1]=0; err_code=0;} width12 += widths[nsub-1]; if(nsubSel==nsub) selChan= widths[nsub-1]; } } } if(nsubSel) { if(width12) return selChan/width12; else return 0;} return width12; }
int hbBlocksMDL(char*fname,int*nHch) { FILE * f=fopen(fname,"w"); double tb,sb,cb,Q; if(!f) return 0; Q=findValW("Q"); fprintf(f,"Block Mass\n 25 %E # Higgs Mass\n\n",findValW("Mh")); slhaDecayPrint("h", 0,f); slhaDecayPrint("t", 0,f); slhaDecayPrint("~H+",0,f); // MbSM=findValW("Mb"); fprintf(f,"Block HiggsBoundsInputHiggsCouplingsBosons\n"); fprintf(f,"# Effective coupling normalised to SM one and squared\n"); fprintf(f,"# For (*) normalized on Sin(2*W)\n"); fprintf(f," %12.4E 3 25 24 24 # higgs-W-W \n", 1. ); fprintf(f," %12.4E 3 25 23 23 # higgs-Z-Z \n", 1. ); fprintf(f," %12.4E 3 25 25 23 # higgs-higgs-Z \n", 0. ); { double vev = findValW("V"), Mh = findValW("Mh"), aQCD=alphaQCD(Mh)/M_PI, LGGSM=lGGhSM(Mh,aQCD, findValW("Mcp"),findValW("Mbp"),findValW("Mtp"),vev), LAASM=lAAhSM(Mh,aQCD, findValW("Mcp"),findValW("Mbp"),findValW("Mtp"),vev); fprintf(f," %12.4E 3 25 21 21 # higgs-gluon-gluon\n", 1. ); fprintf(f," %12.4E 3 25 22 22 # higgs-gamma-gamma\n", SQR(findValW("LAAh")/LAASM) ); } fprintf(f,"Block HiggsBoundsInputHiggsCouplingsFermions\n"); fprintf(f,"# Effective coupling normalised to SM one and squared\n"); fprintf(f," %12.4E %12.4E 3 25 5 5 # higgs-b-b \n" ,1.,0.); fprintf(f," %12.4E %12.4E 3 25 6 6 # higgs-top-top \n",1.,0.); fprintf(f," %12.4E %12.4E 3 25 15 15 # higgs-tau-tau \n",1.,0.); assignValW("Q",Q); calcMainFunc(); fclose(f); if(nHch) *nHch=1; return 1; }
double vSigmaCC(double T,numout* cc) { int i,err,n,n0,m,w; char*s, *pname[6]; int pdg[6]; double msum; double a=0,factor,dMax=0; int spin2,cdim,neutral1,neutral2; double oldQ; double bEps=1.E-4; double dI; CI=cc->interface; T_=T; if(passParameters(cc)) return -1; if(Qaddress && CI->nout==2) { oldQ=*Qaddress; for(i=0;i<2;i++) pname[i]=CI->pinf(1,i+1,pmass+i,pdg+i); *Qaddress=pmass[0]+pmass[1]; calcMainFunc(); if(passParameters(cc)) return -1; } for(i=0;i<2+CI->nout;i++) pname[i]=CI->pinf(1,i+1,pmass+i,pdg+i); M1=pmass[0]; M2=pmass[1]; for(i=2,msum=0;i<CI->nout;i++) msum+=pmass[i]; sqrtSmin=M1+M2; if(msum > sqrtSmin) { if(T==0) return 0; else sqrtSmin=msum; } sqrtSmax=sqrtSmin-T*log(bEps); n0=0; if(CI->nout>2) for(n=1;(s=CI->den_info(1,n,&m,&w));n++) { double d=sing2(s,CI->nout,CI->va[m],CI->va[w]); if(!isfinite(d)) { printf("non-integrable pole\n"); return 0;} if(d>dMax){ dMax=d; n0=n;} } switch(CI->nout) { case 2: if(T==0) a=vcs22(cc,1,&err); else { double eps=1.E-3; sqme22=CI->sqme; nsub22=1; a=simpson(u_integrand_,0.,1.,eps)*3.8937966E8; } break; case 3: { if(n0) { s=CI->den_info(1,n0,&m,&w); for(i3=2;i3<5;i3++) if(i3!=s[0]-1 && i3!=s[1]-1) break; for(i4=2;i4<4;i4++) if(i4!=i3) break; for(i5=i4+1;i5<=4;i5++) if(i5!=i3) break; } else {i3=2;i4=3;i5=4;} printf("i3,i4,i5=%d %d %d\n",i3,i4,i5); if(T==0) a=vegas_chain(3, vsigma23integrand0 ,2000,1., 0.03,&dI); else a=vegas_chain(5, vsigma23integrandT ,2000,1., 0.03,&dI); break; } case 4: if(n0) { s=CI->den_info(1,n0,&m,&w); i3=s[0]-1; i4=s[1]-1; for(i5=2;i5<5;i5++) if(i5!=i3 && i5!=i4) break; for(i6=i5+1;i6<=5;i6++) if(i6!=i3 && i6!=i4) break; }else { i3=2;i4=3;i5=4;i6=5;} printf("i3,i4,i5,i6= %d %d %d %d\n", i3,i4,i5,i6); if(T==0) a=vegas_chain(6, vsigma24integrand0 ,4000,1., 0.03,&dI); else a=vegas_chain(8, vsigma24integrandT ,5000,1., 0.03,&dI); break; default: printf("Too many outgoing particles\n"); a=0; } // WIDTH_FOR_OMEGA=0; if(Qaddress && CI->nout==2) { *Qaddress=oldQ; calcMainFunc();} return a; }
static void show_dependence(int X, int Y) { void *pscr1=NULL; int i,mPos=1; REAL mem; int nc,ni,pos1,pos2; char txt[50]; for(pos1=1;;) { nc=findParam(X-1,Y,0,nModelVars,nModelFunc,"Constraint",&pos1); if(!pos1) return; for(pos2=1;;) { double xMin,xMax; int nPoints=100; sprintf(txt,"check \"%s\" depends on",varNames[nc]); ni=findParam(X-1,Y,0,0,nModelVars,txt,&pos2); mem=varValues[ni]; if(ni<0) break; xMin=varValues[ni] - fabs(varValues[ni] )/10; xMax=varValues[ni] + fabs(varValues[ni] )/10; for(;;) { int k3=0; char strmen[]="\026 " " x-Min = XXX " " x-Max = YYY " " Npoints = NNN " " Display "; improveStr(strmen,"XXX","%G",xMin); improveStr(strmen,"YYY","%G",xMax); improveStr(strmen,"NNN","%d",nPoints); sprintf(txt,"check %s(%s)",varNames[nc],varNames[ni]); menu1(X,Y+2,txt,strmen,"",NULL,&k3); if(!k3) break; switch(k3) { case 1: correctDouble(X,Y+12,"xMin = ",&xMin,1); break; case 2: correctDouble(X,Y+12,"xMax = ",&xMax,1); break; case 3: correctInt(X,Y+12,"nPoints = ",&nPoints,1); break; case 4: if( xMax>xMin && nPoints>=3 && nPoints<=150) { double dx=(xMax-xMin)/(nPoints-1); double f[150]; int i, NaN=0,Esc=0; informline(0,nPoints); for(i=0;i<nPoints;i++) { double x=xMin+i*dx; varValues[ni]=x; NaN=calcMainFunc(); if(NaN) { char mess[100]; sprintf(mess,"Can not evaluate constraints for %s=%G",varNames[ni], x); messanykey(16,5,mess); break; } f[i]=varValues[nc]; Esc=informline(i,nPoints); if(Esc) break; } varValues[ni]=mem; calcMainFunc(); if(!(NaN||Esc)) plot_1(xMin,xMax,nPoints,f,NULL,"Plot", varNames[ni], varNames[nc]); } else messanykey(16,5," Correct input is \n" " xMin<xMax,\n" " 3<=nPoints<=150"); break; } } } } }
static int testSubprocesses(void) { static int first=1; int err,k1,k2,i,j; double *Q; double *GG; if(first) { first=0; if(createTableOddPrtcls()) { printf("The model contains uncoupled odd patricles\n"); exit(10);} for(i=0,NC=0;i<Nodd;i++,NC++) if(strcmp(OddPrtcls[i].name,OddPrtcls[i].aname))NC++; inP=(char**)malloc(NC*sizeof(char*)); inAP=(int*)malloc(NC*sizeof(int)); inG=(int*)malloc(NC*sizeof(int)); inDelta=(double*)malloc(NC*sizeof(double)); inG_=(double*)malloc(NC*sizeof(double)); inMassAddress=(double**)malloc(NC*sizeof(double*)); inMass=(double*)malloc(NC*sizeof(double)); inNum= (int*)malloc(NC*sizeof(int)); sort=(int*)malloc(NC*sizeof(int)); code22=(numout**)malloc(NC*NC*sizeof(numout*)); inC=(int*)malloc(NC*NC*sizeof(int)); for(i=0,j=0;i<Nodd;i++) { inP[j]=OddPrtcls[i].name; inNum[j]=OddPrtcls[i].NPDG; inG[j]=(OddPrtcls[i].spin2+1)*OddPrtcls[i].cdim; if(strcmp(OddPrtcls[i].name,OddPrtcls[i].aname)) { inAP[j]=j+1; j++; inP[j]=OddPrtcls[i].aname; inG[j]=inG[j-1]; inAP[j]=j-1; inNum[j]=-OddPrtcls[i].NPDG; } else inAP[j]=j; j++; } for(i=0;i<NC;i++) sort[i]=i; for(k1=0;k1<NC;k1++) for(k2=0;k2<NC;k2++) inC[k1*NC+k2]=-1; for(k1=0;k1<NC;k1++) for(k2=0;k2<NC;k2++) if(inC[k1*NC+k2]==-1) { int kk1=inAP[k1]; int kk2=inAP[k2]; inC[k1*NC+k2]=1; if(inC[k2*NC+k1]==-1) {inC[k2*NC+k1]=0; inC[k1*NC+k2]++;} if(inC[kk1*NC+kk2]==-1) {inC[kk1*NC+kk2]=0; inC[k1*NC+k2]++;} if(inC[kk2*NC+kk1]==-1) {inC[kk2*NC+kk1]=0; inC[k1*NC+k2]++;} } for(k1=0;k1<NC;k1++) for(k2=0;k2<NC;k2++) code22[k1*NC+k2]=NULL; for(i=0,j=0;i<Nodd;i++) { inMassAddress[j]=varAddress(OddPrtcls[i].mass); if(!inMassAddress[j]) { if(strcmp(OddPrtcls[i].mass ,"0")==0) { printf("Error: odd particle '%s' has zero mass.\n",OddPrtcls[i].name); exit(5); } printf(" Model is not self-consistent:\n " " Mass identifier '%s' for particle '%s' is absent among parameetrs\n",OddPrtcls[i].mass, OddPrtcls[i].name); exit(5); } if(strcmp(OddPrtcls[i].name,OddPrtcls[i].aname)) { j++; inMassAddress[j]=inMassAddress[j-1]; } j++; } } for(Q=NULL,GG=NULL,i=0;i<nModelVars;i++) { if(strcmp(varNames[i],"Q")==0) Q=varValues+i; else if(strcmp(varNames[i],"GG")==0) GG=varValues+i; } if(Q) *Q=100; err=calcMainFunc(); if(err>0) return err; Mcdm=fabs(*(inMassAddress[0])); for(i=0;i<NC;i++) { inMass[i]=fabs(*(inMassAddress[i])); if(Mcdm>inMass[i]) Mcdm=inMass[i]; } if(Q) { *Q=2*Mcdm; assignVal("Q",2*Mcdm); err=calcMainFunc(); if(err>0) return err; } if(GG) *GG=parton_alpha(2*Mcdm/3.); for(i=0; i<NC-1;) { int i1=i+1; if(inMass[sort[i]] > inMass[sort[i1]]) { int c=sort[i]; sort[i]=sort[i1]; sort[i1]=c; if(i) i--; else i++; } else i++; } LSP=sort[0]; Mcdm=inMass[LSP]; for(i=0;i<NC;i++) { inDelta[i]= (inMass[i]-Mcdm)/Mcdm; inG_[i]=inG[i]*pow(1+inDelta[i],1.5); } for(k1=0;k1<NC;k1++) for(k2=0;k2<NC;k2++) if(code22[k1*NC+k2]) code22[k1*NC+k2]->init=0; cleanDecayTable(); return 0; }
int HBblocks(char * fname) { FILE * f=fopen(fname,"a"); double tb,sb,cb,alpha,sa,ca,ta,samb,camb,dMb,MbHl,MbSM,MbH,MbH3,Q; if(!f) return 1; Q=findValW("Q"); if(slhaDecayExists(pNum("h")) <0) slhaDecayPrint("h", f); if(slhaDecayExists(pNum("H")) <0) slhaDecayPrint("H", f); if(slhaDecayExists(pNum("H3"))<0) slhaDecayPrint("H3",f); if(slhaDecayExists(pNum("t")) <0) slhaDecayPrint("t", f); if(slhaDecayExists(pNum("H+"))<0) slhaDecayPrint("H+",f); tb=findValW("tB"); sb=tb/sqrt(1+tb*tb); cb=1/sqrt(1+tb*tb); alpha=findValW("alpha"); sa=sin(alpha); ca=cos(alpha); ta=sa/ca; samb=sa*cb-ca*sb; camb=ca*cb+sa*sb; dMb=findValW("dMb"); MbSM=findValW("Mb"); MbH= MbSM/(1+dMb)*(1+dMb*ta/tb); MbH3=MbSM/(1+dMb)*(1-dMb/tb/tb); MbHl=MbSM/(1+dMb)*(1-dMb/ta/tb); fprintf(f,"Block HiggsBoundsInputHiggsCouplingsBosons\n"); fprintf(f,"# Effective coupling normalised to SM one and squared\n"); fprintf(f,"# For (*) normalized on Sin(2*W)\n"); fprintf(f," %12.4E 3 25 24 24 # higgs-W-W \n", SQR(samb) ); fprintf(f," %12.4E 3 25 23 23 # higgs-Z-Z \n", SQR(samb) ); fprintf(f," %12.4E 3 25 25 23 # higgs-higgs-Z \n", 0. ); { assignVal("Q",pMass("h")); calcMainFunc(); fprintf(f," %12.4E 3 25 21 21 # higgs-gluon-gluon\n", SQR(findValW("LGGh")/findValW("LGGSM")) ); fprintf(f," %12.4E 3 25 22 22 # higgs-gamma-gamma\n", SQR(findValW("LAAh")/findValW("LAASM")) ); } fprintf(f," %12.4E 3 35 24 24 # higgs-W-W \n", SQR(camb) ); fprintf(f," %12.4E 3 35 23 23 # higgs-Z-Z \n", SQR(camb) ); fprintf(f," %12.4E 3 35 25 23 # higgs-higgs-Z \n", 0. ); fprintf(f," %12.4E 3 35 35 23 # higgs-higgs-Z \n", 0. ); { assignVal("Q",pMass("H")); calcMainFunc(); fprintf(f," %12.4E 3 35 21 21 # higgs-gluon-gluon\n",SQR(findValW("LGGH")/findValW("LGGSM")) ); fprintf(f," %12.4E 3 35 22 22 # higgs-gamma-gamma\n",SQR(findValW("LAAH")/findValW("LAASM")) ); } fprintf(f," %12.4E 3 36 24 24 # higgs-W-W \n", 0. ); fprintf(f," %12.4E 3 36 23 23 # higgs-Z-Z \n", 0. ); { assignVal("Q",pMass("H3")); calcMainFunc(); fprintf(f," %12.4E 3 36 21 21 # higgs-gluon-gluon\n",SQR(findValW("LGGH3")/2/findValW("LGGSM")) ); fprintf(f," %12.4E 3 36 22 22 # higgs-gamma-gamma\n",SQR(findValW("LAAH3")/2/findValW("LAASM")) ); } fprintf(f," %12.4E 3 36 25 23 #*higgs-higgs-Z \n", SQR(camb) ); fprintf(f," %12.4E 3 36 35 23 #*higgs-higgs-Z \n", SQR(samb) ); fprintf(f," %12.4E 3 36 36 23 #* higgs-higgs-Z \n", 0. ); fprintf(f,"Block HiggsBoundsInputHiggsCouplingsFermions\n"); fprintf(f,"# Effective coupling normalised to SM one and squared\n"); fprintf(f," %12.4E %12.4E 3 25 5 5 # higgs-b-b \n" ,SQR((sa/cb)*(MbHl/MbSM)),0.); fprintf(f," %12.4E %12.4E 3 25 6 6 # higgs-top-top \n",SQR(ca/sb) ,0.); fprintf(f," %12.4E %12.4E 3 25 15 15 # higgs-tau-tau \n",SQR(sa/cb) ,0.); fprintf(f," %12.4E %12.4E 3 35 5 5 # higgs-b-b \n" ,SQR((ca/cb)*(MbH/MbSM)) ,0.); fprintf(f," %12.4E %12.4E 3 35 6 6 # higgs-top-top \n",SQR(sa/sb) ,0.); fprintf(f," %12.4E %12.4E 3 35 15 15 # higgs-tau-tau \n",SQR(ca/cb) ,0.); fprintf(f," %12.4E %12.4E 3 36 5 5 # higgs-b-b \n" ,0.,SQR(tb*(MbH3/MbSM))); fprintf(f," %12.4E %12.4E 3 36 6 6 # higgs-top-top \n",0.,SQR(1/tb) ); fprintf(f," %12.4E %12.4E 3 36 15 15 # higgs-tau-tau \n",0.,SQR(tb) ); assignValW("Q",Q); calcMainFunc(); fclose(f); return 0; }