]>
Commit | Line | Data |
---|---|---|
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/BASE/HOMER "; | |
47 | includePath += "-I${ALICE_ROOT}/HLT/MUON "; | |
48 | includePath += "-I${ALICE_ROOT}/HLT/MUON/macros "; | |
49 | includePath += "-I${ALICE_ROOT}/HLT/MUON/OfflineInterface "; | |
50 | includePath += "-I${ALICE_ROOT}/HLT/MUON/OnlineAnalysis "; | |
51 | gSystem->SetIncludePath(includePath.Data()); | |
52 | ||
53 | TString macroPath = gROOT->GetMacroPath(); | |
54 | macroPath += "${ALICE_ROOT}/HLT/MUON/macros:"; | |
55 | gROOT->SetMacroPath(macroPath); | |
56 | ||
57 | gSystem->Load("libAliHLTMUON.so"); | |
58 | gSystem->Load("libAliHLTHOMER.so"); | |
59 | ||
60 | // Setup the CDB default storage and run number if nothing was set. | |
61 | AliCDBManager* cdbManager = AliCDBManager::Instance(); | |
62 | if (cdbManager == NULL) | |
63 | { | |
64 | cerr << "ERROR: Global CDB manager object does not exist." << endl; | |
65 | return; | |
66 | } | |
67 | if (cdbManager->GetDefaultStorage() == NULL) | |
68 | { | |
69 | cdbManager->SetDefaultStorage("local://$ALICE_ROOT"); | |
70 | } | |
71 | if (cdbManager->GetRun() == -1) | |
72 | { | |
73 | cdbManager->SetRun(0); | |
74 | } | |
75 | } |