Hi,
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:
[code]class EdepClass
{public:
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;
} EnergyDep;[/code]
Then I create the ROOT file, tree etc:
rootfile = new TFile("Output.root","RECREATE");
atree = new TTree("EdepTree", "A Root tree");
atree->Branch("EdepBranch",&EnergyDep,"parent_ID/I:track_ID/I:step_No/I:x_edep/F:y_edep/F:z_edep/F:prestep_Ekin/F:poststep_Ekin/F:edep/F:particle_Name/C");
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:
[root.cern.ch/phpBB3/viewtopic.p … ing#p33267](TTree with string
but this deals with the case of having only one leaf in the branch.
Any help on thet is highly welcomed,
George