5a5a1232 |
1 | // $Header$ |
2 | |
3 | void alieve_init(const Text_t* path=".", Int_t event=0, |
5ce2e42b |
4 | Bool_t use_runloader=true, Bool_t use_esd=true) |
5a5a1232 |
5 | { |
6 | |
7 | // Set-up environment, load libraries. |
8 | |
9 | Reve::SetupEnvironment(); |
5987168b |
10 | // alieve executable linked against ALICE nad EVE shared libraries. |
11 | // Reve::AssertMacro("alieve_loadlibs.C"); |
5a5a1232 |
12 | |
13 | |
14 | // Put macros in the list of browsables, spawn a browser. |
15 | |
16 | TFolder* f = new TFolder("ALICE EVE", "Visualization macros"); |
17 | TString macdir("$(REVESYS)/alice-macros"); |
18 | gSystem->ExpandPathName(macdir); |
19 | |
20 | void* dirhandle = gSystem->OpenDirectory(macdir.Data()); |
21 | if(dirhandle != 0) { |
22 | char* filename; |
23 | TPRegexp re("\.C$"); |
24 | while((filename = gSystem->GetDirEntry(dirhandle)) != 0) { |
25 | if(re.Match(filename)) { |
26 | printf("Adding macro '%s'\n", filename); |
27 | f->Add(new TMacro(Form("%s/%s", macdir.Data(), filename))); |
28 | } |
29 | } |
30 | } |
31 | gSystem->FreeDirectory(dirhandle); |
32 | |
33 | gROOT->GetListOfBrowsables()->Add(f); |
34 | gROOT->GetListOfBrowsables()->Add |
35 | (new TSystemDirectory(macdir.Data(), macdir.Data())); |
36 | |
37 | new TBrowser; |
38 | |
092578a7 |
39 | Reve::AssertMacro("region_marker.C"); |
40 | |
5a5a1232 |
41 | // Open event |
5ce2e42b |
42 | if(path != 0) { |
43 | Alieve::Event::Initialize(use_runloader, use_esd); |
5a5a1232 |
44 | |
5ce2e42b |
45 | printf("Opening event %d from '%s' ...", event, path); fflush(stdout); |
46 | Alieve::gEvent = new Alieve::Event(path, event); |
47 | printf(" done.\n"); |
48 | gReve->AddEvent(Alieve::gEvent); |
49 | } |
5a5a1232 |
50 | } |