#include "TFile.h" #include "TTree.h" #include "test.h" int main() { TFile *f = new TFile("out.root","RECREATE"); TTree *tree = new TTree("tree","prova"); tree->SetBranchStyle(1); test *t = new test(); tree->Branch("t","test",&t); for(int i=0; i<5; ++i) { tree->Fill(); } tree->Write(); f->Close(); return 0; }