# TF1 cannot release the fixed parameter

**URL:** <https://root-forum.cern.ch/t/tf1-cannot-release-the-fixed-parameter/33948>\
**Category:** Newbie\
**Created:** [May 7, 2019, 8:21pm UTC](https://root-forum.cern.ch/t/tf1-cannot-release-the-fixed-parameter/33948 "2019-05-07T20:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Y.S.Zhang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/cab0a1/32.png) [@Y.S.Zhang](https://root-forum.cern.ch/u/Y.S.Zhang)\
**Post date:** [May 7, 2019, 8:21pm UTC](https://root-forum.cern.ch/t/tf1-cannot-release-the-fixed-parameter/33948/1 "2019-05-07T20:21:52Z")

</div>

Dear experts

I had a problem when I fitted the mass distribution of a particle. I wrote a macro called `massfitting.C`, then I called it in the macro `dcaFittingOptimal.C`. And it gave

```auto
Unknown function: 0.00000e+00 fixed
Unknown function: 0.00000e+00 fixed
Unknown function: 0.00000e+00 fixed
Unknown function: 0.00000e+00 fixed
Unknown function: 0.00000e+00 fixed
Unknown function: 0.00000e+00 fixed

```

I think the `TF1` function is well-defined. I am not sure where it went wrong.

Also I attach the macros and root files to the post.

Thanks in advance.  
[dcaFittingOptimal.C](https://root-forum.cern.ch/uploads/default/original/3X/5/8/580c7695b322e8c0e59212e07f5ab8efa178c328.C) (1.9 KB)  
[massfitting.C](https://root-forum.cern.ch/uploads/default/original/3X/0/7/07503cb56bfce2cb120b3d134bcff846d17b41c3.C) (5.2 KB)  
[myAnaConsts.h](https://root-forum.cern.ch/uploads/default/original/3X/9/8/984b5ed56d834db3108d987950245a1023bec586.h) (1.1 KB)  
[npd0ana\_dca\_hists.root](https://root-forum.cern.ch/uploads/default/original/3X/e/5/e5cf9cb0e25b015583a41f771d58e24039097b6d.root) (35.5 KB)

* * *

_ROOT Version:_ root v 6.06/01 & root v 6.16/00  
_Platform:_  
_Compiler:_ gcc5.3 for v6.06, gcc 7.4 for v6.16

* * *

---

<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:** [May 8, 2019, 6:39am UTC](https://root-forum.cern.ch/t/tf1-cannot-release-the-fixed-parameter/33948/2 "2019-05-08T06:39:39Z")

</div>

Either, in the “dcaFittingOptimal.C”, use:

```auto
         TF1 f = massfitting(hMassData, hMassMCNPD0, hMassMCNPD0All, TString::Format("mva%d", iMva));

```

or, in the “massfitting.C”, replace all “`Fit(fname`” with “`Fit(&f`” (that’s what I recommend).

---

<div class="post-metadata">

**Author:** ![Y.S.Zhang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/cab0a1/32.png) [@Y.S.Zhang](https://root-forum.cern.ch/u/Y.S.Zhang)\
**Post date:** [May 8, 2019, 12:53pm UTC](https://root-forum.cern.ch/t/tf1-cannot-release-the-fixed-parameter/33948/3 "2019-05-08T12:53:26Z")

</div>

Thank you, Wile!

The problem has been solved.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 22, 2019, 12:53pm UTC](https://root-forum.cern.ch/t/tf1-cannot-release-the-fixed-parameter/33948/4 "2019-05-22T12:53:26Z")

</div>

Closed on May 22, 2019, 12:53pm UTC

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