void makeSmallerTuple() { gSystem->Load("JansEvent_cc"); JansEvent* j = new JansEvent; TFile f("file.root"); TTree* tin = (TTree*) f.Get("evtTree"); tin->SetBranchAddress("event", &j); //create fout and t in the heap (not in the stack) //to avoid possible problems with order of objects destructions. TFile *fout = new TFile("xCINT.root", "recreate"); TTree *t = new TTree("bugMe", "Sample events"); t->Branch("event", "JansEvent", &j, 32000, 99); for (int iEv=0; iEv<3; ++iEv) { tin->GetEvent(iEv); t->Fill(); } t->Write(); delete fout; }