void annotate(void) { char buf[64]; int ypos, xpos; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho((GLdouble) 0, (GLdouble) wscreen, (GLdouble) hscreen, (GLdouble) 0, (GLdouble) -1.0, (GLdouble) 1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); glColor3f(RVAL(0xffffff), GVAL(0xffffff), BVAL(0xffffff)); if (actval == -1) { if (! strnull(getparam("ident"))) showtext(getparam("ident"), 10, 20); sprintf(buf, "%.2f", tnow); showtext(buf, wscreen - (8 * strlen(buf) + 10), 20); } else { ypos = hscreen - 10; if (vectoroff != -1) { sprintf(buf, "vector scale: %.2f", vscale); showtext(buf, 10, ypos); ypos -= 20; } if (scalaroff != -1 || dopcolor) { xpos = 10; sprintf(buf, "mapping: "); showtext(buf, xpos, ypos); xpos += 8 * strlen(buf); sprintf(buf, "%.2f", cmidpt + crange); glColor3f(RVAL(0x0000ff), GVAL(0x0000ff), BVAL(0x0000ff)); showtext(buf, xpos, ypos); xpos += 8 * strlen(buf); glColor3f(RVAL(0xffffff), GVAL(0xffffff), BVAL(0xffffff)); showtext(" to ", xpos, ypos); xpos += 32; sprintf(buf, "%.2f", cmidpt - crange); glColor3f(RVAL(0xff4f00), GVAL(0xff4f00), BVAL(0xff4f00)); showtext(buf, xpos, ypos); xpos += 8 * strlen(buf); ypos -= 20; glColor3f(RVAL(0xffffff), GVAL(0xffffff), BVAL(0xffffff)); } sprintf(buf, "angles: %.2f, %.2f, %.2f", thetax, thetay, thetaz); showtext(buf, 10, ypos); ypos -= 20; sprintf(buf, "view: %.2f, %.2f, %.2f; %.2f", xoff, yoff, dview, fview); showtext(buf, 10, ypos); ypos -= 20; } glPopMatrix(); }
void f9_key_prog(int x) { FILE*f; char fname[200]; sprintf(fname,"%s%cCITE",pathtocalchep,f_slash); f=fopen(fname,"r"); showtext (1, 1, 80,1,"",f); fclose(f); }
static void readtext(char* fname) { FILE * txt; trim(fname); txt=fopen(fname,"r"); if (txt == NULL) { messanykey(10,10," File not found"); return; } showtext (1, 1, 80,1,"",txt); fclose(txt); }
void cheplabel(void) { int key; char fname[STRSIZ]; FILE *f; while(1) { { int X=20,Y=1; scrcolor(FGmain,BGmain); goto_xy(X,Y); print("Skobeltsyn Institute of Nuclear Physics,"); goto_xy(X+8,Y+1); print("Moscow State University."); } { int Y=5; scrcolor(Blue,LightGray); goto_xy(7,Y); print("CalcHEP - a package for Calculation in High Energy Physics"); scrcolor(FGmain,BGmain); goto_xy(15,Y+1); print("Version 2.4.4; Last correction August 23,2006"); } { int Y=7; scrcolor(FGmain,BGmain); goto_xy(3,Y+2);print(" Author of the package:"); scrcolor(Blue,LightGray); print(" Alexander Pukhov"); scrcolor(FGmain,BGmain); goto_xy(14,Y+3);print("For contacts:"); scrcolor(Blue,LightGray); goto_xy(28,Y+3);print("email: <*****@*****.**>"); goto_xy(28,Y+4);print("http://theory.sinp.msu.ru/~pukhov/calchep.html"); goto_xy(28,Y+5);print("http://www.ifh.de/~pukhov/calchep.html"); } { int Y=14; scrcolor(FGmain,BGmain); goto_xy(5,Y);print("The package contains codes written by:"); scrcolor(Blue,LightGray); goto_xy(10,Y+1); scrcolor(Blue,LightGray); print("M.Donckt,V.Edneral,V.Ilyin,D.Kovalenko,A.Kryukov,G.Lepage,A.Semenov"); /* print("G.Belanger,F.Boudjema,A.Djouadi,V.Edneral,V.Ilyin,J.-L.Kneur,"); goto_xy(10,Y+2); print("A.Kryukov,G.Lepage,G.Moultaka,A.Semenov"); */ } { int Y=17; scrcolor(FGmain,BGmain); goto_xy(5,Y);print("The BS models for CalcHEP were developed in collaboration with:"); scrcolor(Blue,LightGray); goto_xy(10,Y+1); scrcolor(Blue,LightGray); print("G.Belanger,A.Belyaev,F.Boudjema,A.Semenov"); } { int X1=19, X2=61, Y1=21, Y2=Y1+2; scrcolor(FGmain,BGmain); goto_xy(X1+2,Y1-1); print("Press F9 or click the box below to get"); scrcolor(Blue,LightGray); chepbox(X1,Y1,X2,Y2); goto_xy(X1+3,Y1+1); print("References and Contributions "); /* goto_xy(X1+3,Y1+2); print(" and relative information. "); */ scrcolor(FGmain,BGmain); goto_xy(3,Y2+1); print("This information is available during the session by means of the F9 key"); clearTypeAhead(); key= inkey(); if(key==KB_F9 || ( key==KB_MOUSE && mouse_info.row>=Y1 && mouse_info.row<=Y2 && mouse_info.col >=X1 && mouse_info.col<=X2 ) ) { sprintf(fname,"%s%cCITE",pathtocomphep,f_slash); f=fopen(fname,"r"); showtext (1, 1, 80,1,"",f); fclose(f); break; } if(key !=KB_MOUSE) break; } } clr_scr(FGmain,BGmain); }
static void show_spectrum(int X, int Y) { int i; char *menuP=malloc(2+22*(nModelParticles+2)); int mode=1; menuP[0]=22; menuP[1]=0; strcpy(menuP+1, " All Particles -> SLHA"); // sprintf(menuP++strlen(menuP)," Select.Particl-> SLHA"); for(i=0;i<nModelParticles;i++) { char *mass=ModelPrtcls[i].mass; char *name=ModelPrtcls[i].name; if(!strcmp(mass,"0")) sprintf(menuP+strlen(menuP)," %-6.6s Zero ",name); else sprintf(menuP+strlen(menuP)," %-6.6s %12.4E ",name,pMass(name)); } while(mode) { menu1(X,Y,"",menuP,"n_qnumbers",NULL, &mode); if(mode==1) writeSLHA(); else if(mode>1) { FILE*f=fopen("width.tmp","w"); int pos=mode-2; txtList LL=NULL; char *mass=ModelPrtcls[pos].mass; fprintf(f, "Patricle %s(%s), PDG = %d, Mass= ", ModelPrtcls[pos].name, ModelPrtcls[pos].aname, ModelPrtcls[pos].NPDG); if(strcmp(mass,"0")==0) fprintf(f, "Zero\n"); else { double width; fprintf(f,"%.3E ", pMass(ModelPrtcls[pos].name)); width=pWidth(ModelPrtcls[pos].name,&LL); fprintf(f," Width=%.2E\n",width); } fprintf(f,"Quantum numbers: "); { int spin=ModelPrtcls[pos].spin2; int q3=ModelPrtcls[pos].q3; fprintf(f," spin="); if(spin&1) fprintf(f,"%d/2, ",spin); else fprintf(f,"%d, ",spin/2); fprintf(f," charge(el.)="); if(q3!=3*(q3/3)) fprintf(f,"%d/3, ",q3);else fprintf(f,"%d ",q3/3); fprintf(f," color=%d\n",ModelPrtcls[pos].cdim); } if(LL) { txtList ll=LL; fprintf(f," Branchings & Decay channels:\n"); for(;ll;ll=ll->next) { char buff[100]; double br; sscanf(ll->txt,"%lf %[^\n]",&br,buff); fprintf(f," %.2E %s\n",br,buff); } } fclose(f); f=fopen("width.tmp","r"); showtext(2,Y,78, maxRow()-1,"Particle information",f); fclose(f); unlink("width.tmp"); } } free(menuP); return; }