Adding a simple checker to the FMD as well as rearranging the raw histos
[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
84aff7a4 10#include <TInterpreter.h>
11#include <TRint.h>
12#include <TROOT.h>
a3e7341e 13#include <TPRegexp.h>
84aff7a4 14#include <TSystem.h>
15#include <TError.h>
16
c2c4b7a2 17#include <AliLog.h>
18
84aff7a4 19#include <TEveUtil.h>
20#include <TEveManager.h>
3f2dc5bd 21#include <TEveSelection.h>
5987168b 22
23#include <Getline.h>
24
25int main(int argc, char **argv)
26{
a15e6d7d 27 static const TEveException kEH("alieve::main");
84aff7a4 28
81515106 29 if (gSystem->Getenv("ALICE_ROOT") == 0)
30 {
31 Error(kEH.Data(), "ALICE_ROOT is not defined, aborting.");
32 gSystem->Exit(1);
84aff7a4 33 }
81515106 34
35 TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
36
37 if (gSystem->AccessPathName(evedir) == kTRUE)
38 {
39 Error(kEH.Data(), "Directory $ALICE_ROOT/EVE does not exist.");
84aff7a4 40 gSystem->Exit(1);
41 }
42
43 TString macPath(gROOT->GetMacroPath());
81515106 44 macPath += Form(":%s/macros", evedir.Data());
45 gInterpreter->AddIncludePath(evedir);
46 if (gSystem->Getenv("ALICE_ROOT") != 0)
47 {
48 macPath += Form(":%s/alice-macros", evedir.Data());
707b281a 49 gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
84aff7a4 50 gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
51 gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
52 }
a3e7341e 53 {
54 // TabCom fails on double-colon in macro-path.
55 TPMERegexp doubleColon(":{2,}", "og");
56 doubleColon.Substitute(macPath, ":");
57 }
84aff7a4 58 gROOT->SetMacroPath(macPath);
59
ebbc41f8 60 // How to hadle AliLog properly?
3e6470df 61 AliLog *log = new AliLog;
62 TRint *app = new TRint("App", &argc, argv);
84aff7a4 63
64 TEveManager::Create();
3f2dc5bd 65 gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_Projectable);
66 gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_Projectable);
84aff7a4 67
86ee80cd 68 gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/default_geo.root", evedir.Data()));
81515106 69
3e6470df 70 app->Run(kTRUE);
2418252a 71
72 TEveManager::Terminate();
707b281a 73
3e6470df 74 app->Terminate(0);
75
ebbc41f8 76 delete log;
77
84aff7a4 78 return 0;
5987168b 79}