Cloning tree containing old version of class?

Hello everyone,

Again I’m kind of stuck with this ‘changing a member variable name’ problem. I changed the name of the member variable TMBTrackCalJet::_C to TMBTrackCalJet::_fC, increased the class version and rebuilt the lib. Now when I try to read and clone (using TTree::CloneTree()) a file containing a tree with the old class version (split level 99), I run into the following:

Error in TStreamerInfo::WriteBuffer: The element TMBTrackCalJet::_C type 105 (float) is not supported yet

I don’t really know what it’s trying to do but this 105 looks like kSkip+kFloat (both from TStreamerInfo).

Does this mean it’s trying to skip this branch? If so, why, and why would it then produce this error? What does the CloneTree() method do? It should just make an exact copy, right? So it should not even have to know that the class has changed.

Or am I mistaken somewhere?

Thanks for your help,
Jeroen

Okay, I looked at the CloneTree code and thought about it a bit more.

The CloneTree method actually clones the tree by copying all the (active) branches/leaves. Then it populates it by repeating
GetEntry(entry)
newTree->Fill()

I think this means that it will not be able to make an exact copy if the version of the class in the file is not the same as that of the one in memory. (Especially with a split branch.)

To be honest, this is probably not completely ridiculous since with the new class version in memory, you cannot even read the ‘_C’ branch in the old file (since the TMBTrackCalJet objects where written to a split branch custom streamers are no solution).