Rootcint and static data members

Hi,

just for completeness: the problem with writing static data members is not the writing part - it’s reading the values back in a consistent way. I/O is an object-centric operation; the order is defined by requests, i.e. there is no “natural” order. Static data members are obviously non-object centric. The result you get after a series of I/O operations might not be the value you would expect, because the last object read might not be the last object written.

Anyway - if this is not an issue (e.g. because the static value is the same for each entry of a tree and because you are guaranteed to read an object of the class containing the static value for each entry so it gets updated before you read it out) then you should be fine.

An alternative and much more performant (time and space wise) solution is to hook “user info” to a TTree, see root.cern.ch/root/html/TTree#TTree:GetUserInfo.

Cheers, Axel.