Cannot open the root file

Hi,
I have a root file containing five histograms and a root tree inside that named B4. I have four branches for the tree namely ESil, ESci, LSil, LSci. I have written a script to plot the contents on the branches, but it is not working. I am attaching the structure of my root file and the script along with this post. (I am unable to attach my root file here as the file format is not supported to upload).

analysis.c (2.3 KB)


Screenshot from 2023-07-06 16-44-34
Screenshot from 2023-07-06 16-44-45

I am attaching the error also here.

root [0] .x analysis.c 
Error in <TTree::SetBranchAddress>: unknown branch -> Esil
Error in <TTree::SetBranchAddress>: unknown branch -> Esci
Error in <TTree::SetBranchAddress>: unknown branch -> Lsil
Error in <TTree::SetBranchAddress>: unknown branch -> Lsci

Thanks a lot for your time and interest in advance.

_ROOT Version: 6.26
Platform: Ubuntu 22.04
Compiler: gcc


It seems the branches do not exist.
after:

TTree *tree=(TTree*)input->Get("B4");

can you do:

tree->Print();

and show here what you get ?

Hi,

Can you provide ROOT file.
You can send me link via private message - if you want.

Hi Couet, thanks for the response. This is something what I get when I give the command to print the tree.

******************************************************************************
*Tree    :B4        : Edep and TrackL                                        *
*Entries : 100000000 : Total =     14442844583 bytes  File  Size =  604883137 *
*        :          : Tree compression factor =  23.90                       *
******************************************************************************
*Br    0 :row_wise_branch : B4                                               *
*Entries :100000000 : Total  Size= 3612513310 bytes  File Size  = 151021672 *
*Baskets :   100102 : Basket Size=      32000 bytes  Compression=  23.90     *
*............................................................................*

Hi,

I can open the file you send me via private message.

It just takes ~10 seconds to perform TTree::Draw when clicking on the branch.
Here my screenshot:

But please do not double click on “row_wise_branch” element, just try to expand it.
I need to fix this in RBrowser which cannot handle such situation.

Regards,
Sergey

Hello,
Thanks a lot for your time and interest. I had the tree plotted in TBrowser too. But I was confused why my script to plot the branches were not working.
analysis.c (2.3 KB)
Actually these are the root files generated from a geant4 simulation. I use this above script to plot the root files from the simulation and it used to work really well. But I run the same simulation on a different system using an older version of geant4 and the result I got cannot be opened with this cpp script which I used to use. I doubt it is due to a new element row_wise_branch. In my older root files simulated form the simulation, such an element was not present. I am not sure from where such a branch structure came. I did not define such a branch in the GEANT4 analysis script and I am quite unsure what change should I make in the script I provided above to plot it.
Again thanks a lot for your valuable recommendations.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.