Skip to content

Missing StreamerInfo in file containing nested collection that is non-split but stored member wise #11436

@pcanal

Description

@pcanal

With example below, the resulting file is missing the StreamerInfo for the Inside class preventing schema evolution for this class.

#include <vector>
#include "TTree.h"
#include "TFile.h"

struct Inside {
  int fValue;
};

struct Middle {
  std::vector<Inside> fInside;
};

struct Outer {
  std::vector<Middle> fMiddle;
};

void writefile(bool empty = true, const char *filename = "forceinfo.root")
{
   TFile *f = TFile::Open(filename, "RECREATE");
   TTree *t = new TTree("t", "t");
   Outer object;
   t->Branch("object.", &object);

   if (!empty) {
      Inside in;
      Middle m;
      m.fInside.push_back(in);
      object.fMiddle.push_back(m);
   }

   t->Fill();
   f->Write();
   delete f;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions