to set this bit on the corresponding basket (doesn’t work, and the ROOT file written out is pretty badly mangled). The goal here is to have a std::vector<double> in a branch that’s been written out member-wise instead (and on some level, learn how to force this flag to be set, which does not seem to be obvious atm).
Hi @jalopezg – thanks. It would be instructive to be able to create a ROOT file with “simple” std::vector collections in member-wise format. It seems like this is enabled by default, but does not force the bit. As far as I can tell, this only seems to be applied when the underlying type is a C-struct.
What do you intent to gain by setting this flag (i.e. in my understanding it would not change anything to the ondisk format of a simple vector<double>, it should only affect unsplit vector<struct/class>)?
That bit is an internal detail, it is use to convoluted with the class layout version number when writing that version number as part of the byte stream. I.e. Don’t use unless you are (re)write part of the streaming implementation.
This indicates whether ROOT I/O is globally allowed to stream eligible collection of struct/class in a member wise manner. The default is true. Nowadays, there is no known reason to disable it.
There is 2 main ways of designed whether a struct/class or a collection there is split (when stored as a branch) or streamed member wise (when stored as apart of an unsplit branch or in a key/outside of a TTree).
TClass::SetCanSplit (and ``TClass::CanSplit```): This indicate is the class or struct described by a given TClass object can or can not be split or streamer member wise (main reason not be able to split a class is if that class as a custom Streaming function).
The other mechanism is the last argument of the call to TTree::Branch (the overload that handles objects) which is called splitlevel. When set to 0, it request the object to be stored un-split, i.e. in a single branch (inside the collection can be stored memberwise). Then as the split level increase, this request to separate more and more level of nesting inside the class into its own branches. The default level is 99.