Root2csv segmentation fault for Geant4 merged .root file

I’m trying to use root2csv, as in this post.

I’m running a Geant4 program that runs in multithreading. If I generate the root files as normal outputs, it will generate say “output_t#.root” for each thread #. I can manually merge the files after the fact using hadd, and then run root2csv to get a csv output.

However, for efficiency I would like to have the multiple threads merged. If I enable the command below using the G4AnalysisManager, I do get a single output.root file.

//Merge Multi-threaded root files into one
man->SetNtupleMerging(true);

However, if I try to run root2csv on this, I get a segmentation violation.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x931c61]

Anyone know how to work around this?

hi there,

could you post a link to a ROOT file that makes root2csv panic ?
(also, which version of root2csv are you using ?)

Here’s a link to a merged root file that I can open in root, but fails on trying to use root2csv.

I’m not sure how to check the version of root2csv, but I tried yesterday on whatever the latest version was when downloading using the instructions you shared (with @latest).

apologies for the belated answer.
I didn’t get an email notification for your answer.

I’ll investigate (at a quick glance, it seems it’s coming from how baskets are organized with this modus operandi. uproot seems to get those correctly, so there’s hope groot can do that as well)

hi there,

PR #990 should fix it.
(it will appear shortly (1-2 days) in the next Go-HEP version)

@DanBenjaminOxos it’s done and published :slight_smile:

Nice work. I’ll give it a go.

@DanBenjaminOxos any news ?

(my policy has always been to only advertise groot stuff when ROOT/C++ didn’t provide a satisfactory answer. or when asked to. and I’ve always been very clear about the Go-ish-ness of groot.)

@sbinet et might make sense to set up your own support forum and redirect people there? It might be worthwhile for people to understand that they are not connected to ROOT - i.e. once you decide to become a lumberjack or whatever :slight_smile: we won’t be able to support them… Thanks!