{ TFile *myFile = new TFile("twobody.root","READ"); myFile->ls(); TCanvas *myCanvas = new TCanvas("c","twobody",0,0,600,900); myCanvas->Divide(2,3); TH1F *th1=h1; TH1F *th2=h2; TH1F *th3=h3; TH1F *th4=h4; TH1F *th5=h5; TF1 *f1=new TF1("f1", "[0]*(1.0+[1]*x+[2]*x*x)/(2+[2])",-1.0,1.0); myCanvas->cd(1); th4->Fit("f1"); myCanvas->cd(2); th1->Fit("f1"); myCanvas->cd(3); th2->Fit("f1"); myCanvas->cd(4); th3->Fit("f1"); myCanvas->cd(5); th5->Fit("f1"); myCanvas.Update(); myCanvas->Print("partwave2.eps"); }