]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alieve_main/alieve_main.cxx
- synchronized the overlay macro to the changes of the drawing one
[u/mrichter/AliRoot.git] / EVE / alieve_main / alieve_main.cxx
CommitLineData
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>
7b1a50ea 26#include <TEveViewer.h>
5987168b 27
28#include <Getline.h>
29
30int main(int argc, char **argv)
31{
a15e6d7d 32 static const TEveException kEH("alieve::main");
84aff7a4 33
81515106 34 if (gSystem->Getenv("ALICE_ROOT") == 0)
35 {
36 Error(kEH.Data(), "ALICE_ROOT is not defined, aborting.");
37 gSystem->Exit(1);
84aff7a4 38 }
81515106 39
40 TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
41
42 if (gSystem->AccessPathName(evedir) == kTRUE)
43 {
44 Error(kEH.Data(), "Directory $ALICE_ROOT/EVE does not exist.");
84aff7a4 45 gSystem->Exit(1);
46 }
47
48 TString macPath(gROOT->GetMacroPath());
81515106 49 macPath += Form(":%s/macros", evedir.Data());
50 gInterpreter->AddIncludePath(evedir);
51 if (gSystem->Getenv("ALICE_ROOT") != 0)
52 {
53 macPath += Form(":%s/alice-macros", evedir.Data());
707b281a 54 gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
b264afb8 55 gInterpreter->AddIncludePath(Form("%s/PWG0", gSystem->Getenv("ALICE_ROOT")));
84aff7a4 56 gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
57 gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
58 }
a3e7341e 59 {
60 // TabCom fails on double-colon in macro-path.
5320a363 61 // I fixed this in ROOT sometime ago ... could be removed
62 // when we go to 5.26.
a3e7341e 63 TPMERegexp doubleColon(":{2,}", "og");
64 doubleColon.Substitute(macPath, ":");
65 }
84aff7a4 66 gROOT->SetMacroPath(macPath);
67
d52fea52 68 // make sure logger is instantiated
69 AliLog::GetRootLogger();
3e6470df 70 TRint *app = new TRint("App", &argc, argv);
84aff7a4 71
71505d99 72#if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) || defined XXX_LATEST_ROOT
7b3eaa01 73 // Waiting for update by Pawel. Now GED in ROOT is better again :)
74 // Uncomment when fixed in AliEveGedXXX.
75 // TEveGListTreeEditorFrame::SetEditorClass("AliEveGedEditor");
71505d99 76#endif
77
84aff7a4 78 TEveManager::Create();
7b1a50ea 79 gEve->GetDefaultViewer()->SetElementName("3D View");
5320a363 80 gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound);
81 gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound);
84aff7a4 82
86ee80cd 83 gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/default_geo.root", evedir.Data()));
81515106 84
9b049039 85 try {AliEveConfigManager::InitializeMaster();}
86 catch (TEveException exc) {
87 AliErrorGeneral("alieve_main",exc.Data());
88 }
7b3eaa01 89
3e6470df 90 app->Run(kTRUE);
2418252a 91
8fce3f68 92 if (gEve && gEve->GetBrowser())
93 gEve->GetBrowser()->UnmapWindow();
2418252a 94 TEveManager::Terminate();
707b281a 95
3e6470df 96 app->Terminate(0);
97
84aff7a4 98 return 0;
5987168b 99}