{ TFile *fin = new TFile("example_data.root"); TH1D *hist = (TH1D *)fin->Get("hist"); hist->SetFillColor(kRed-9); hist->SetStats(false); hist->GetXaxis()->SetTitle("Mass"); TF1 *f1 = new TF1("f1","[0]+[1]*x+[2]*gaus(2)"); f1->SetParameters(100.,-30.,20.,1.,0.05); hist->Fit("f1","L"); }