//------------------------------------------------------------------------------ // rootlogon.C: a sample ROOT logon macro allowing use of ROOT script // compiler in CDF RunII environment. The name of this macro file // is defined by the .rootrc file // // USESHLIBS variable has to be set to build Stntuple libraries locally: // // setenv USESHLIBS 1 // // Feb 12 2001 P.Murat //------------------------------------------------------------------------------ { #include #include // the line below tells ROOT script compiler // where to look for the include files gSystem->SetIncludePath(" -I./include -I$CDFSOFT2_DIR/include"); // load in ROOT physics vectors and event // generator libraries gSystem->Load("$ROOTSYS/lib/libPhysics.so"); gSystem->Load("$ROOTSYS/lib/libEG.so"); gSystem->Load("$ROOTSYS/lib/libDCache.so"); // load a script with the macros char command[200]; sprintf(command,"%s/Stntuple/scripts/global_init.C", gSystem->Getenv("CDFSOFT2_DIR")); gInterpreter->LoadMacro(command); // STNTUPLE shared libraries are assumed to be // built in the private test release area with // USESHLIBS environment variable set // we always need libStntuple_loop, but the // other 2 libs should be loaded in only if // we're running bare root const char* exec_name = gApplication->Argv(0); if ((strstr(exec_name,"root.exe") != 0) || (strstr(exec_name,"stnfit.exe") != 0)) { gSystem->Load("./shlib/$BFARCH/libStntuple_base.so"); gSystem->Load("./shlib/$BFARCH/libStntuple_obj.so"); gSystem->Load("./shlib/$BFARCH/libStntuple_loop.so"); } if (strstr(exec_name,"root.exe") != 0) { gSystem->Load("./shlib/$BFARCH/libStntuple_geom.so"); gSystem->Load("./shlib/$BFARCH/libStntuple_alg.so"); gSystem->Load("./shlib/$BFARCH/libStntuple_ana.so"); gSystem->Load("./shlib/$BFARCH/libStntuple_val.so"); } // print overflows/underflows in the stat box gStyle->SetOptStat(11111111); // print fit results in the stat box gStyle->SetOptFit(1110); // this line reports the process ID which simplifies // debugging TAuthenticate::SetGlobalUser(gSystem->Getenv("USER")); gInterpreter->ProcessLine(".! ps | grep root"); }