Dear Experts,
I have a code comprised of several classes and functions, one of which is responsible for fitting. This function will take as an argument a vector and the kind of fit and will return two values of interest with itheir uncertainties (typically sigma and mean or MPV and sigma), the goodness (Ndf/chi^2) and the corresponding TH1D. The definition of the function is as follows:
int LGADBase::IterativeFit(std::vector<double> *w, std::pair<double, double> &gmean, std::pair<double, double> &gsigma, TH1D* &FitHist, double &minchi2, std::string methode, std::pair<int, int> points)
with the first argument being a pointer tot he vector to fit, then pointers to the variables that will receive the mean and the sigma, a pointer to the fit, a pointer to the goodness variable, the methode argument and at the end a start and stop index for which elements to use from the supplied vector.
The function works and returns all the information but I only get the TH1D binned histogram without the fit info, although while fitting I do specify the āSā option to save the fit. Is there a way to have the histogram with the traced fit passed over? Is this a result of me passing a pointer to an object that is just an empty TH1D and not one that can accept fit values?
Thanks a lot for the help!!
Vagelis
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided