Added some ignores and moved script
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Nov 2010 20:26:53 +0000 (20:26 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Nov 2010 20:26:53 +0000 (20:26 +0000)
PWG2/FORWARD/analysis2/scripts/Compile.C [new file with mode: 0644]

diff --git a/PWG2/FORWARD/analysis2/scripts/Compile.C b/PWG2/FORWARD/analysis2/scripts/Compile.C
new file mode 100644 (file)
index 0000000..dbfc35e
--- /dev/null
@@ -0,0 +1,40 @@
+//____________________________________________________________________
+//
+// $Id: Compile.C 30305 2008-12-09 05:45:53Z cholm $
+//
+// Script to compile (using ACLic) and load a script.  It sets the
+// include path to contain the relevant directories. 
+//
+/** 
+ * Compile an FMD script using ACLic
+ *
+ * @param script Script to compile
+ * @param option Compile option 
+ * 
+ * @ingroup pwg2_forward_analysis_scripts
+ */
+Bool_t
+Compile(const char* script, 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("libPWG2forward2.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}/PWG2/FORWARD/analysis2 ");
+  Long_t ret = gROOT->ProcessLine(Form(".L %s+%s", script, option));
+  return ret == 0;
+}
+
+//____________________________________________________________________
+//
+// EOF
+//