void prova() { Int_t n = 10; Float_t arr[n]; TFile fout("output.root","RECREATE"); TTree *tree = new TTree("tree","example for array"); tree->Branch("n",&n,"n/I"); tree->Branch("arr",arr,"arr[n]/F"); for (int k=0; kUniform(0,1); arr[k]=val; } cout<<"Array done\n"; tree->Fill(); cout<<"Tree Filled\n"; fout.cd(); fout.Write(); fout.Close(); cout<<"File Ready\n"; }