]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/scripts/Compile.C
.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGLF / 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  * @return true on success
15  * 
16  * @ingroup pwglf_forward_scripts
17  */
18 Bool_t
19 Compile(const char* script, Option_t* option="g")
20 {
21   if (!script || script[0] == '\0') { 
22     std::cerr << "No script to compile!" << std::endl;
23     return kFALSE;
24   }
25   gSystem->Load("libANALYSIS");
26   gSystem->Load("libANALYSISalice");
27   gSystem->Load("libPWGLFforward2");
28   TString macroPath(gROOT->GetMacroPath());
29   macroPath.Append(":${ALICE_ROOT}/PWGLF/FORWARD/analysis2");
30   macroPath.Append(":${ALICE_ROOT}/PWGLF/FORWARD/analysis2/scripts");
31   gROOT->SetMacroPath(macroPath.Data());
32   gSystem->SetIncludePath("-I`root-config --incdir` "
33                           "-I${ALICE_ROOT} " 
34                           "-I${ALICE_ROOT}/include " 
35                           "-I${ALICE_ROOT}/PWGLF/FORWARD/analysis2 "
36                           "-I${ALICE_ROOT}/PWGLF/FORWARD/analysis2 ");
37   Long_t ret = gROOT->ProcessLine(Form(".L %s+%s", script, option));
38   return ret == 0;
39 }
40
41 //____________________________________________________________________
42 //
43 // EOF
44 //