# Getting fit function parameters

**URL:** <https://root-forum.cern.ch/t/getting-fit-function-parameters/52871>\
**Category:** Newbie\
**Tags:** root\
**Created:** [December 22, 2022, 4:16pm UTC](https://root-forum.cern.ch/t/getting-fit-function-parameters/52871 "2022-12-22T16:16:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smatt4](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/smatt4/32/28789_2.png) [@smatt4](https://root-forum.cern.ch/u/smatt4)\
**Post date:** [December 22, 2022, 4:16pm UTC](https://root-forum.cern.ch/t/getting-fit-function-parameters/52871/1 "2022-12-22T16:16:53Z")

</div>

Hello,

I’m experiencing some problems in getting the correct parameters of a function after a fit. What I do in my code is:

- Get the histogram
- Define function with starting parameters (f1)
- Fit histogram with MIGRAD
- Fit again with MINOS

My problem is that when I try to get the parameters using TF1::GetParameter(int) or also printing the TFitResultPtr, I always obtain the results of the first fit from MIGRAD, even if the fit with MINOS was performed and converged successfully. To be clear the parameters I get are different from the standard printout I have after fitting with MINOS.

Is there any advice I can ask to solve this problem?  
Thank you very much!  
Matteo

ROOT Version 6.12/04  
Built for linuxx8664gcc

* * *

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 22, 2022, 5:22pm UTC](https://root-forum.cern.ch/t/getting-fit-function-parameters/52871/2 "2022-12-22T17:22:13Z")

</div>

Attach your macro for inspection.
