]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixes
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jul 2011 14:33:32 +0000 (14:33 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Jul 2011 14:33:32 +0000 (14:33 +0000)
PWG2/FORWARD/analysis2/trains/BuildTrain.C

index ade1ecaac20bc6e29049a9e5abfa14bd99a7cb6e..eb0d62b8c09e263bbdcca533086d61d8f730d54f 100644 (file)
@@ -13,6 +13,7 @@ Bool_t
 BuildTrain(const char* script, const char* extra="", Bool_t useTmp=false)
 {
   // --- Load needed libraries ---------------------------------------
+  gROOT->LoadClass("TAlien",               "libRAliEn");
   gROOT->LoadClass("TVirtualMC",           "libVMC");
   gROOT->LoadClass("AliVEvent",            "libSTEERBase");
   gROOT->LoadClass("AliESDEvent",          "libESD");
@@ -25,7 +26,8 @@ BuildTrain(const char* script, const char* extra="", Bool_t useTmp=false)
   const char* fwd2Path  = 
     gSystem->ExpandPathName("$ALICE_ROOT/PWG2/FORWARD/analysis2");
   const char* macroPath = gROOT->GetMacroPath();
-  gROOT->SetMacroPath(".:%s:%s/trains:%s/scripts",macroPath,fwd2Path,fwd2Path);
+  gROOT->SetMacroPath(Form(".:%s:%s/trains:%s/scripts",
+                          macroPath,fwd2Path,fwd2Path));
   
   // --- Setup include path ------------------------------------------
   gSystem->AddIncludePath(Form("-I%s", fwd2Path));
@@ -43,6 +45,14 @@ BuildTrain(const char* script, const char* extra="", Bool_t useTmp=false)
     }
   }
   
+  // --- Compile TrainSetup.C ----------------------------------------
+  Int_t ret = gROOT->LoadMacro(Form("%s/trains/TrainSetup.C+%s", 
+                                   fwd2Path, extra));
+  if (ret != 0) { 
+    Error("BuildTrain", "Failed to build TrainSetup");
+    return false;
+  }
+  
   // --- Possibly make a temporary copy ------------------------------
   if (useTmp) { 
     TString tmp("Train");
@@ -56,7 +66,7 @@ BuildTrain(const char* script, const char* extra="", Bool_t useTmp=false)
   }
 
   // --- Now compile the thing ---------------------------------------
-  Int_t ret = gROOT->LoadMacro(Form("%s+%s", path.Data(), extra));
+  ret = gROOT->LoadMacro(Form("%s+%s", path.Data(), extra));
 
   // --- If we did a temporary file, remove stuff --------------------
   if (useTmp) {