2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
15 // !!!!! Need initialization that will also work for raw.
16 // Path and event-id are usually not needed.
17 // const Text_t* raw_file = 0,
19 void alieve_init(const Text_t* path = ".", Int_t event=0,
20 const Text_t* cdburi = 0,
21 Bool_t assert_runloader=kFALSE, Bool_t assert_esd=kFALSE)
23 Info("alieve_init", "Adding standard macros.");
24 TString hack = gSystem->pwd(); // Problem with TGFileBrowser cding
25 alieve_init_import_macros();
28 // TEveUtil::AssertMacro("region_marker.C");
30 gSystem->ProcessEvents();
34 AliEveEventManager::SetCdbUri(cdburi);
35 AliEveEventManager::SetAssertElements(assert_runloader, assert_esd);
36 printf("Opening event %d from '%s' ...", event, path); fflush(stdout);
37 gAliEveEvent = new AliEveEventManager(path, event);
39 gEve->AddEvent(gAliEveEvent);
43 void alieve_init_import_macros()
45 // Put macros in the list of browsables, add a macro browser to
48 TString macdir("$(REVESYS)/alice-macros");
49 gSystem->ExpandPathName(macdir);
51 TFolder* f = gEve->GetMacroFolder();
52 void* dirhandle = gSystem->OpenDirectory(macdir.Data());
56 std::list<string> names;
57 while((filename = gSystem->GetDirEntry(dirhandle)) != 0) {
58 if(re.Match(filename)) {
59 names.push_back(filename);
63 //PH The line below is replaced waiting for a fix in Root
64 //PH which permits to use variable siza arguments in CINT
65 //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
66 // f->Add(new TEveMacro(Form("%s/%s", macdir.Data(), filename)));
68 for (std::list<string>::iterator si=names.begin(); si!=names.end(); ++si)
70 sprintf(fullName,"%s/%s", macdir.Data(), si->c_str());
71 f->Add(new TEveMacro(fullName));
74 gSystem->FreeDirectory(dirhandle);
76 gROOT->GetListOfBrowsables()->Add
77 // (new TSystemDirectory("alice-macros", macdir.Data())); // !!!! this spits blood, but then works
78 (new TSystemDirectory(macdir.Data(), macdir.Data()));
81 TEveBrowser *br = gEve->GetBrowser();
82 TGFileBrowser *fb = 0;
83 fb = br->GetFileBrowser();
86 br->StartEmbedding(0);
87 fb = br->MakeFileBrowser();
91 br->SetTabTitle("Macros", 0);