{ TFile *myfile = new TFile("myfile.root","recreate"); int eventno; int version; int npoints; double px[100],py[100],pz[100]; bool isgood[100]; TTree *mytree = new TTree("mytree","this is a plain tree"); mytree->Branch("eventno",&eventno,"eventno/I"); mytree->Branch("version",&version,"version/I"); mytree->Branch("npoints",&npoints,"npoints/I"); mytree->Branch("px",px,"px[npoints]/D"); mytree->Branch("py",py,"py[npoints]/D"); mytree->Branch("pz",pz,"pz[npoints]/D"); mytree->Branch("isgood",isgood,"isgood[npoints]/O"); TRandom3 rnd; for(int evt=0;evt<1000;evt++) { eventno = evt; version = 1234; npoints = (int)rnd.Uniform(1.,100.); for(int i=0;iFill(); } mytree->Write(); myfile->Close(); }