1

I installed rootpy and ensured that the requirements listed here for root2hdf5 were met.

When trying to run root2hdf5 on a simple ROOT file generated with the following code:

void tree1w() {
    // Create a Tree file tree1.root - create the file, the Tree and a few branches
    TFile f("tree1.root", "recreate");
    TTree t1("t1","a simple Tree with simple variables");
    Float_t px, py, pz;
    Double_t random;
    Int_t ev;
    t1.Branch("px", &px, "px/F");
    t1.Branch("py", &py, "py/F");
    t1.Branch("pz", &pz, "pz/F");
    t1.Branch("ev", &ev, "ev/I");

    // Fill the Tree
    for (Int_t i = 0; i < 10000; i++) {
        gRandom->Rannor(px, py);
        pz = px * px + py * py;
        random = gRandom->Rndm();
        ev = i;
        t1.Fill();
    }

    // Save the Tree; the file will be automatically closed
    // when going out of the function scope
    t1.Write();
}

I get the following error:

INFO:rootpy.root2hdf5] Converting tree1.root ...
INFO:rootpy.root2hdf5] Will convert 1 tree in this directory
INFO:rootpy.root2hdf5] Converting tree 't1' with 10000 entries ...
Traceback (most recent call last):
File "/Users/jamesmorad/Research/Apps/pylux/bin/root2hdf5", line 8, in <module>
load_entry_point('rootpy==0.7.1', 'console_scripts', 'root2hdf5')()
File "/Users/jamesmorad/Research/Apps/pylux/lib/python2.7/site-packages/rootpy/root2hdf5.py",
line 214, in main
selection=args.selection)
File "/Users/jamesmorad/Research/Apps/pylux/lib/python2.7/site-packages/rootpy/root2hdf5.py",
line 109, in convert
selection=selection)
TypeError: tree2rec() got an unexpected keyword argument 'entries'

I don't quite understand why I'm seeing this error and I would greatly appreciate any help with getting this converter working.

aaron
  • 39,695
  • 6
  • 46
  • 102
jamesmorad
  • 11
  • 1

1 Answers1

0

Install the latest rootpy. Sorry no new tag yet, but when using newer versions of root_numpy you will need to install beyond version 0.7.1 of rootpy:

git clone git://github.com/rootpy/rootpy.git
cd rootpy; ./setup.py install --user
ndawe
  • 338
  • 3
  • 14
  • When running the install script, I receive the error "Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6". If I pip install rootpy, the install completes without error. Any hints on making python tell me more about what my errors are? – jamesmorad Mar 18 '14 at 22:19
  • I suspect you are running Mac OS from the file paths in your first post. Correct? What ROOT version? – ndawe Mar 19 '14 at 04:15
  • Seems like you have this problem: http://stackoverflow.com/questions/15678153/homebrew-python-on-mac-os-x-10-8-fatal-python-error-pythreadstate-get-no-cu Maybe you can find a solution there. – ndawe Mar 19 '14 at 04:17
  • Yes, I am running OSX, Mavericks. I have tried this with ROOT versions 5.34.18, 5.34.09 built from source as well as the ROOT package in homebrew. Also, the python I am trying to use with this setup is installed through homebrew. I have inkling that this has to do with ROOT looking in my system python for libraries, but shouldn't homebrew take care of all library paths? – jamesmorad Mar 20 '14 at 16:10