Closed mmikhasenko closed 3 years ago
Could you make that data file available?
In general, this happens when iterating over a TTree serially, entry by entry - that's slow with UpROOT, due to the way Python uproot works. However, you're doing a multi-entry getindex
in both cases. I'd really like to have a similar file to test with.
Thanks for looking at it.
#include "TString.h"
#include "TFile.h"
#include "TTree.h"
#include <string>
#include "stdlib.h"
int create_file() {
TFile *f = new TFile("test_tree.root", "recreate");
TTree *t = new TTree("mytree", "mytree");
auto app = "EXYZ";
const uint Np = 4;
std::string names[Np] = {"pBeam", "pPim", "pEta", "pRecoil"};
//
double v[Np][4];
for (uint n=0; n<Np; n++)
for (uint i=0; i<4; i++)
t->Branch(TString::Format("%s_%c",names[n].c_str(), app[i]), &v[n][i]);
const int Nev = 300000;
for (uint i=0; i <= Nev; i++) {
for (uint n=0; n<Np; n++)
for (uint i=0; i<4; i++)
v[n][i] = (rand() % 100) / 100.0;
//
t->Fill();
}
t->Write();
f->Close();
return 0;
}
Why did you close the issue - is this resolved?
Ha, by mistake, I did not notice. Perhaps, the cat walked on the keyboard
Hehe, Ok, I'll take a look then.
I will be showing Julia
to the CERN students on Friday. Nervous as introducing a new girlfriend to parents
Oh, nice! Anything you need for that, last-minute, that I can help with?
thanks! the uproot part works nicely. Enjoy the vacation!
wrong place for posting. I was making a similar example for investigation in UnROOT. I think this issue can be closed.
Thanks!
also asked on discourse https://discourse.julialang.org/t/tables-jl-uproot-jl-and-the-speed/44737/4