Re: [ROOT] Automatic Scheme Eveolution

From: Thomas Bretz (tbretz@astro.uni-wuerzburg.de)
Date: Wed Mar 06 2002 - 13:57:12 MET


Hi Rene,

let's clarify the situation a bit more:
We introduced the class using root 2.25/? without any '+' or '-' or
similar in the LinkDef file. And we produced some files. Then we moved
to root 3.02/06 again without any additional sign in the LinkDef file,
and we produced again some files and were able to read the old created
files. Now we want first to 'add the plus in the LinkDef file' and in
the future we may want to change the class definition (eg. adding a new
data member). What do we have to do when we want still to be able to
read the old created files. Is it enough to add the '+' or may this
result in some incompatibilities?

Thomas.

> Clarification. The text in the documentation that you are quoting refers
> to the process of moving from old Root versions to the version 3.
> If you had always been using the option "+" in LinkDef.h, things should be
> totally automatic and schema evolution is supported by default.
> As soon as version 3 is used with option "+", Root I/O will be able to
> read evolutive versions of your classes automatically.
> 
> > from: http://root.cern.ch/root/SchemaEvolution.html
> > ------------------------
> > How to use the new system
> >
> > We will distinguish the following cases:
> >
> >     Case A: You have your own Streamer function in your class
> > implementation
> > [...]
> >     Case B: You use the automatic streamer in the dictionary file.
> >         Move the old Streamer from the file generated by rootcint to
> > your class implementation file, then modified the Streamer
> >         function as in case A above.
> >         Increment your class version id in ClassDef by 1, eg.
> > ClassDef(MyClass, 2)
> >         Add option "-" in the pragma line of LinkDef.
> >     Case C: You use the automatic streamer in the dictionary file and
> > you
> > already use the option "+" in the LinkDef file. If the old
> >     automatic Streamer does not contain any statement using the
> > functions ReadArray, ReadStaticArray, WriteArray,
> >     WriteStaticArray you have nothing to do, except running rootcint
> > again to regenerate the new form of the Streamer function,
> >     otherwise proceed like for case B.
> > -------------------------
> >
> > In our case we have classes with some basic data types (Float_t, Int_t,
> > etc.) and some fixed size arrays (Float_t[16], ...) without an own
> > streamer. Someone made a test (with root 3.02/06) and found out: that if
> > we compile a writing version of the program and a reading one, both
> > versions once with auto scheme evolution enabled ('+' added in the
> > LinkDef file) and without it: both readers can read both files without
> > any further changes. Does this work by chance or did I missunderstood
> > the stetement above.
> >
> > Best regards,
> > Thomas.
> >



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:44 MET