# TH1-\>Fit "L" Option

**URL:** <https://root-forum.cern.ch/t/th1-fit-l-option/64058>\
**Category:** Newbie\
**Created:** [August 20, 2025, 7:48pm UTC](https://root-forum.cern.ch/t/th1-fit-l-option/64058 "2025-08-20T19:48:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aclarke](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@aclarke](https://root-forum.cern.ch/u/aclarke)\
**Post date:** [August 20, 2025, 7:48pm UTC](https://root-forum.cern.ch/t/th1-fit-l-option/64058/1 "2025-08-20T19:48:04Z")

</div>

* * *

* * *

Hello, I have a question on how the log likelihood fit for TH1→Fit works. How does ROOT calculate the likelihood function from the fit function? If I do h→Fit(“f“, “L“) how does ROOT calculate the log-likelihood function which needs to be maximized? Also, if necessary how can I change what ROOT uses as the likelihood function?

Thanks.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [August 21, 2025, 4:03am UTC](https://root-forum.cern.ch/t/th1-fit-l-option/64058/2 "2025-08-21T04:03:15Z")

</div>

Check out the TH1 fitting doc:

> **[ROOT: TH1 Class Reference](https://root.cern/doc/master/classTH1.html#fitting-histograms)**

and the links given there, especially the [TH1::Fit](https://root.cern/doc/master/classTH1.html#a7e7d34c91d5ebab4fc9bba3ca47dabdd) method documentation, with the options and more details.

---

<div class="post-metadata">

**Author:** ![aclarke](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@aclarke](https://root-forum.cern.ch/u/aclarke)\
**Post date:** [August 21, 2025, 7:43pm UTC](https://root-forum.cern.ch/t/th1-fit-l-option/64058/3 "2025-08-21T19:43:36Z")

</div>

Thanks, I think this is what I needed. I already looked at the TH1 documentation before, but I somehow missed where they explain the loglikelihood algorithm.
