Introducing a new namespace and schema evolution

Hi,

We’re trying to introduce a namespace into a pre-existing ROOT class. That seems to work just fine - but if I go to read old ROOT files (before the namespace was in use) using the new version of our ROOT library - I receive warnings that the class name (without the namespace qualifier) is not found.

Can schema evolution save me here? Is there a way I can tell ROOT that namespace::A is the same as A?

Thanks,
Heather

I should point out that I’m using ROOT 4.02.00 and I do see the following in the release notes:

Add support for automatic schema evolution when a namespace is added to a class. For example A is MyClass and B is MyNamespace::MyClass.

Hi Heather,

You got it ::slight_smile:

Rene

Hi,

Ok - so below is an example - I open an older ROOT file before the namespace was introduced, and use the newer libraries to read it.

Are those warnings concerning not finding the classes (they are all the classes now in the namespace) innocuous?

Thanks,
Heather


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 4.02/00 4 January 2005 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      [root.cern.ch](http://root.cern.ch)            *
    
  •                                     *
    

FreeType Engine v2.1.3 used to render TrueType fonts.
Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.159, Nov 14 2004
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] gSystem->Load(“libcommonRootData.so”)
(int)0
root [1] gSystem->Load(“libdigiRootData.so”)
(int)0
root [2] TFile f("/nfs/farm/g/glast/u12/Integration/rootData/398000279/v4r0603$
Warning in TClass::TClass: no dictionary for class AcdId is available
Warning in TClass::TClass: no dictionary for class VolumeIdentifier is availab
le
Warning in TClass::TClass: no dictionary for class CalXtalId is available
Warning in TClass::TClass: no dictionary for class TowerId is available
root [3] DigiEvent *evt = 0
root [4] TTree t = (TTree)f.Get(“Digi”)
root [5] t->SetBranchAddress(“DigiEvent”, &evt)
root [6] t->GetEvent(0)
(Int_t)1674

Actually I also tried this with another type of ROOT file using a different set of classes - that also includes an example where this namespace was introduced. In this case, it looks like BuildOld complains that there is no conversion for a std::vector of elements that consist of a type now in a namespace.

Take care,
Heather


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 4.02/00 4 January 2005 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      [root.cern.ch](http://root.cern.ch)            *
    
  •                                     *
    

FreeType Engine v2.1.3 used to render TrueType fonts.
Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.159, Nov 14 2004
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] gSystem->Load(“libcommonRootData.so”)
(int)0
root [1] gSystem->Load(“libreconRootData.so”)
(int)0
root [2] TFile f("/nfs/farm/g/glast/u12/Integration/rootData/398000279/v4r0603$
Warning in TClass::TClass: no dictionary for class AcdId is available
root [3] TTree t = (TTree)f.Get(“Recon”)
root [4] ReconEvent *evt =0
root [5] t->SetBranchAddress(“ReconEvent”, &evt)
root [6] t->GetEvent(0)
Warning in TStreamerInfo::BuildOld: Cannot convert AcdRecon::m_idCol from type
:vector to type:vectorcommonRootData::AcdId, skip element
(Int_t)8288

Hi Heather,

[quote]Are those warnings concerning not finding the classes (they are all the classes now in the namespace) innocuous? [/quote]Yes, they should be.

[quote]Actually I also tried this with another type of ROOT file using a different set of classes - that also includes an example where this namespace was introduced. In this case, it looks like BuildOld complains that there is no conversion for a std::vector of elements that consist of a type now in a namespace. [/quote]Indeed we have not add support for this type of schema evolution (aka from vector to vectorNS::A). I would like to implement it as soon as possible I will appreciate if you could provide me with a complete (failing) example that I can use to reproduce the problem. Better yet, It would be wonderfull if you could put in a form that fit into the roottest framework.

Cheers,
Philippe.

Downloading roottest:

You can download read-only it via:

cvs -d :pserver:anonymous@cdcvs.fnal.gov:/cvs/cd_read_only co roottest

If you have a Fermilab kerberos principal you can download with write access

cvs -d cvsuser@cdcvs.fnal.gov:/cvs/cd co roottest

If you have a Fermilab ID number, you can also get pserver access.

And see the README file on how to run the test suite and add test to
it.