]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alieve_main/alieve_main.cxx
Modifications in CMake* files to export all required headers.
[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 **************************************************************************/
84aff7a4 9#include <TInterpreter.h>
10#include <TRint.h>
11#include <TROOT.h>
a3e7341e 12#include <TPRegexp.h>
84aff7a4 13#include <TSystem.h>
14#include <TError.h>
71505d99 15#include <RVersion.h>
84aff7a4 16
17#include <TEveUtil.h>
18#include <TEveManager.h>
3f2dc5bd 19#include <TEveSelection.h>
5320a363 20#include <TEveBrowser.h>
7b1a50ea 21#include <TEveViewer.h>
5987168b 22
23#include <Getline.h>
97587798 24#include <AliLog.h>
25#include <AliEveConfigManager.h>
5987168b 26
27int 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")));
b264afb8 52 gInterpreter->AddIncludePath(Form("%s/PWG0", gSystem->Getenv("ALICE_ROOT")));
84aff7a4 53 gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
54 gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
55 }
a3e7341e 56 {
57 // TabCom fails on double-colon in macro-path.
5320a363 58 // I fixed this in ROOT sometime ago ... could be removed
59 // when we go to 5.26.
a3e7341e 60 TPMERegexp doubleColon(":{2,}", "og");
61 doubleColon.Substitute(macPath, ":");
62 }
84aff7a4 63 gROOT->SetMacroPath(macPath);
64
d52fea52 65 // make sure logger is instantiated
66 AliLog::GetRootLogger();
3e6470df 67 TRint *app = new TRint("App", &argc, argv);
84aff7a4 68
71505d99 69#if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) || defined XXX_LATEST_ROOT
7b3eaa01 70 // Waiting for update by Pawel. Now GED in ROOT is better again :)
71 // Uncomment when fixed in AliEveGedXXX.
72 // TEveGListTreeEditorFrame::SetEditorClass("AliEveGedEditor");
71505d99 73#endif
74
84aff7a4 75 TEveManager::Create();
7b1a50ea 76 gEve->GetDefaultViewer()->SetElementName("3D View");
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
9b049039 82 try {AliEveConfigManager::InitializeMaster();}
83 catch (TEveException exc) {
84 AliErrorGeneral("alieve_main",exc.Data());
85 }
7b3eaa01 86
3e6470df 87 app->Run(kTRUE);
2418252a 88
8fce3f68 89 if (gEve && gEve->GetBrowser())
90 gEve->GetBrowser()->UnmapWindow();
2418252a 91 TEveManager::Terminate();
707b281a 92
3e6470df 93 app->Terminate(0);
94
84aff7a4 95 return 0;
5987168b 96}