]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/macros/alieve_init.C
Temporary replacement of Form by sprintf to avoid problems on some platforms (alpahli...
[u/mrichter/AliRoot.git] / EVE / macros / alieve_init.C
CommitLineData
5a5a1232 1// $Header$
2
3void alieve_init(const Text_t* path=".", Int_t event=0,
9658c93c 4 Bool_t use_runloader=kTRUE, Bool_t use_esd=kTRUE,
5 Bool_t avoid_exceptions_on_open=kTRUE)
5a5a1232 6{
7
8 // Set-up environment, load libraries.
9
10 Reve::SetupEnvironment();
5987168b 11 // alieve executable linked against ALICE nad EVE shared libraries.
12 // Reve::AssertMacro("alieve_loadlibs.C");
5a5a1232 13
14
15 // Put macros in the list of browsables, spawn a browser.
16
5a5a1232 17 TString macdir("$(REVESYS)/alice-macros");
18 gSystem->ExpandPathName(macdir);
19
46a5da3d 20 TFolder* f = gReve->GetMacroFolder();
5a5a1232 21 void* dirhandle = gSystem->OpenDirectory(macdir.Data());
22 if(dirhandle != 0) {
23 char* filename;
24 TPRegexp re("\.C$");
25 while((filename = gSystem->GetDirEntry(dirhandle)) != 0) {
26 if(re.Match(filename)) {
27 printf("Adding macro '%s'\n", filename);
1ccf1023 28 //PH The line below is replaced waiting for a fix in Root
29 //PH which permits to use variable siza arguments in CINT
30 //PH on some platforms (alphalinuxgcc, solariscc5, etc.)
31 // f->Add(new Reve::RMacro(Form("%s/%s", macdir.Data(), filename)));
32 char fullName[1000];
33 sprintf(fullName,"%s/%s", macdir.Data(), filename);
34 f->Add(new Reve::RMacro(fullName));
5a5a1232 35 }
36 }
37 }
38 gSystem->FreeDirectory(dirhandle);
39
5a5a1232 40 gROOT->GetListOfBrowsables()->Add
46a5da3d 41 // (new TSystemDirectory("alice-macros", macdir.Data())); // !!!! this spits blood, but then works
5a5a1232 42 (new TSystemDirectory(macdir.Data(), macdir.Data()));
43
44 new TBrowser;
45
092578a7 46 Reve::AssertMacro("region_marker.C");
47
5a5a1232 48 // Open event
5ce2e42b 49 if(path != 0) {
9658c93c 50 Alieve::Event::Initialize(use_runloader, use_esd, avoid_exceptions_on_open);
5a5a1232 51
5ce2e42b 52 printf("Opening event %d from '%s' ...", event, path); fflush(stdout);
53 Alieve::gEvent = new Alieve::Event(path, event);
54 printf(" done.\n");
55 gReve->AddEvent(Alieve::gEvent);
56 }
5a5a1232 57}