Schema evolution for double isolation[12] to vector<double> isolation, in a split TTree read, is not working

ROOT Version: 6.16.1
Platform: Mac OS
Compiler: clang

I am having a problem with a class that wrote a “double isolation[12]” among its members in a TTree to a set of files. New data has 14 instead of 12 for “isolation”, so I decided it may be better to replace the double array with “std::vector isolation”. I increased the clasdef version from 3 to 4.

To facilitate the reading of the old data files, I first tried a custom streamer, but this is not called because the TTree was split. I then tried to create a conversion rule in the linkdef file:

#pragma read  \
    sourceClass="SvtTrack" \
    source="double isolation[12]" \
     version=[-3]                 \
     targetClass="SvtTrack" \
     target="isolation" \
     embed="true"                 \
     include="iostream,vector"         \
code = "{std::cout << \"custom streamer \"; std::copy(&onfile.isolation[0],&onfile.isolation[11],std::back_inserter(isolation));}"

I verified that this ends up in the dictionary that gets created, but the code is never called when reading from the TTree. I still get the error:

Warning in <TStreamerInfo::BuildOld>: Cannot convert SvtTrack::isolation from type: double to type: vector<double>, skip element

Can someone please point me on how to resolve this?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

2 things to try to figure out if it is a defiency or something else.

a) try to apply a rule to one of the data member that is not an array.

b) try to create a file with an object stored as v3 and read as v4 (without a custom streamer).

If a) succeeds and b) fails the same way you describe, then it is a problem in the support for schema rules and after checking the problem is still present in v6.18/00, please file a report in JIRA.