Hi everyone I’ve followed the basic example in the user’s guide.
I can get plain simple variables like “floats” to fill correctly and read them back from the tree but I can’t get my arrays to do so.
Relevant sections of the program that fills the tree:
eventTree = new TTree(“eventTree”,“a simplistic event tree”);
eventTree->Branch(“icPlate1E”,&icPlate1E,“icPlate1E/F”); // this branch reads back
eventTree->Branch(“gE”,gE,“gE[30]/F”); // this branch doesn’t read back
Relevant section of the program that reads the tree:
TFile *f = new TFile(“raw15929.root”); // This file has the tree in it
f->ReadAll();
TTree t1 = (TTree)f->Get(“eventTree”);
Float_t x;
Float_t g[30];
t1->SetBranchAddress(“icPlate1E”,&x); // this branch reads back fine
t1->SetBranchAddress(“gE”,g); // this branch doesn’t
As I go through my selector which builds the tree I occasionally, very rarely, get:
Error in : Failed filling branch:eventTree.gE, nbytes=-1
I get the following error message when I try to read the tree:
Error in : unknown branch -> gE
I’ve tried fiddling with having no & and then putting one in to no effect.
Any help much appreciated! Thanks in advance!