why doesn’t the vector split correctly when I add it to the TTree
What do you mean by split correctly?
I am alluding to the errors I saw when I tried to t->Print()
the tree.
Out of curiosity, what is the type of data (semantically speaking) you are storing? Is the vector of map of map the optimal data structure to use and store this data? What is the data size (per map, per vector and in total) that you expect?
The outer vector
represents time steps in a (nuclear reactor) fuel depletion calculation. For each time step, the outer map associates the name of the materials to their compositions. Each composition is represented by a map associating isotope names to concentrations. In reality, the inner maps are classes that contain the map<TString, double>
, as well as other things.
Typical sizes would be as follow:
vector
: a few hundred elements- outer
map
: up to a few tens of thousands of elements. The keys are typically <50 chars long. - inner
map
: up to a few hundred elements. The keys are typically <10 chars long.
According to my calculation, the typical size of the outer map is a few GB (counting the actual payload only).
I could save a bit of memory by interning the isotope names and using indices for the mappings, but that would save a factor of 2 at most I think.