I have been trying to do some fitting and I am curious if I am accessing the cov correctly…
TF1 *total_func = new TF1("total", total_function, 0, 300, 8);
// Setup appropriate values
total_func->SetParameter(0, 1.0);
total_func->SetParameter(1, 20);
total_func->SetParameter(2, 2.5);
total_func->SetParameter(3, -0.05);
total_func->SetParameter(4, 0);
total_func->SetParLimits(0, 0, 1000);
total_func->SetParLimits(2, 0, 10);
total_func->SetParLimits(3, -2, 2);
total_func->FixParameter(1, 20);
total_func->FixParameter(4, 0);
total_func->SetParameter(5, 1.0);
total_func->SetParameter(6, 80);
total_func->SetParameter(7, 10);
total_func->SetParLimits(5, 0, 10000);
total_func->SetParLimits(6, 50, 100);
total_func->SetParLimits(7, 0, 30);
if(!background) {
total_func->SetParameter(0, 0.0);
total_func->FixParameter(0, 0.0);
}
if(!usesignal) {
total_func->SetParameter(5, 0.0);
total_func->FixParameter(5, 0.0);
}
// Now lets do the fits to the histos...
cout << "Starting the fits for configuration: " << tmpname << endl;
jj_histo->Fit("total", "LM");
Double_t jj_mean = jj_histo->GetFunction("total")->GetParameter(6);
Double_t jj_mean_error = jj_histo->GetFunction("total")->GetParError(6);
Double_t jj_sigma = jj_histo->GetFunction("total")->GetParameter(7);
Double_t jj_sigma_error = jj_histo->GetFunction("total")->GetParError(7);
TVirtualFitter *jj_fitter = TVirtualFitter::GetFitter();
Double_t jj_mean_sigma_cov = jj_fitter->GetCovarianceMatrixElement(6,7);
cout << "The jj cov is: " << jj_mean_sigma_cov << endl;
Does it matter that I have set some of the parameters to fixed? i.e. The cov is only calculated between unfixed quantities so I should be looking for element 4,5?
Justace