Issue with ROOT

When I am trying to run the root file it is showing this error.
I am using Geant4 v-11.2.1 and ROOT v-6.32.0.
Any kind of help or suggestion is appreciated.

Attaching file output.root as _file0…
Info in TFile::Recover: output.root, recovered key TDirectoryFile:output at address 66591
Warning in TFile::Init: no StreamerInfo found in output.root therefore preventing schema evolution when reading this file. The file was produced with ROOT version 4.00/00, while the current version is 6.32.02
(TFile *) 0x5577cee72ca0


This happens during crash or run stopped before time.
you will not see any data in root in particular in ntuples or any branches, however you can have data recovery in histogram format.

I suggest you to re run your code to generate data and subsequently reduce events to reduce time.


Thank You, but I have tried that and it seems that the problem arises because the in-built version of ROOT in Geant4 and the version of ROOT which I have installed are different. It happens so because when i am using the header file G4AnalysisManager, it automatically makes a root file using ROOT v-4.00.0 and hence there is a problem as that version of ROOT is very old.
I was thinking whether I could rewrite my CMakeLists.txt file to accomodate this newer version of ROOT which i have installed so that it does not use the inbuilt ROOT in it.
Any other suggestions would be helpful too and also Thank You once again.

There is no such thing. Within G4Analysis, there is code which writes out data in the public “ROOT I/O” format, but there’s no ROOT code involved. The ROOT I/O format has not changed in an extremely long time, and the output of G4Analysis is certainly readable by current versions of ROOT, at least up to 6.28 (I haven’t installed beyond that).

If you have linked your user application against ROOT, then that’s entirely within your application. If you do that, then you can make use of TFile, TTree, etc. within your application as much as you want.

In addition to the comments above, is this with an example or your own code? Have you tried one of the basic examples to generate a root file and see if that also reproduces the error?

yes i have and the root installed works perfectly fine

Sorry, I’m not entirely clear what you’ve tried here. Locally, on macOS and Geant4 11.2.2, ROOT 6.32.02 I’m able to build the B4 basic examples (e.g. exampleB4a), run this to produce a root file, and then open/view/plot this in root without a problem.

Could you try the same - build exampleB4a, run, and try opening the resultant B4.root file please? Also, what OS/compiler/Geant4 version are you running?