Hi ROOT experts!
I want to store a 2D vector into a ROOT Tree. I tried to find some information about this, but all I found didn’t really help.
This is more or less what I am doing:
std::vector<std::vector<float> > _parFloatVal = std::vector<std::vector<float> >();
tree->Branch("pafv", &_parFloatVal) ;
for (int i=0; i<10; i++){
for (int j=0; j<10; j++){
std::vector<float> floatVec = std::vector<float>();
floatVec.push_back(2.222); //just an example
floatVec.push_back(3.333); //just an example
_parFloatVal.push_back(floatVec);
}
tree->Fill();
}
I also already tried to include at the beginning of my class definition
but this also didn’t work out.
I need to have the code compiled without CINT, but with the normal GCC compiler. Compiling seems to be no problems, at least I get no error messages. But if I check the saved tree after a successful run the branch “pafv” simply doesn’t exist. Currently I am using ROOT 5.18.
Is there anything I do wrongly? How can this be done correctly?