Problem with Tminuit

Dear ROOTers.

I have a problem.

I have 1D histo. I have derived it from ROOT file. So, I need to create cumulative histo from my 1D histo. As I have correlation errors in each bin of my 1D histo I need to create covariance matrix for cumulative histo fitting. For this reason I had to use TMinuit.

I have created my fit model pol7_model. I have created fcn function for calculation chi square value.

So in my script, when I call minimization->mnexcm, I recieve error :

Error: illegal pointer to class object histo_cum 0x0 204 script_matr.C:36:

histo_cum is cumulative histo which have already defined. I don’t understand why it can be.

Script and ROOT file have been attached.

Please, help me.

script_matr.C (4.7 KB)

background_checking_1.root (84.7 KB)

Try to replace:

TH1F* histo_cum = histo->Clone("r-t-relation");


histo_cum = (TH1F*)histo->Clone("r-t-relation");

Dear Wile_E_Coyote. Thank you for your reply.

I had replaced it. And error disappeared. But I received another error :

Error: Function pol7_model(x,par) is not defined in current scope script_matr.C:40:

So. The function pol7_model is defined before fcn function calling. I don’t still understand that situation.

Try with:

double pol7_model(Double_t x, Double_t *par)


The next error is :

Error: Symbol mat[i][j] is not defined in current scope script_matr.C:47:
Error: Binary operator oprand missing script_matr.C:47:

Try to move the TMatrixD mat(56,56); definition to a place before you define “fcn”.

Dear Wile_E_Coyote. It works!!!

Thank you very much.

Best regards

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.