X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=EVE%2FEveBase%2FAliEveEventManager.cxx;h=ce9844e68573375dc9057d6c18e887e24fb43e19;hp=05a7affe261d5e6fcf8eafbae6522178ca4b3182;hb=5a58dc189d0ea7363b3c89fa6433d40e261426bf;hpb=8e0220c2bb5bc5e3105e4b465c731f68022bf8cf diff --git a/EVE/EveBase/AliEveEventManager.cxx b/EVE/EveBase/AliEveEventManager.cxx index 05a7affe261..ce9844e6857 100644 --- a/EVE/EveBase/AliEveEventManager.cxx +++ b/EVE/EveBase/AliEveEventManager.cxx @@ -151,8 +151,19 @@ void AliEveEventManager::Open() static const TEveException kEH("AliEveEventManager::Open "); gSystem->ExpandPathName(fPath); - if (fPath[0] != '/') - fPath = Form("%s/%s", gSystem->WorkingDirectory(), fPath.Data()); + // The following magick is required for ESDriends to be loaded properly + // from non-current directory. + if (fPath.IsNull() || fPath == ".") + { + fPath = gSystem->WorkingDirectory(); + } + else if ( ! fPath.BeginsWith("file:/")) + { + TUrl url(fPath, kTRUE); + TString protocol(url.GetProtocol()); + if (protocol == "file" && fPath[0] != '/') + fPath = Form("%s/%s", gSystem->WorkingDirectory(), fPath.Data()); + } Int_t runNo = -1; @@ -211,7 +222,7 @@ void AliEveEventManager::Open() runNo = fESD->GetESDRun()->GetRunNumber(); // Check if ESDfriends exists and attach the branch - TString p = Form("%s/AliESDfriends.root", fPath.Data()); + TString p(Form("%s/AliESDfriends.root", fPath.Data())); if (gSystem->AccessPathName(p, kReadPermission) == kFALSE) { fESDfriendExists = kTRUE;