]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/alieve_main/alieve_main.cxx
In Open() and GotoEvent() try the ESD operations first, fallback to run-loader.
[u/mrichter/AliRoot.git] / EVE / alieve_main / alieve_main.cxx
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          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #include <TInterpreter.h>
11 #include <TRint.h>
12 #include <TROOT.h>
13 #include <TSystem.h>
14 #include <TError.h>
15
16 #include <AliLog.h>
17
18 #include <TEveUtil.h>
19 #include <TEveManager.h>
20 #include <TEveSelection.h>
21
22 #include <Getline.h>
23
24 int main(int argc, char **argv)
25 {
26   static const TEveException kEH("alieve::main");
27
28   if (gSystem->Getenv("ALICE_ROOT") == 0)
29   {
30     Error(kEH.Data(), "ALICE_ROOT is not defined, aborting.");
31     gSystem->Exit(1);
32   }
33
34   TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
35
36   if (gSystem->AccessPathName(evedir) == kTRUE)
37   {
38     Error(kEH.Data(), "Directory $ALICE_ROOT/EVE does not exist.");
39     gSystem->Exit(1);
40   }
41
42   TString macPath(gROOT->GetMacroPath());
43   macPath += Form(":%s/macros", evedir.Data());
44   gInterpreter->AddIncludePath(evedir);
45   if (gSystem->Getenv("ALICE_ROOT") != 0)
46   {
47     macPath += Form(":%s/alice-macros", evedir.Data());
48     gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
49     gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
50     gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
51   }
52   gROOT->SetMacroPath(macPath);
53
54   // How to hadle AliLog properly?
55   AliLog* log = new AliLog;
56
57   TRint app("App", &argc, argv);
58
59   TEveManager::Create();
60   gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_Projectable);
61   gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_Projectable);
62
63   gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/alice_fullgeo.root", evedir.Data()));
64
65   app.Run(); // Never returns.
66
67   delete log;
68
69   return 0;
70 }