LoadMacro from alien path


is there a way to use gROOT->LoadMacro(“alien:///path/config.C”) with alien access or some workaround.

I always get the error that the file is not found in the TROOT::GetMacroPath(). Of course grid connection is established by TGrid::Connect(“alien://”,0,0,“t”) and works fine.

Do you have any idea how to solve this?

One idea I had (but wasn’t able to realize) was to open the file using TFile and then somehow do something similar to “LoadMacro(TFile *fin)”.



The only workaround I could think of is to copy locally the file into a temporary directory and then to load it from there. Something like:

TString dst = TString::Format("%s/%s", gSystem->TempDirectory(), gSystem->BaseName("alien:///path/config.C"));
if (gSystem->AccessPathName(dst)) {
   TFile::Cp("alien:///path/config.C", dst);

(Even making LoadMacro to understand remote paths - which I think is difficult, given the fact that it uses the interpreter in the back - would result in transferring the macro content locally; performance-wise must be equivalent).

Hope it helps.

G. Ganis