New Custom Classes in Root 6

Dear ROOT developers,

I’m currently redesigning my simulation environment using ROOT 6 for, e.g., data logging, analysis, etc. I wonder if I should continue to derive my basic, data representing classes from TObject (using the ClassDef-Macro, etc.) and handle them with ROOT-specific containers like TObjArray, or if I should start using “normal” classes and C++ standard containers like std::vector? Some quick tests appear to suggest that with ROOT6 I can store the latter in root-Files as well (automatic de-serialization via Cling?)?

What is the “recommended” way in your point of view when working with ROOT 6 ?

Cheers,
Jochen

Hi,

I noticed that this post was never answered: I’ll try to catch up now.
In general, I would suggest to use ROOT container classes and TObject if the functionality they provided is needed for the problem you are trying to solve.
You can of course store in files any class, including stl collections* :slight_smile:. This is not a feature of ROOT6, it was possible also with ROOT5. We provide more dictionaries of stl by default in the ROOT6 series though.

Cheers,
Danilo

nbviewer.ipython.org/urls/root.c … file.ipynb