d810d0de |
1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 |
3 | |
4 | /************************************************************************** |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * |
51346b82 |
7 | * full copyright notice. * |
d810d0de |
8 | **************************************************************************/ |
707b281a |
9 | |
84aff7a4 |
10 | #include <TInterpreter.h> |
11 | #include <TRint.h> |
12 | #include <TROOT.h> |
a3e7341e |
13 | #include <TPRegexp.h> |
84aff7a4 |
14 | #include <TSystem.h> |
15 | #include <TError.h> |
71505d99 |
16 | #include <RVersion.h> |
84aff7a4 |
17 | |
c2c4b7a2 |
18 | #include <AliLog.h> |
19 | |
84aff7a4 |
20 | #include <TEveUtil.h> |
21 | #include <TEveManager.h> |
3f2dc5bd |
22 | #include <TEveSelection.h> |
5320a363 |
23 | #include <TEveBrowser.h> |
5987168b |
24 | |
25 | #include <Getline.h> |
26 | |
27 | int main(int argc, char **argv) |
28 | { |
a15e6d7d |
29 | static const TEveException kEH("alieve::main"); |
84aff7a4 |
30 | |
81515106 |
31 | if (gSystem->Getenv("ALICE_ROOT") == 0) |
32 | { |
33 | Error(kEH.Data(), "ALICE_ROOT is not defined, aborting."); |
34 | gSystem->Exit(1); |
84aff7a4 |
35 | } |
81515106 |
36 | |
37 | TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT"))); |
38 | |
39 | if (gSystem->AccessPathName(evedir) == kTRUE) |
40 | { |
41 | Error(kEH.Data(), "Directory $ALICE_ROOT/EVE does not exist."); |
84aff7a4 |
42 | gSystem->Exit(1); |
43 | } |
44 | |
45 | TString macPath(gROOT->GetMacroPath()); |
81515106 |
46 | macPath += Form(":%s/macros", evedir.Data()); |
47 | gInterpreter->AddIncludePath(evedir); |
48 | if (gSystem->Getenv("ALICE_ROOT") != 0) |
49 | { |
50 | macPath += Form(":%s/alice-macros", evedir.Data()); |
707b281a |
51 | gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT"))); |
84aff7a4 |
52 | gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT"))); |
53 | gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT")); |
54 | } |
a3e7341e |
55 | { |
56 | // TabCom fails on double-colon in macro-path. |
5320a363 |
57 | // I fixed this in ROOT sometime ago ... could be removed |
58 | // when we go to 5.26. |
a3e7341e |
59 | TPMERegexp doubleColon(":{2,}", "og"); |
60 | doubleColon.Substitute(macPath, ":"); |
61 | } |
84aff7a4 |
62 | gROOT->SetMacroPath(macPath); |
63 | |
ebbc41f8 |
64 | // How to hadle AliLog properly? |
3e6470df |
65 | AliLog *log = new AliLog; |
66 | TRint *app = new TRint("App", &argc, argv); |
84aff7a4 |
67 | |
71505d99 |
68 | #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) || defined XXX_LATEST_ROOT |
69 | TEveGListTreeEditorFrame::SetEditorClass("AliEveGedEditor"); |
70 | #endif |
71 | |
84aff7a4 |
72 | TEveManager::Create(); |
5320a363 |
73 | gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound); |
74 | gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound); |
84aff7a4 |
75 | |
86ee80cd |
76 | gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/default_geo.root", evedir.Data())); |
81515106 |
77 | |
3e6470df |
78 | app->Run(kTRUE); |
2418252a |
79 | |
5320a363 |
80 | gEve->GetBrowser()->UnmapWindow(); |
2418252a |
81 | TEveManager::Terminate(); |
707b281a |
82 | |
3e6470df |
83 | app->Terminate(0); |
84 | |
ebbc41f8 |
85 | delete log; |
86 | |
84aff7a4 |
87 | return 0; |
5987168b |
88 | } |