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>
37 int main(int argc, char **argv)
39 static const TEveException kEH("alieve::main");
43 if(strcmp(argv[1],"-dev")==0 ){
45 AliEveApplication app("AliEve", &argc, argv);
46 AliEveMainWindow alieve("ALICE Event Display");
48 app.Connect(&alieve, "CloseWindow()", "TApplication", &app, "Terminate(=0)" );
56 Info(kEH.Data(),"No parameters");
59 if (gSystem->Getenv("ALICE_ROOT") == 0)
61 Error(kEH.Data(), "ALICE_ROOT is not defined, aborting.");
65 TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
67 if (gSystem->AccessPathName(evedir) == kTRUE)
69 Error(kEH.Data(), "Directory $ALICE_ROOT/EVE does not exist.");
73 TString macPath(gROOT->GetMacroPath());
74 macPath += Form(":%s/macros", evedir.Data());
75 gInterpreter->AddIncludePath(evedir);
76 if (gSystem->Getenv("ALICE_ROOT") != 0)
78 macPath += Form(":%s/alice-macros", evedir.Data());
79 gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
80 gInterpreter->AddIncludePath(Form("%s/PWG0", gSystem->Getenv("ALICE_ROOT")));
81 gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
82 gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
85 // TabCom fails on double-colon in macro-path.
86 // I fixed this in ROOT sometime ago ... could be removed
87 // when we go to 5.26.
88 TPMERegexp doubleColon(":{2,}", "og");
89 doubleColon.Substitute(macPath, ":");
91 gROOT->SetMacroPath(macPath);
93 // make sure logger is instantiated
94 AliLog::GetRootLogger();
95 TApplication *app = new TRint("App", &argc, argv);
97 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4) || defined XXX_LATEST_ROOT
98 // Waiting for update by Pawel. Now GED in ROOT is better again :)
99 // Uncomment when fixed in AliEveGedXXX.
100 // TEveGListTreeEditorFrame::SetEditorClass("AliEveGedEditor");
103 TEveManager::Create();
104 gEve->GetDefaultViewer()->SetElementName("3D View");
105 gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound);
106 gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound);
108 gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/default_geo.root", evedir.Data()));
110 try {AliEveConfigManager::InitializeMaster();}
111 catch (TEveException exc) {
112 AliErrorGeneral("alieve_main",exc.Data());
115 app->Connect("TEveBrowser", "CloseWindow()", "TApplication", app, "Kill()");
119 cout<<"Terminate"<<endl;
125 if (gEve && gEve->GetBrowser()) gEve->GetBrowser()->UnmapWindow();
127 cout<<"teve terminate"<<endl;
129 TEveManager::Terminate();
131 cout<<"delete"<<endl;
133 if(gEve) {delete gEve; gEve = 0;}
135 cout<<"return"<<endl;