I’am trying to fit a histogram using TVirtualFitter in 5 dimensions I have tried to follow an example written by Rene but with little success , it appears that the only major difference is instead of using the bin center to determine the bin expectation for the chi^2 I have integrated over the bin
there seems to be an error concerning the implementation of the fitter specifically I get the following error:
parameter_Fit.C:189: error: call of overloaded `SetFCN(void (&)(THnSparseD*, Double_t&, Double_t*))
I also get the following errors which are not clear to me:
parameter_Fit.C:456: error: invalid operands of types double' andDouble_t*’ to binary operator*' parameter_Fit.C:468: error: invalid operands of typesDouble_t*’ and Double_t' to binaryoperator*’
I have attached my code if you could please have a look
I made the correction you mentioned and all the errors relating to the header file have gone, but the THnSparse histogram does not seem to be passed properly to my function stats(…), with the following error:
Error: non class,struct,union object $fSparse used with . or ->Error: Symbol fSparse is not defined in current scope parameter_Fit.C:248:
thanks
Maki
ps i have attached my updated file parameter_Fit.C (14.7 KB)
fSparse is not defined in the scope of your stats() objective function.
You can defined as a global variable of your program or you can set the pointer in the TVirtualFitter using TVirtualFitter::SetObjectFit and TVirtualFitter::GetObjectFit.
Before fitting (calling Migrad) you should do:
Thanks so much it seems to be working now
but it does not fit the parameters, I had a look at the original code written by
Rene Brun but that also seems to not fit the parameters, why is this?
I have attached this example