]>
Commit | Line | Data |
---|---|---|
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 | |
7b3eaa01 | 10 | #include <EveBase/AliEveConfigManager.h> |
11 | ||
84aff7a4 | 12 | #include <TInterpreter.h> |
13 | #include <TRint.h> | |
14 | #include <TROOT.h> | |
a3e7341e | 15 | #include <TPRegexp.h> |
84aff7a4 | 16 | #include <TSystem.h> |
17 | #include <TError.h> | |
71505d99 | 18 | #include <RVersion.h> |
84aff7a4 | 19 | |
c2c4b7a2 | 20 | #include <AliLog.h> |
21 | ||
84aff7a4 | 22 | #include <TEveUtil.h> |
23 | #include <TEveManager.h> | |
3f2dc5bd | 24 | #include <TEveSelection.h> |
5320a363 | 25 | #include <TEveBrowser.h> |
5987168b | 26 | |
27 | #include <Getline.h> | |
28 | ||
29 | int main(int argc, char **argv) | |
30 | { | |
a15e6d7d | 31 | static const TEveException kEH("alieve::main"); |
84aff7a4 | 32 | |
81515106 | 33 | if (gSystem->Getenv("ALICE_ROOT") == 0) |
34 | { | |
35 | Error(kEH.Data(), "ALICE_ROOT is not defined, aborting."); | |
36 | gSystem->Exit(1); | |
84aff7a4 | 37 | } |
81515106 | 38 | |
39 | TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT"))); | |
40 | ||
41 | if (gSystem->AccessPathName(evedir) == kTRUE) | |
42 | { | |
43 | Error(kEH.Data(), "Directory $ALICE_ROOT/EVE does not exist."); | |
84aff7a4 | 44 | gSystem->Exit(1); |
45 | } | |
46 | ||
47 | TString macPath(gROOT->GetMacroPath()); | |
81515106 | 48 | macPath += Form(":%s/macros", evedir.Data()); |
49 | gInterpreter->AddIncludePath(evedir); | |
50 | if (gSystem->Getenv("ALICE_ROOT") != 0) | |
51 | { | |
52 | macPath += Form(":%s/alice-macros", evedir.Data()); | |
707b281a | 53 | gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT"))); |
84aff7a4 | 54 | gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT"))); |
55 | gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT")); | |
56 | } | |
a3e7341e | 57 | { |
58 | // TabCom fails on double-colon in macro-path. | |
5320a363 | 59 | // I fixed this in ROOT sometime ago ... could be removed |
60 | // when we go to 5.26. | |
a3e7341e | 61 | TPMERegexp doubleColon(":{2,}", "og"); |
62 | doubleColon.Substitute(macPath, ":"); | |
63 | } | |
84aff7a4 | 64 | gROOT->SetMacroPath(macPath); |
65 | ||
ebbc41f8 | 66 | // How to hadle AliLog properly? |
3e6470df | 67 | AliLog *log = new AliLog; |
68 | TRint *app = new TRint("App", &argc, argv); | |
84aff7a4 | 69 | |
71505d99 | 70 | #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) || defined XXX_LATEST_ROOT |
7b3eaa01 | 71 | // Waiting for update by Pawel. Now GED in ROOT is better again :) |
72 | // Uncomment when fixed in AliEveGedXXX. | |
73 | // TEveGListTreeEditorFrame::SetEditorClass("AliEveGedEditor"); | |
71505d99 | 74 | #endif |
75 | ||
84aff7a4 | 76 | TEveManager::Create(); |
5320a363 | 77 | gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound); |
78 | gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound); | |
84aff7a4 | 79 | |
86ee80cd | 80 | gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/default_geo.root", evedir.Data())); |
81515106 | 81 | |
7b3eaa01 | 82 | AliEveConfigManager::InitializeMaster(); |
83 | ||
3e6470df | 84 | app->Run(kTRUE); |
2418252a | 85 | |
5320a363 | 86 | gEve->GetBrowser()->UnmapWindow(); |
2418252a | 87 | TEveManager::Terminate(); |
707b281a | 88 | |
3e6470df | 89 | app->Terminate(0); |
90 | ||
ebbc41f8 | 91 | delete log; |
92 | ||
84aff7a4 | 93 | return 0; |
5987168b | 94 | } |