2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9 #include <EveBase/AliEveConfigManager.h>
11 #include <TInterpreter.h>
22 #include <TEveManager.h>
23 #include <TEveSelection.h>
24 #include <TEveBrowser.h>
25 #include <TEveViewer.h>
29 // DEV Version includes
30 #include <EveBase/AliEveApplication.h>
31 #include <EveBase/AliEveMainWindow.h>
33 int main(int argc, char **argv)
35 static const TEveException kEH("alieve::main");
39 if(strcmp(argv[1],"-dev")==0 ){
41 AliEveApplication app("AliEve", &argc, argv);
42 AliEveMainWindow alieve("ALICE Event Display");
44 app.Connect(&alieve, "CloseWindow()", "TApplication", &app, "Terminate(=0)" );
52 Info(kEH.Data(),"No parameters");
55 if (gSystem->Getenv("ALICE_ROOT") == 0)
57 Error(kEH.Data(), "ALICE_ROOT is not defined, aborting.");
61 TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
63 if (gSystem->AccessPathName(evedir) == kTRUE)
65 Error(kEH.Data(), "Directory $ALICE_ROOT/EVE does not exist.");
69 TString macPath(gROOT->GetMacroPath());
70 macPath += Form(":%s/macros", evedir.Data());
71 gInterpreter->AddIncludePath(evedir);
72 if (gSystem->Getenv("ALICE_ROOT") != 0)
74 macPath += Form(":%s/alice-macros", evedir.Data());
75 gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
76 gInterpreter->AddIncludePath(Form("%s/PWG0", gSystem->Getenv("ALICE_ROOT")));
77 gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
78 gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
81 // TabCom fails on double-colon in macro-path.
82 // I fixed this in ROOT sometime ago ... could be removed
83 // when we go to 5.26.
84 TPMERegexp doubleColon(":{2,}", "og");
85 doubleColon.Substitute(macPath, ":");
87 gROOT->SetMacroPath(macPath);
89 // make sure logger is instantiated
90 AliLog::GetRootLogger();
91 TApplication *app = new TRint("App", &argc, argv);
93 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) || defined XXX_LATEST_ROOT
94 // Waiting for update by Pawel. Now GED in ROOT is better again :)
95 // Uncomment when fixed in AliEveGedXXX.
96 // TEveGListTreeEditorFrame::SetEditorClass("AliEveGedEditor");
99 TEveManager::Create();
100 gEve->GetDefaultViewer()->SetElementName("3D View");
101 gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound);
102 gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound);
104 gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/default_geo.root", evedir.Data()));
106 try {AliEveConfigManager::InitializeMaster();}
107 catch (TEveException exc) {
108 AliErrorGeneral("alieve_main",exc.Data());
111 app->Connect( "TEveBrowser", "CloseWindow()", "TRint", app, "Terminate(=0)");
115 if (gEve && gEve->GetBrowser()) gEve->GetBrowser()->UnmapWindow();
117 TEveManager::Terminate();
120 if(gEve) {delete gEve; gEve = 0;}