int GzBeginRender(GzRender *render) { /* - setup for start of each frame - init frame buffer color,alpha,z - compute Xiw and projection xform Xpi from camera definition - init Ximage - put Xsp at base of stack, push on Xpi and Xiw - now stack contains Xsw and app can push model Xforms when needed */ if(render == NULL){ errorCall("GzBeginRender","render is null"); return GZ_FAILURE; } //setup for start of each frame, only one frame GzInitDisplay(render->display); //init matlevel render->matlevel = -1; //Compute Xsp computeXsp(render); //compute Xiw computeXiw(render); //compute Xpi computeXpi(render); //push Xsp Xpi Xiw GzPushMatrix(render,render->Xsp); GzPushMatrix(render,render->camera.Xpi); GzPushMatrix(render,render->camera.Xiw); return GZ_SUCCESS; }
int GzPopMatrix(GzRender *render) { /* - pop a matrix off the Ximage stack - check for stack underflow */ if(render->matlevel == 0) { errorCall("GzPopMatrix","app try to pop up a matrix when render->matlevel == 0"); AfxMessageBox( "Matrix is empty\n" ); GZ_FAILURE; }else if(render->matlevel > 0 ) { initMatrix(&(render->Ximage[render->matlevel]),4); render->matlevel -= 1; }else { errorCall("GzPopMatrix","render->matlevel < 0!!!"); } return GZ_SUCCESS; }
int GzPushMatrix(GzRender *render, GzMatrix matrix) { /* - push a matrix onto the Ximage stack - check for stack overflow */ //init if render->matlevel = -1 if(render->matlevel == -1){ initMatrix(&(render->Ximage[0]),4); (render->Ximage[0])[0][0] = 1; (render->Ximage[0])[1][1] = 1; (render->Ximage[0])[2][2] = 1; (render->Ximage[0])[3][3] = 1; render->matlevel += 1; } if(render->matlevel > -1) { if (render->matlevel < MATLEVELS - 1) { //GzMatrix tempMatrix; //matrixCopy(matrix, &tempMatrix,4,4); render->matlevel += 1; initMatrix(&(render->Ximage[render->matlevel]),4); matrixMul(render->Ximage[render->matlevel-1], matrix, &(render->Ximage[render->matlevel]),4,4,4); }else { errorCall("GzPushMatrix","matlevel >= MATLEVELS"); AfxMessageBox( "Matrix has full\n" ); return GZ_FAILURE; } }else { errorCall("GzPushMatrix", "render->matlevel < -1"); //return GZ_FAILURE; } return GZ_SUCCESS; }
int GzPutCamera(GzRender *render, GzCamera *camera) { /* - overwrite renderer camera structure with new camera definition */ if(render ==NULL|| camera == NULL) { errorCall("GzPutCamera","render or camera is null"); } render->camera = *camera; return GZ_SUCCESS; }
//---------------------------------------------------------- // Begin main functions int GzNewRender(GzRender **render, GzDisplay *display) { /* - malloc a renderer struct - setup Xsp and anything only done once - save the pointer to display - init default camera */ //init a renderer struct if(render == NULL || display == NULL){ errorCall("GzNewRender" , "render == NULL or display == NULL"); return GZ_FAILURE; } *render = (GzRender*)malloc(sizeof(GzRender)); (*render)->display = display; //init default camera initCamera((*render) -> camera); return GZ_SUCCESS; }
int main(int argc, char *argv[]) { int numPoints = 1; double qMax = 0.; // Sets format of output: 4 decimal places outputCharacteristics(6); void (*boundaryCondition)(MssmSoftsusy &, const DoubleVector &); if (argc !=1 ) { cerr << "GAUGE/GRAVITY" << endl; cerr << "SOFTSUSY" << VERSION << endl; cerr << "B.C. Allanach, Comput. Phys. Commun. 143 (2002) 305-331,"; cerr << " hep-ph/0104145\n"; cerr << "Low energy data in SOFTSUSY: MIXING=" << MIXING << " TOLERANCE=" << TOLERANCE << endl; cerr << "G_F=" << GMU << " GeV^2" << endl; } // RANDOM SEED ///////////////////// time_t seconds; time( &seconds); srand( (unsigned int) seconds ); //////////////////////////////////// double mgutGuess = 2.0e16, mbmb = MBOTTOM, mtau = MTAU; int sgnMu = 1; bool gaugeUnification = false, ewsbBCscale = false, altEwsb = false; bool flag = false; double M_moduli_start, M_moduli_end ; double M_gauge_start, M_gauge_end ; double M_mess_start, M_mess_end ; double M_moduli, M_gauge, M_mess ; double tanb_start, tanb_end ; double tanb = 10; DoubleVector pars(3); // My modification cout << "argc = " << argc << endl; cout << flush ; if(argc != 3 ) { errorCall() ; exit(-1) ; } /* if (!strcmp(argv[1], "g-gmsb")) { cout << "SOFTSUSY Gauge/Gravity calculation" << endl; cout << flush; */ if( argc == 3 ) { ifstream inputfile(argv[1]); ofstream outputfile(argv[2]); string varname; inputfile >> varname >> l1 ; cout << varname << endl; inputfile >> varname >> l2 ; inputfile >> varname >> l3 ; inputfile >> varname >> nQ ; inputfile >> varname >> nU ; inputfile >> varname >> nD ; inputfile >> varname >> nL ; inputfile >> varname >> nE ; inputfile >> varname >> nHu ; inputfile >> varname >> nHd ; inputfile >> varname >> N ; inputfile >> varname >> numscan; inputfile >> varname >> M_moduli_start ; inputfile >> varname >> M_moduli_end ; inputfile >> varname >> M_gauge_start ; inputfile >> varname >> M_gauge_end ; inputfile >> varname >> M_mess_start ; inputfile >> varname >> M_mess_end ; inputfile >> varname >> tanb_start ; inputfile >> varname >> tanb_end ; inputfile >> varname >> sgnMu ; inputfile.close(); cout << "l1 = " << l1 << endl << "l2 = " << l2 << endl << "l3 = " << l3 << endl << "nQ = " << nQ << endl << "nU = " << nU << endl << "nD = " << nD << endl << "nL = " << nL << endl << "nE = " << nE << endl << "nHu = " << nHu << endl << "nHd = " << nHd << endl << "N = " << N << endl << "numscan = " << numscan << endl << "M_moduli_start = " << M_moduli_start << endl << "M_moduli_end = " << M_moduli_end << endl << "M_gauge_start = " << M_gauge_start << endl << "M_gauge_end = " << M_gauge_end << endl << "M_mess_start = " << M_mess_start << endl << "M_mess_end = " << M_mess_end << endl << "tanb_start = " << tanb_start << endl << "tanb_end = " << tanb_end << endl << "sgnMu = " << sgnMu << endl; for( int i = 0 ; i < numscan ; i++ ) { QedQcd oneset0, oneset1, oneset2; M_moduli = randomgenerator( M_moduli_start, M_moduli_end ) ; M_gauge = randomgenerator( M_gauge_start, M_gauge_end ) ; M_mess = lograndomgenerator( M_mess_start, M_mess_end ) ; tanb = randomgenerator( tanb_start, tanb_end ) ; cout << i << "th run : " << endl ; cout << "M_moduli = " << M_moduli << endl << "M_gauge = " << M_gauge << endl << "M_mess = " << M_mess << endl << "tanb = " << tanb << endl ; mgutGuess = 2e16; gaugeUnification = false; pars.setEnd(3); pars(1) = M_moduli; pars(2) = M_gauge; pars(3) = M_mess; // r = &m; // if (flag) oneset0.calcPoleMb(); oneset0.toMz(); oneset1.toMz(); oneset2.toMz(); // ofstream rgefile; // rgefile.open("rge.dat"); // ofstream spectrumfile; // spectrumfile.open("spectrum.dat") ; // cout << "Here comes r1 " << endl; MssmSoftsusy r0 ; cout << "Starting" << endl; r0.N= 0 ; r0.Nflag = true; r0.beta2() ; r0.Nflag = false; double mgut = r0.lowOrg(gaugegravityBcs0, mgutGuess, pars, sgnMu, tanb, oneset0, gaugeUnification, ewsbBCscale); r0.runto( M_mess ); cout << "starting phase 2 " << endl; r0.N = N ; r0.Nflag = true; r0.beta2() ; r0.Nflag = false; r0.runto( mgutGuess ) ; global_g1 = r0.displayGaugeCoupling(1); global_g2 = r0.displayGaugeCoupling(2); global_g3 = r0.displayGaugeCoupling(3); MssmSoftsusy r1 ; //, r2;// MssmSoftsusy2 l; r1.N = N ; r1.Nflag = true; r1.beta2(); r1.Nflag = false ; mgut = r1.lowOrg(gaugegravityBcs1, mgutGuess, pars, sgnMu, tanb, oneset1, gaugeUnification, ewsbBCscale); cout << "Here comes r1" << endl; cout << r1 ; // RGRUN( rgefile, r1 , log(mgutGuess) / log(10) , log( M_mess) / log( 10 ) , 20 ) ; r1.runto( M_mess ); global_g1 = r1.displayGaugeCoupling(1); global_g2 = r1.displayGaugeCoupling(2); global_g3 = r1.displayGaugeCoupling(3); inter_gaugino1 = r1.displayGaugino(1); inter_gaugino2 = r1.displayGaugino(2); inter_gaugino3 = r1.displayGaugino(3); inter_massmQl = r1.displaySoftMassSquared(mQl) ; inter_massmUr = r1.displaySoftMassSquared(mUr) ; inter_massmDr = r1.displaySoftMassSquared(mDr) ; inter_massmLl = r1.displaySoftMassSquared(mLl) ; inter_massmEr = r1.displaySoftMassSquared(mEr) ; inter_massmHu = r1.displayMh2Squared(); inter_massmHd = r1.displayMh1Squared(); inter_A_HuQU(1,1) = r1.displaySoftA( UA, 1, 1); inter_A_HuQU(2,2) = r1.displaySoftA( UA, 2, 2); inter_A_HuQU(3,3) = r1.displaySoftA( UA, 3, 3); inter_A_HdQD(1,1) = r1.displaySoftA( DA, 1, 1); inter_A_HdQD(2,2) = r1.displaySoftA( DA, 2, 2); inter_A_HdQD(3,3) = r1.displaySoftA( DA, 3, 3); inter_A_HdLE(1,1) = r1.displaySoftA( EA, 1, 1); inter_A_HdLE(2,2) = r1.displaySoftA( EA, 2, 2); inter_A_HdLE(3,3) = r1.displaySoftA( EA, 3, 3); mgutGuess = M_mess ; cout << "Here comes r2" << endl; MssmSoftsusy r2 ; r2.N = 0; r2.Nflag = true; r2.beta2(); r2.Nflag = false ; mgut = r2.lowOrg(gaugegravityBcs2, mgutGuess, pars, sgnMu, tanb, oneset2, gaugeUnification, ewsbBCscale); // cout << r2 ; // RGRUN( rgefile, r2 , log(M_mess) / log(10), log(100) / log(10), 20 ) ; //rgefile.close(); //spectrumrecord( spectrumfile, r2 ) ; // spectrumfile.close(); cout << r2 ; // sPhysical p = r2.displayPhys() ; // cout << p ; ofstream tempfile("LesHouches.dat"); streambuf* strm_buffer = cout.rdbuf(); cout.rdbuf( tempfile.rdbuf() ) ; r2.lesHouchesAccordOutput("nonUniversal", pars, sgnMu, tanb, 0, 1, mbmb, mtau, MGUTSCALE , 0 ) ; cout << flush; cout.rdbuf(strm_buffer); tempfile.close(); if (r2.displayProblem().test()) { cout << "# SOFTSUSY problem with point: " << r2.displayProblem(); } if( checktheresult( r2 ) ) { ////////////////////////////////////////////////// // micrOmegas // ////////////////////////////////////////////////// double Xf, Omega, Omega2, bsg_value, bsmumu_value, gmuon_value; string mess; double mtop ; int err ; int fast = 1; double Beps = 1E-6 ; double cut = 0.01; err = readLesH("LesHouches.dat",1); // // printVar(stdout); // char messtemp[20]; err=sortOddParticles(messtemp); mess = messtemp; // HiggsMasses(stdout); // printMasses(stdout,1); Omega=darkOmega(&Xf,fast,Beps); o1Contents(stdout); printChannels(Xf,cut,Beps,1,stdout); bsg_value= bsgnlo_(); bsmumu_value = bsmumu_(); gmuon_value = gmuon_(); recordphysics( outputfile, r2, M_moduli, M_gauge, M_mess, tanb, bsg_value, gmuon_value, bsmumu_value, Omega ) ; } else { recordphysics( outputfile, r2, M_moduli, M_gauge, M_mess, tanb, 0, 0 , 0, 0 ) ; } } }