I want to write (and eventually read) a tree. It has always worked smoothly for me, until I tried filling some string variables…
So the class is:
Int_t parent_ID, track_ID, step_No; Float_t x_edep, y_edep, z_edep, prestep_Ekin, poststep_Ekin, edep; std::string particle_Name;
Then I create the ROOT file, tree etc:
rootfile = new TFile("Output.root","RECREATE");
atree = new TTree("EdepTree", "A Root tree");
The leaf with the string although it get the correct number of entries, it doesn’t get the correct values.
There is an example code in this post:
but this deals with the case of having only one leaf in the branch.
Any help on thet is highly welcomed,