]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding helper macro to initialise the environment for dHLT specific work.
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Apr 2008 13:50:26 +0000 (13:50 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Apr 2008 13:50:26 +0000 (13:50 +0000)
HLT/MUON/macros/rootlogon.C [new file with mode: 0644]

diff --git a/HLT/MUON/macros/rootlogon.C b/HLT/MUON/macros/rootlogon.C
new file mode 100644 (file)
index 0000000..0c4a9b4
--- /dev/null
@@ -0,0 +1,57 @@
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        *
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors:                                                       *
+ *   Artur Szostak <artursz@iafrica.com>                                  *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: $ */
+
+/**
+ * \ingroup macros
+ * \file rootlogon.C
+ * \brief This macro is run when AliRoot starts and sets up the dHLT specific environment.
+ *
+ * It loads the required dimuon HLT specific libraries and include paths needed
+ * to compile and run dHLT specific macros easily.
+ *
+ * \author Artur Szostak <artursz@iafrica.com>
+ */
+
+{
+       cout << "Initialising AliRoot environment for dHLT..." << endl;
+       
+       // Check that we are actually loading aliroot or something compatible.
+       if (gClassTable->GetID("AliHLTSystem") < 0)
+       {
+               cerr << "ERROR: you must run in AliRoot to run dHLT macros." << endl;
+               gApplication->Terminate();
+               return;
+       }
+       
+       TString includePath = "-I${ALICE_ROOT}/include ";
+       includePath        += "-I${ALICE_ROOT}/RAW ";
+       includePath        += "-I${ALICE_ROOT}/MUON ";
+       includePath        += "-I${ALICE_ROOT}/MUON/mapping ";
+       includePath        += "-I${ALICE_ROOT}/HLT/BASE ";
+       includePath        += "-I${ALICE_ROOT}/HLT/MUON ";
+       includePath        += "-I${ALICE_ROOT}/HLT/MUON/macros ";
+       includePath        += "-I${ALICE_ROOT}/HLT/MUON/OfflineInterface ";
+       includePath        += "-I${ALICE_ROOT}/HLT/MUON/OnlineAnalysis ";
+       gSystem->SetIncludePath(includePath.Data());
+       
+       TString macroPath = gROOT->GetMacroPath();
+       macroPath        += "${ALICE_ROOT}/HLT/MUON/macros:";
+       gROOT->SetMacroPath(macroPath);
+       
+       gSystem->Load("libAliHLTMUON.so");
+}