scikit-hep / root_numpy

The interface between ROOT and NumPy

Home Page:http://scikit-hep.org/root_numpy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`array2root` unable to create file on `root://eoslhcb.cern.ch//eos/...`

KonstantinSchubert opened this issue · comments

So, I don't really know what I am talking about here, but...
There is this eos storage at CERN and root can read/write to it using (I think), the XRootD protcol.

So whenever you open a file, you should use an url like root://eoslhcb.cern.ch//eos/lhcb/wg/semileptonic/Bs2KmunuAna/Tuples/Bs2KMuNu_MCTUPLES_RAW_30May16/TESTFILE.root

root_numpy.root2array can read from a url like this, but when I try to create a new file (using such a root://eoslhcb.cern.ch//eos... url, I get the following error:

Error in <TNetXNGFile::Open>: [ERROR] Server responded with an error: [3011] Unable to open file /eos/lhcb/user/k/koschube/[redacted]/test.root; No such file or directory

@KonstantinSchubert - you can't normally do that. xrootd servers are normally read-only and you create files elsewhere and move them there.

To elaborate, doing the same thing with ROOT.TFile.Open('...', 'NEW') will result in the same error.

Okay, I tried it.

inputfile = ROOT.TFile.Open("root://eoslhcb.cern.ch//eos/lhcb/user/k/koschube/teasdst.root","NEW")

This works without issue. Maybe root isn't using xrootd, but it is definitely able to open a file directly on eos.

It would be nice if we could get root_numpy to do the same. :)

Are you trying to create it in a directory that doesn't exist? Can you do your example, but with root_numpy?

I don't know if this will change anything, but array2root's default mode is to open with "update", but you can try changing this to "recreate" or "new", etc.

http://rootpy.github.io/root_numpy/reference/generated/root_numpy.array2root.html#root_numpy.array2root

@kratsg No, it still fails.
But @ndawe was on it: It works if I use "RECREATE" or "NEW".
In other words it seems that, "UPDATE" can not create a file on eos. The file has to be created via "NEW" or "RECREATE". Then, "UPDATE" works.

Interesting... Possibly an issue to report to the ROOT devs.