Adding helper macro to initialise the environment for dHLT specific work.
[u/mrichter/AliRoot.git] / HLT / MUON / macros / rootlogon.C
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project        *
3  * All rights reserved.                                                   *
4  *                                                                        *
5  * Primary Authors:                                                       *
6  *   Artur Szostak <artursz@iafrica.com>                                  *
7  *                                                                        *
8  * Permission to use, copy, modify and distribute this software and its   *
9  * documentation strictly for non-commercial purposes is hereby granted   *
10  * without fee, provided that the above copyright notice appears in all   *
11  * copies and that both the copyright notice and this permission notice   *
12  * appear in the supporting documentation. The authors make no claims     *
13  * about the suitability of this software for any purpose. It is          *
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16
17 /* $Id: $ */
18
19 /**
20  * \ingroup macros
21  * \file rootlogon.C
22  * \brief This macro is run when AliRoot starts and sets up the dHLT specific environment.
23  *
24  * It loads the required dimuon HLT specific libraries and include paths needed
25  * to compile and run dHLT specific macros easily.
26  *
27  * \author Artur Szostak <artursz@iafrica.com>
28  */
29
30 {
31         cout << "Initialising AliRoot environment for dHLT..." << endl;
32         
33         // Check that we are actually loading aliroot or something compatible.
34         if (gClassTable->GetID("AliHLTSystem") < 0)
35         {
36                 cerr << "ERROR: you must run in AliRoot to run dHLT macros." << endl;
37                 gApplication->Terminate();
38                 return;
39         }
40         
41         TString includePath = "-I${ALICE_ROOT}/include ";
42         includePath        += "-I${ALICE_ROOT}/RAW ";
43         includePath        += "-I${ALICE_ROOT}/MUON ";
44         includePath        += "-I${ALICE_ROOT}/MUON/mapping ";
45         includePath        += "-I${ALICE_ROOT}/HLT/BASE ";
46         includePath        += "-I${ALICE_ROOT}/HLT/MUON ";
47         includePath        += "-I${ALICE_ROOT}/HLT/MUON/macros ";
48         includePath        += "-I${ALICE_ROOT}/HLT/MUON/OfflineInterface ";
49         includePath        += "-I${ALICE_ROOT}/HLT/MUON/OnlineAnalysis ";
50         gSystem->SetIncludePath(includePath.Data());
51         
52         TString macroPath = gROOT->GetMacroPath();
53         macroPath        += "${ALICE_ROOT}/HLT/MUON/macros:";
54         gROOT->SetMacroPath(macroPath);
55         
56         gSystem->Load("libAliHLTMUON.so");
57 }