diff --git a/tutorials/eve/alice_esd.C b/tutorials/eve/alice_esd.C index 3768d69ce3f0303c070c73abccfdd58cb7339953..d06a4e43cf3ba0d7cfda6c523ff4e8c50dc10927 100644 --- a/tutorials/eve/alice_esd.C +++ b/tutorials/eve/alice_esd.C @@ -79,10 +79,33 @@ */ #ifndef __RUN_ALICE_ESD__ + void alice_esd() { - Error("alice_esd", "Must be called from run_alice_esd.C..."); + TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName()); + dir.ReplaceAll("alice_esd.C",""); + dir.ReplaceAll("/./","/"); + gROOT->LoadMacro(dir +"MultiView.C+"); + const char* esd_file_name = "http://root.cern.ch/files/alice_ESDs.root"; + TFile::SetCacheFileDir("."); + TString lib(Form("aliesd/aliesd.%s", gSystem->GetSoExt())); + + if (gSystem->AccessPathName(lib, kReadPermission)) { + TFile* f = TFile::Open(esd_file_name, "CACHEREAD"); + if (f == 0) return; + TTree *tree = (TTree*) f->Get("esdTree"); + tree->SetBranchStatus ("ESDfriend*", 1); + f->MakeProject("aliesd", "*", "++"); + f->Close(); + delete f; + } + gSystem->Load(lib); + gROOT->ProcessLine("#define __RUN_ALICE_ESD__ 1"); + gROOT->ProcessLine("#include \"alice_esd.C\""); + gROOT->ProcessLine("run_alice_esd()"); + gROOT->ProcessLine("#undef __RUN_ALICE_ESD__"); } + #else #include "alice_esd_html_summary.C" @@ -147,7 +170,7 @@ MultiView* gMultiView = 0; /******************************************************************************/ //______________________________________________________________________________ -void alice_esd() +void run_alice_esd() { // Main function, initializes the application. // diff --git a/tutorials/eve/alice_esd_split.C b/tutorials/eve/alice_esd_split.C index 2256088b5f1a11d10aa76ea29c3abcb9f884e609..6f6a2bc1f15bd009905d394b6f6333ef6e8c0161 100644 --- a/tutorials/eve/alice_esd_split.C +++ b/tutorials/eve/alice_esd_split.C @@ -79,13 +79,35 @@ visual attributes. */ -#ifndef __RUN_ALICE_ESD__ +#ifndef __RUN_ALICE_ESD_SPLIT__ + void alice_esd_split() { - Error("alice_esd_split", "Must be called from run_alice_esd.C(kTRUE)..."); + TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName()); + dir.ReplaceAll("alice_esd_split.C",""); + dir.ReplaceAll("/./","/"); + gROOT->LoadMacro(dir +"SplitGLView.C+"); + const char* esd_file_name = "http://root.cern.ch/files/alice_ESDs.root"; + TFile::SetCacheFileDir("."); + TString lib(Form("aliesd/aliesd.%s", gSystem->GetSoExt())); + + if (gSystem->AccessPathName(lib, kReadPermission)) { + TFile* f = TFile::Open(esd_file_name, "CACHEREAD"); + if (f == 0) return; + TTree *tree = (TTree*) f->Get("esdTree"); + tree->SetBranchStatus ("ESDfriend*", 1); + f->MakeProject("aliesd", "*", "++"); + f->Close(); + delete f; + } + gSystem->Load(lib); + gROOT->ProcessLine("#define __RUN_ALICE_ESD_SPLIT__ 1"); + gROOT->ProcessLine("#include \"alice_esd_split.C\""); + gROOT->ProcessLine("run_alice_esd_split()"); + gROOT->ProcessLine("#undef __RUN_ALICE_ESD_SPLIT__"); } -#else +#else R__EXTERN TEveProjectionManager *gRPhiMgr; R__EXTERN TEveProjectionManager *gRhoZMgr; @@ -137,7 +159,7 @@ TGHProgressBar *gProgress; /******************************************************************************/ //______________________________________________________________________________ -void alice_esd_split(Bool_t auto_size=kFALSE) +void run_alice_esd_split(Bool_t auto_size=kFALSE) { // Main function, initializes the application. // diff --git a/tutorials/eve/pythia_display.C b/tutorials/eve/pythia_display.C index fa320d98a3cc819b416f662b6533c509175d721d..d8258ebdbbcdad6758ff1c11833f5c8de601e366 100644 --- a/tutorials/eve/pythia_display.C +++ b/tutorials/eve/pythia_display.C @@ -2,10 +2,30 @@ // Demo showing H -> ZZ -> 4 mu generated by Pythia. // Requires libPythia6. #ifndef __RUN_PYTHIA_DISPLAY__ + void pythia_display() { - Error("pythia_display", "Must be called from run_pythia_display.C..."); + TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName()); + dir.ReplaceAll("pythia_display.C",""); + dir.ReplaceAll("/./","/"); + gROOT->LoadMacro(dir +"MultiView.C+"); + +#ifndef G__WIN32 // libPythia6 is a static library on Windoze + if (gSystem->Load("libPythia6") < 0) + { + Error("pythia_display()", + "Could not load 'libPythia6', make sure it is available!"); + return; + } +#endif + gSystem->Load("libEGPythia6"); + + gROOT->ProcessLine("#define __RUN_PYTHIA_DISPLAY__ 1"); + gROOT->ProcessLine("#include \"pythia_display.C\""); + gROOT->ProcessLine("run_pythia_display()"); + gROOT->ProcessLine("#undef __RUN_PYTHIA_DISPLAY__"); } + #else //============================================================================== @@ -46,28 +66,13 @@ void pythia_make_gui(); // Main - pythia_display() //------------------------------------------------------------------------------ -void pythia_display() +void run_pythia_display() { if (g_pythia != 0) { Warning("pythia_display()", "Already initialized."); return; } -#ifndef G__WIN32 // libPythia6 is a static library on Windoze - if (gSystem->Load("libPythia6") < 0) - { - Error("pythia_display()", - "Could not load 'libPythia6', make sure it is available!"); - return; - } -#endif - gSystem->Load("libEGPythia6"); - - if (gROOT->LoadMacro("MultiView.C+") != 0) - { - Error("pythia_display()", "Failed loading MultiView.C in compiled mode."); - return; - } //======================================================================== //======================================================================== diff --git a/tutorials/eve/run_alice_esd.C b/tutorials/eve/run_alice_esd.C deleted file mode 100644 index f95b3119b1d91df05b6692a9c96b48bbe04c256e..0000000000000000000000000000000000000000 --- a/tutorials/eve/run_alice_esd.C +++ /dev/null @@ -1,32 +0,0 @@ -// Macro used to prepare the environment before running the alice_esd.C or -// alice_esd_split.C macros (when the split argument is true) - -void run_alice_esd(Bool_t split = kFALSE) -{ - const char* esd_file_name = "http://root.cern.ch/files/alice_ESDs.root"; - TFile::SetCacheFileDir("."); - TString lib(Form("aliesd/aliesd.%s", gSystem->GetSoExt())); - - if (gSystem->AccessPathName(lib, kReadPermission)) { - TFile* f = TFile::Open(esd_file_name, "CACHEREAD"); - if (f == 0) return; - TTree *tree = (TTree*) f->Get("esdTree"); - tree->SetBranchStatus ("ESDfriend*", 1); - f->MakeProject("aliesd", "*", "++"); - f->Close(); - delete f; - } - gSystem->Load(lib); - gROOT->ProcessLine("#define __RUN_ALICE_ESD__ 1"); - if (split) { - gROOT->LoadMacro("SplitGLView.C+"); - gInterpreter->ExecuteMacro("alice_esd_split.C"); - } - else { - gROOT->LoadMacro("MultiView.C+"); - gInterpreter->ExecuteMacro("alice_esd.C"); - } - gROOT->ProcessLine("#undef __RUN_ALICE_ESD__"); -} - - diff --git a/tutorials/eve/run_pythia_display.C b/tutorials/eve/run_pythia_display.C deleted file mode 100644 index 79ab7c45f90090e62e41e899cf4ffa9cab825907..0000000000000000000000000000000000000000 --- a/tutorials/eve/run_pythia_display.C +++ /dev/null @@ -1,10 +0,0 @@ -// Macro used to prepare the environment before running the pythia_display.C macro - -void run_pythia_display() -{ - gROOT->ProcessLine("#define __RUN_PYTHIA_DISPLAY__ 1"); - gROOT->LoadMacro("MultiView.C+"); - gInterpreter->ExecuteMacro("pythia_display.C"); - gROOT->ProcessLine("#undef __RUN_PYTHIA_DISPLAY__"); -} - diff --git a/tutorials/gui/games.C b/tutorials/gui/games.C index 4aaf1b04425791407cb7d7b7189a60b6ec1afd9f..515276a0918c4f403b082cbd358aeb8e4b10ebe4 100644 --- a/tutorials/gui/games.C +++ b/tutorials/gui/games.C @@ -2,9 +2,6 @@ void games() { - TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName()); - dir.ReplaceAll("games.C",""); - dir.ReplaceAll("/./","/"); gSystem->Load("libGui"); Bool_t UNIX = strcmp(gSystem->GetName(), "Unix") == 0; Int_t st1 = gSystem->Load("$(ROOTSYS)/test/Aclock");