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 void alieve_init(const Text_t* path = ".", Int_t event=0,
16 const Text_t* esdfile = 0,
17 const Text_t* rawfile = 0,
18 const Text_t* cdburi = 0,
19 Bool_t assert_runloader = kFALSE,
20 Bool_t assert_esd = kFALSE,
21 Bool_t assert_raw = kFALSE)
23 Info("alieve_init", "Adding standard macros.");
24 TString hack = gSystem->pwd(); // Problem with TGFileBrowser cding
25 alieve_init_import_macros();
28 // Temporarily assert default vizdb
29 TEveUtil::AssertMacro("VizDB_scan.C");
31 gSystem->ProcessEvents();
33 AliEveEventManager::SetESDFileName(esdfile);
34 AliEveEventManager::SetRawFileName(rawfile);
35 AliEveEventManager::SetCdbUri(cdburi);
36 AliEveEventManager::SetAssertElements(assert_runloader, assert_esd, assert_raw);
41 Info("alieve_init", "Opening event %d from '%s' ...", event, path);
42 TString name("Event"); // CINT has trouble with direct "Event".
43 new AliEveEventManager(name, path, event);
44 gEve->AddEvent(AliEveEventManager::GetMaster());
48 void alieve_init_import_macros()
50 // Put macros in the list of browsables, add a macro browser to
53 TString macdir("$(ALICE_ROOT)/EVE/alice-macros");
54 gSystem->ExpandPathName(macdir);
56 TFolder* f = gEve->GetMacroFolder();
57 void* dirhandle = gSystem->OpenDirectory(macdir.Data());
62 std::list<string> names;
63 while ((filename = gSystem->GetDirEntry(dirhandle)) != 0)
65 if (re.Match(filename))
66 names.push_back(filename);
69 //PH The line below is replaced waiting for a fix in Root
70 //PH which permits to use variable siza arguments in CINT
71 //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
72 // f->Add(new TEveMacro(Form("%s/%s", macdir.Data(), filename)));
74 for (std::list<string>::iterator si=names.begin(); si!=names.end(); ++si)
76 sprintf(fullName,"%s/%s", macdir.Data(), si->c_str());
77 f->Add(new TEveMacro(fullName));
80 gSystem->FreeDirectory(dirhandle);
82 gROOT->GetListOfBrowsables()->Add
83 // (new TSystemDirectory("alice-macros", macdir.Data())); // !!!! this spits blood, but then works
84 (new TSystemDirectory(macdir.Data(), macdir.Data()));
87 TEveBrowser *br = gEve->GetBrowser();
88 TGFileBrowser *fb = 0;
89 fb = br->GetFileBrowser();
92 br->StartEmbedding(0);
93 fb = br->MakeFileBrowser();
97 br->SetTabTitle("Macros", 0);