Hello all,
I have a class with a data member fMomenta
of type std::vector<ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>>>
(with the default coordinate system template type ROOT::Math::DefaultCoordinateSystemTag
), which I have written to ROOT trees.
Well, it turns out it was a mistake: since the 3D vectors in that container are represented in the global coordinate system, they should each have been of type ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::GlobalCoordinateSystemTag>
.
So I put the amenities to generate the dictionary for the “new” type.
The problem is that my attempt to read files with the old data type is frustrated by:
Cannot convert fMomenta from type: vector<ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag> > to type: vector<ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::GlobalCoordinateSystemTag> >, skip element
The checksum of the class seems to be the same as the old one (in fact, the representation on disk and memory has not really changed). I think the problem is that there is no constructor from ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::DefaultCoordinateSystemTag>
to ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>,ROOT::Math::GlobalCoordinateSystemTag>
, (and maybe also the lack of constructors at std::vector
level would be a problem?).
I don’t know how to write an I/O rule, which would be the natural “solution”, because the old and the new class have the same checksum.
Replacing std::vector<>
with a special container and shove it in the throat of the users for years just to make schema evolution work is more than I am comfortable with.
Forcing a change in the checksum with some other trick may be interesting – I don’t know whether it would work, and what the trick might be.
Is there any real solution?