X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=FMD%2Fscripts%2FCompile.C;h=0f0878f15f6e5d9ada18eb7ee184c139a2ba3358;hp=db8ec100683ad6e7b7c86c56167ad8cb3aff092c;hb=acd25c972008c1e235355f124a6525c68df5bf34;hpb=8f6ee336348f5b68c1bf9a963b997be2108f81f9 diff --git a/FMD/scripts/Compile.C b/FMD/scripts/Compile.C index db8ec100683..0f0878f15f6 100644 --- a/FMD/scripts/Compile.C +++ b/FMD/scripts/Compile.C @@ -1,18 +1,52 @@ +//____________________________________________________________________ // // $Id$ // // Script to compile (using ACLic) and load a script. It sets the // include path to contain the relevant directories. // +/** @defgroup FMD_script Scripts + @brief Scripts for the FMD +*/ +/** @defgroup simple_script Simple scripts + @ingroup FMD_script + @brief Scripts for the FMD +*/ +/** Compile an FMD script using ACLic + @param script Script to compile + @param option Compile option + @ingroup FMD_script +*/ void -Compile(const char* script, Option_t* option="g") +AddInclude(const char* what) +{ + TString path(gSystem->GetIncludePath()); + if (path.Contains(what)) return; + gSystem->AddIncludePath(what); +} +Bool_t +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->SetIncludePath("-I`root-config --incdir` " - "-I${ALICE_ROOT}/include " - "-I${ALICE_ROOT}/FMD " - "-I${ALICE_ROOT}/geant3/TGeant3"); - gROOT->ProcessLine(Form(".L %s+%s", script, option)); + TString macroPath(gROOT->GetMacroPath()); + macroPath.Append(":${ALICE_ROOT}/FMD/scripts"); + gROOT->SetMacroPath(macroPath.Data()); + 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; } //____________________________________________________________________