# Is there a big difference between TFitter and TMinuit?

**URL:** <https://root-forum.cern.ch/t/is-there-a-big-difference-between-tfitter-and-tminuit/39023>\
**Category:** Newbie\
**Created:** [April 21, 2020, 11:47pm UTC](https://root-forum.cern.ch/t/is-there-a-big-difference-between-tfitter-and-tminuit/39023 "2020-04-21T23:47:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eggsAndCoffee](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Post date:** [April 21, 2020, 11:47pm UTC](https://root-forum.cern.ch/t/is-there-a-big-difference-between-tfitter-and-tminuit/39023/1 "2020-04-21T23:47:03Z")

</div>

Hello all.

@moneta I’m trying to appreciate if there is a big difference between the TFitter and TMinuit classes, and when one should be used over the other (or if one should _always_ be used over the other?). I see from the documentation of TFitter that TFitter is based on TMinuit (see [https://root.cern.ch/doc/master/classTFitter.html#a9e55c3e524d90ebca866e86f4ca9e06a](https://root.cern.ch/doc/master/classTFitter.html#a9e55c3e524d90ebca866e86f4ca9e06a)), so this suggests to me that TFitter is the newer class and should be used instead. Is this correct? Or is TFitter really the exact same as TMinuit, just acting as a “wrapper” that is more friendly to interact with?

Thank you in advance for any help.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [April 22, 2020, 12:44pm UTC](https://root-forum.cern.ch/t/is-there-a-big-difference-between-tfitter-and-tminuit/39023/2 "2020-04-22T12:44:53Z")

</div>

Hi

TFitter is just a wrapper for TMinuit and it is a class that we do not recommend to use it. We have replaced the TFItter class with the ROOT::Fit::Fitter class since several years and we recommend to use that one for a complex fitting problem. With the new Fitter class you can also use different minimisers in addition to TMinuit

Lorenzo

---

<div class="post-metadata">

**Author:** ![eggsAndCoffee](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Post date:** [April 22, 2020, 11:40pm UTC](https://root-forum.cern.ch/t/is-there-a-big-difference-between-tfitter-and-tminuit/39023/3 "2020-04-22T23:40:50Z")

</div>

Okay, thank you for this explanation. I wasn’t aware of ROOT::Fit::Fitter. I didn’t see any tutorial code for this class but it’s possible that I missed it, can you please direct me to one if one exists?

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [April 23, 2020, 7:01am UTC](https://root-forum.cern.ch/t/is-there-a-big-difference-between-tfitter-and-tminuit/39023/4 "2020-04-23T07:01:39Z")

</div>

You can look at  
[https://root.cern.ch/doc/master/exampleFit3D\_8C.html](https://root.cern.ch/doc/master/exampleFit3D_8C.html)

Lorenzo

---

<div class="post-metadata">

**Author:** ![eggsAndCoffee](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@eggsAndCoffee](https://root-forum.cern.ch/u/eggsAndCoffee)\
**Post date:** [April 23, 2020, 12:43pm UTC](https://root-forum.cern.ch/t/is-there-a-big-difference-between-tfitter-and-tminuit/39023/5 "2020-04-23T12:43:55Z")

</div>

Okay, thank you very much!
