void cl() { TH1F* h = new TH1F("abc", "abc", 3,0,3); for (int i = 1; i <= 3; ++i) { for (int j = 0; j < i; ++j) { h->Fill(i-.5); } } TFitResultPtr r = h->Fit("pol1", "S"); double point[1] = {1.5}; double interval[1]; r->GetConfidenceIntervals(1, 1, 1, point, interval, 0.95); std::cout << "confidence interval at x=1.5 at 95% CL: " << interval[0] << std::endl; // f = p0 + p1 * x // df / dp0 = 1 // df / dp1 = x double myCalculation = sqrt(r->CovMatrix(0,0) + r->CovMatrix(0,1)*1.5 + r->CovMatrix(1,0)*1.5 + r->CovMatrix(1,1)*1.5*1.5); std::cout << "my calculation at x=1.5: " << myCalculation << std::endl; }