void exampleParamScan() { auto h1 = new TH1D("h1","h1",100,-5,5); h1->FillRandom("gaus"); auto result = h1->Fit("gaus","LS"); // make scan of likelihood function // create graph with 100 points auto graph = new TGraph(100); auto fitter = (TBackCompFitter*) TVirtualFitter::GetFitter(); // scan the parameter 2 (sigma) in a range 10* the parameter error double pmin = result->Parameter(2) - 10*result->Error(2); double pmax = result->Parameter(2) + 10*result->Error(2); fitter->Scan(2, graph, pmin,pmax); graph->Draw("AC"); }