]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/scripts/Compile.C
26f618cbae3348bb9e9fde90cea8e77f20ed2c12
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / scripts / Compile.C
1 //____________________________________________________________________
2 //
3 // $Id: Compile.C 30305 2008-12-09 05:45:53Z cholm $
4 //
5 // Script to compile (using ACLic) and load a script.  It sets the
6 // include path to contain the relevant directories. 
7 //
8 /** 
9  * Compile an FMD script using ACLic
10  *
11  * @param script Script to compile
12  * @param option Compile option 
13  * 
14  * @ingroup pwg2_forward_analysis_scripts
15  */
16 Bool_t
17 Compile(const char* script, Option_t* option="g")
18 {
19   if (!script || script[0] == '\0') { 
20     std::cerr << "No script to compile!" << std::endl;
21     return kFALSE;
22   }
23   gSystem->Load("libANALYSIS.so");
24   gSystem->Load("libANALYSISalice.so");
25   gSystem->Load("libPWG2forward2.so");
26   TString macroPath(gROOT->GetMacroPath());
27   macroPath.Append(":${ALICE_ROOT}/PWG2/FORWARD/analysis2");
28   macroPath.Append(":${ALICE_ROOT}/PWG2/FORWARD/analysis2/scripts");
29   gROOT->SetMacroPath(macroPath.Data());
30   gSystem->SetIncludePath("-I`root-config --incdir` "
31                           "-I${ALICE_ROOT} " 
32                           "-I${ALICE_ROOT}/include " 
33                           "-I${ALICE_ROOT}/PWG2/FORWARD/analysis2 ");
34   Long_t ret = gROOT->ProcessLine(Form(".L %s+%s", script, option));
35   return ret == 0;
36 }
37
38 //____________________________________________________________________
39 //
40 // EOF
41 //