Small fixes
[u/mrichter/AliRoot.git] / FMD / scripts / Compile.C
index 3b6a5c3..0f0878f 100644 (file)
     @param option Compile option 
     @ingroup FMD_script
 */
+void
+AddInclude(const char* what)
+{
+  TString path(gSystem->GetIncludePath());
+  if (path.Contains(what)) return;
+  gSystem->AddIncludePath(what);
+}
 Bool_t
-Compile(const char* script, Option_t* option="g")
+Compile(const char* script=0, Option_t* option="g")
 {
   if (!script || script[0] == '\0') { 
     std::cerr << "No script to compile!" << std::endl;
     return kFALSE;
   }
+  gSystem->Load("libANALYSIS.so");
+  gSystem->Load("libANALYSISalice.so");
   gSystem->Load("libFMDutil.so");
-  gSystem->Load("libFMDflow.so");
   TString macroPath(gROOT->GetMacroPath());
   macroPath.Append(":${ALICE_ROOT}/FMD/scripts");
   gROOT->SetMacroPath(macroPath.Data());
-  gSystem->SetIncludePath("-I`root-config --incdir` "
-                         "-I${ALICE_ROOT} " 
-                         "-I${ALICE_ROOT}/include " 
-                         "-I${ALICE_ROOT}/FMD "
-                         "-I${ALICE_ROOT}/geant3/TGeant3");
+  AddInclude("-I`root-config --incdir`");
+  AddInclude("-I${ALICE_ROOT}");
+  AddInclude("-I${ALICE_ROOT}/include");
+  AddInclude("-I${ALICE_ROOT}/FMD");
+  AddInclude("-I${ALICE_ROOT}/geant3/TGeant3");
+  AddInclude("-I${ALICE_ROOT}/../trunk");
+  AddInclude("-I${ALICE_ROOT}/../trunk/FMD");
+  AddInclude("-I${ALICE_ROOT}/../trunk/RAW");
   Long_t ret = gROOT->ProcessLine(Form(".L %s+%s", script, option));
   return ret == 0;
 }