Status of Data Model Evolution in Root 5.22?

Hi,
Was wondering what is the current state of the new Data Model Evolution in Root 5.22/00b.

Was trying out some simple examples as in the release notes using the linkdef #pragma read syntax, but it didn’t seem to be taking effect.

I see in the release notes as a todo

Make things operational also in bare ROOT mode

Does this mean that one has to do something special to enable the new data model evolution beyond just the extra linkdef statements?

Thanks,
Josh

[quote]Was trying out some simple examples as in the release notes using the linkdef #pragma read syntax, but it didn’t seem to be taking effect. [/quote]What did you try?

Cheers,
Philippe.

So first of all, to correct myself, I am actually testing this in root 5.22.00a-cms16

Set up a more standalone test, started with the Event example in the test area, writing out some Event objects to a TTree,

Then modified Event.h to add a new data member “Double_t fTemperatureK”, incremented the class version to 2, and added to the linkdef file:

#pragma read sourceClass=“Event” targetClass=“Event” source=“Double32_t fTemperature"
version=”[-1]" target=“fTemperatureK”
code="{ fTemperatureK = onfile.fTemperature + 273.15; }"

But fTemperatureK is still zero when I read back objects from the old file.

This is also consistent with the less self contained test I had, where none of the schema evolution rules I attempted seemed to have any effect when reading back the old files.

Let me know if I am missing something, or if this is not supposed to work yet the way I am expecting!

Thanks,
Josh

Hi,

Try with version="[1]"

Cheers,
Philippe

Hi Philippe,
That change has no effect.

Thanks,
Josh

Hi Josh,

Can you send a complete running example showing the problem?

Thanks,
Philippe.

Hi Philippe,
Put a tarball in /afs/cern.ch/user/b/bendavid/public/evolutiontest/evolutiontest.tar.gz

Wrote out the original file tree4.root using the libraries in /test and the macro /test/testTree.C

Trying to read back the file (copied from test to testread) using the libraries in /testread and the macro /testread/testtree.C

Thanks,
Josh

Hi Josh,

Thank you for you example, I discovered the cause of the problem and will provide a fix shortly. As a work-around, you can use a different set of version numbers (i.e. 2 and 3 rather than 1 and 2).

Cheers,
Philippe.

Hi,

The problem has been resolved in the trunk (revision 29272).

Cheers,
Philippe.

Hi Philippe,

Indeed this works as expected if I use class versions 2 and 3 instead of 1 and 2.

In case I wanted to use this feature on some existing files which had some classes written with version 1, is there any possible workaround other than moving to head?

Tried playing around with the source checksum in this example:

#pragma read sourceClass=“Event” targetClass=“Event” source=“Double32_t fTemperature"
version=”[1]" checksum="[3676872598]" target=“fTemperatureK”
code="{ fTemperatureK = onfile.fTemperature + 273.15; }"

but that didn’t seem to work.

(Checksum was obtained by opening the old file in the interpreter and doing
Event *e = new Event;
e->Class()->GetStreamerInfo(1)->GetCheckSum()

Thanks again,
Josh

Hi Josh,

Indeed the checksum lookup was also broken in this case. It is fixed in the trunk (revision 29276).

Cheers,
Philippe.