{ TFile f("strangehisto.root"); TH1D *h3d_z=(TH1D*) gDirectory->Get("h3d_z"); TF1 *aa=(TF1*) gROOT->GetFunction("gaus"); //new TF1("aa","gaus",0.5,1.5); TH1D *h3d_x=(TH1D*) h3d_z->Clone("h3d_x"); aa->SetParameters(10.,1.,0.1); gStyle->SetOptFit(); TCanvas c; c.Divide(1,2); c.cd(1); h3d_z->Fit(aa,"B"); aa->Print(); aa->SetParameters(10.,1.,0.1); c.cd(2); h3d_x->Fit(aa); // h3d_x->Fit(aa); aa->Print(); }