1

インストールして、ここrootpyリストされている要件が満たされていることを確認しました。root2hdf5

root2hdf5次のコードで生成された単純な ROOT ファイルで実行しようとすると:

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();
}

次のエラーが表示されます。

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'

このエラーが表示される理由がよくわかりません。このコンバーターを機能させるための助けをいただければ幸いです。

4

1 に答える 1

0

最新の rootpy をインストールします。新しいタグはまだありませんが、新しいバージョンの root_numpy を使用する場合は、rootpy のバージョン 0.7.1 以降をインストールする必要があります。

git clone git://github.com/rootpy/rootpy.git
cd rootpy; ./setup.py install --user
于 2014-03-17T03:20:02.810 に答える