////////////////////////////////////////////////////////////////////////// // // // HGeant // // // // Main program used to create HGeant application. // // // // last modified 7/6/2004 by R.Holzmann // ////////////////////////////////////////////////////////////////////////// //Standard Root includes #include "TROOT.h" #include "TRint.h" #include "TFile.h" #include "TInterpreter.h" #include "hgeantclass.h" #include #include #include using namespace std; #if defined __linux //On Linux Fortran wants this int xargv=0; int xargc=0; #endif //Initialise the Root environment extern void InitGui(); VoidFuncPtr_t initfuncs[] = {InitGui, 0}; TROOT root("HGeant","The HGeant/ROOT Interface",initfuncs); int batch; //_____________________________________________________________________________ int main(int argc, char **argv) { // // HGeant main program. // batch = 0; char inputfile[120] = "geaini.dat\0"; // default input file name for(int i=1; i= i+1) { strcpy(inputfile,argv[i+1]); argv[i+1][0] = '\0'; // clear string so that ROOT cannot see it } } ifstream finput; finput.open(inputfile,ios::in); if(finput.fail()) { finput.close(); printf("\n\n*** Cannot open or read file: %s\n\n",inputfile); exit(0); } TRint *theApp = NULL; if(batch != 2) { theApp = new TRint("HGeant", &argc, argv); } HGeantClass* HGeant = new HGeantClass("HGeant", "The Hades Geant3-based Simulation Code",batch,inputfile); // Start interactive GEANT if(batch != 2) { gInterpreter->ProcessLine(".X menu.C"); theApp->Run(kTRUE); } delete HGeant; exit(0); }