int rootTest() { TFile* outfile = new TFile("test.root", "RECREATE"); TTree* tree = new TTree("tree", "test tree"); int bufsize = 32000; int split = 1; TwoVector* twoVec = new TwoVector(1,1); TBranch* b = tree->Branch("twoVec", "TwoVector", &twoVec, bufsize, split); // Fill with some random numbers. for (int i = 0; i<100; ++i){ float r1 = static_cast(rand()) / static_cast(RAND_MAX); float r2 = static_cast(rand()) / static_cast(RAND_MAX); twoVec->set(r1, r2); tree->Fill(); } tree->Write(); return 0; }