# Roofit and RooStats

**URL:** https://root-forum.cern.ch/c/roofit-and-roostats/12.md

[Latest](https://root-forum.cern.ch/latest.md) · [Categories](https://root-forum.cern.ch/categories.md) · [Tags](https://root-forum.cern.ch/tags.md)

---

## [About the Roofit and RooStats category](https://root-forum.cern.ch/t/about-the-roofit-and-roostats-category/46)

<div class="topic-metadata">

**Author:** [@system](https://root-forum.cern.ch/u/system)\
**Replies:** 0\
**Last updated:** [April 24, 2008, 1:45pm UTC](https://root-forum.cern.ch/t/about-the-roofit-and-roostats-category/46 "2008-04-24T13:45:22Z")

</div>

Discuss RooFit and RooStats here. We focus on questions on how to use RooFit and RooStats, and solve problems like unexpected behaviour. Please post bug reports in Jira. For questions like “Can you write a macro that f…

---

## [Possible bug in 2D multi-range extended fit with EvalBackend("cpu")](https://root-forum.cern.ch/t/possible-bug-in-2d-multi-range-extended-fit-with-evalbackend-cpu/65000)

<div class="topic-metadata">

**Author:** [@Elia\_Giulio\_Grandoni](https://root-forum.cern.ch/u/Elia_Giulio_Grandoni)\
**Replies:** 2\
**Last updated:** [October 8, 2026, 8:00pm UTC](https://root-forum.cern.ch/t/possible-bug-in-2d-multi-range-extended-fit-with-evalbackend-cpu/65000 "2026-10-08T20:00:31Z")

</div>

Possible bug in 2D multi-range extended fit with EvalBackend("cpu") Hi, I am observing a discrepancy between the cpu and legacy RooFit backends when performing an extended fit in multiple disjoint ranges in 2D. The iss…

---

## [Question about the scaling factor in ROOT’s weighted Poisson log-likelihood (WLS fit)](https://root-forum.cern.ch/t/question-about-the-scaling-factor-in-root-s-weighted-poisson-log-likelihood-wls-fit/64952)

<div class="topic-metadata">

**Author:** [@Byungchul\_Yu](https://root-forum.cern.ch/u/Byungchul_Yu)\
**Replies:** 11\
**Last updated:** [September 15, 2026, 6:55pm UTC](https://root-forum.cern.ch/t/question-about-the-scaling-factor-in-root-s-weighted-poisson-log-likelihood-wls-fit/64952 "2026-09-15T18:55:37Z")

</div>

Hi ROOT experts, I have been studying the implementation of the weighted log-likelihood fit (“WL” option) in ROOT (v6.36.04), and I would like to understand the statistical motivation behind one part of the implementati…

---

## [Using RooFit to fit a model with a gaussian, exponential and templatedfunction](https://root-forum.cern.ch/t/using-roofit-to-fit-a-model-with-a-gaussian-exponential-and-templatedfunction/64978)

<div class="topic-metadata">

**Author:** [@ljhuisman](https://root-forum.cern.ch/u/ljhuisman)\
**Replies:** 1\
**Last updated:** [August 24, 2026, 1:42pm UTC](https://root-forum.cern.ch/t/using-roofit-to-fit-a-model-with-a-gaussian-exponential-and-templatedfunction/64978 "2026-08-24T13:42:06Z")

</div>

Currently I am working on a fit of the invariant mass distribution of D^0. For this I currently use an exponential background, gaussian signal and template function for reflections which I obtain from Monte Carlo (MC). T…

---

## [Bug with RooExtendPdf produces inconsistency in rf204b\_extendedLikelihood\_rangedFit.C between before 6.26 and after 6.28](https://root-forum.cern.ch/t/bug-with-rooextendpdf-produces-inconsistency-in-rf204b-extendedlikelihood-rangedfit-c-between-before-6-26-and-after-6-28/64962)

<div class="topic-metadata">

**Author:** [@atsushi](https://root-forum.cern.ch/u/atsushi)\
**Replies:** 3\
**Last updated:** [August 6, 2026, 6:55am UTC](https://root-forum.cern.ch/t/bug-with-rooextendpdf-produces-inconsistency-in-rf204b-extendedlikelihood-rangedfit-c-between-before-6-26-and-after-6-28/64962 "2026-08-06T06:55:10Z")

</div>

Dear experts, I am reporting a bug in RooExtendPdf, which can be seen in rf204b\_extendedLikelihood\_rangedFit.C of the tutorial. In the recent versions, the fit using RooExtendPdf class has wrong best-fit values of N=449…

---

## [Creating own p.d.f. in RooFit](https://root-forum.cern.ch/t/creating-own-p-d-f-in-roofit/64948)

<div class="topic-metadata">

**Author:** [@meNikkie](https://root-forum.cern.ch/u/meNikkie)\
**Replies:** 3\
**Last updated:** [July 22, 2026, 4:58pm UTC](https://root-forum.cern.ch/t/creating-own-p-d-f-in-roofit/64948 "2026-07-22T16:58:25Z")

</div>

Dear experts, I’m trying to create my own roofit p.d.f. with PyROOT to fit some distribution. It should be a two-body phase space multiplied by a polynomial function, which does not look to be easily written in one line…

---

## [Non stability of fitting in roofit](https://root-forum.cern.ch/t/non-stability-of-fitting-in-roofit/64938)

<div class="topic-metadata">

**Author:** [@VDiBella](https://root-forum.cern.ch/u/VDiBella)\
**Replies:** 6\
**Last updated:** [July 22, 2026, 2:23pm UTC](https://root-forum.cern.ch/t/non-stability-of-fitting-in-roofit/64938 "2026-07-22T14:23:54Z")

</div>

Hi, I’m trying to fit double dimension data in roofit. I’m trying to calculate the raw yield. I’m studying principally two particles, the D+ and D-. My main issue is that the data for the D+ and D- are really similar, …

---

## [Question about the calculation of chisquare for 2D roofit](https://root-forum.cern.ch/t/question-about-the-calculation-of-chisquare-for-2d-roofit/64936)

<div class="topic-metadata">

**Author:** [@VDiBella](https://root-forum.cern.ch/u/VDiBella)\
**Replies:** 1\
**Last updated:** [July 9, 2026, 3:14pm UTC](https://root-forum.cern.ch/t/question-about-the-calculation-of-chisquare-for-2d-roofit/64936 "2026-07-09T15:14:16Z")

</div>

Hello, Its been several hours I’m trying to access the chisquare of a fit i’ve done for 2D type of data with roofit. But i can’t find a good way to do it, the chiSquare() function seems to not work if I don’t project my…

---

## [Question about the scaling factor in ROOT's weighted Poisson log-likelihood (WLS fit)](https://root-forum.cern.ch/t/question-about-the-scaling-factor-in-roots-weighted-poisson-log-likelihood-wls-fit/64931)

<div class="topic-metadata">

**Author:** [@Byungchul\_Yu](https://root-forum.cern.ch/u/Byungchul_Yu)\
**Replies:** 1\
**Last updated:** [July 8, 2026, 6:15am UTC](https://root-forum.cern.ch/t/question-about-the-scaling-factor-in-roots-weighted-poisson-log-likelihood-wls-fit/64931 "2026-07-08T06:15:48Z")

</div>

Hi ROOT experts, I have been studying the implementation of the weighted log-likelihood fit (“WL” option) in ROOT (v6.36.04), and I would like to understand the statistical motivation behind one part of the implementati…

---

## [chi2FitTo not limited by limiting range](https://root-forum.cern.ch/t/chi2fitto-not-limited-by-limiting-range/64824)

<div class="topic-metadata">

**Author:** [@Sasha\_Jenkins](https://root-forum.cern.ch/u/Sasha_Jenkins)\
**Replies:** 6\
**Last updated:** [April 30, 2026, 9:48am UTC](https://root-forum.cern.ch/t/chi2fitto-not-limited-by-limiting-range/64824 "2026-04-30T09:48:44Z")

</div>

I’ve been trying to run chi2FitTo on histograms within a fitting range using the Range() option. This has worked for running a likelihood fit, but when using a chi2 fit, it has failed. I’m not sure if this is some intera…

---

## [Extended Likelihood Question of ROOFIT](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786)

<div class="topic-metadata">

**Author:** [@Gao](https://root-forum.cern.ch/u/Gao)\
**Replies:** 5\
**Last updated:** [April 10, 2026, 1:22pm UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786 "2026-04-10T13:22:25Z")

</div>

Hi, everyone, I have a basic question about extended likelihood used in “fitTo“ in ROOFIT like this. model.fitTo(data, Extended(kTure), Save()); I understand this extended means there is a Poisson distribution multipl…

---

## [SumCoefRange() (or equivalent) argument for RooAbsPdf::PlotOn()](https://root-forum.cern.ch/t/sumcoefrange-or-equivalent-argument-for-rooabspdf-ploton/64758)

<div class="topic-metadata">

**Author:** [@lmeyerga](https://root-forum.cern.ch/u/lmeyerga)\
**Replies:** 1\
**Last updated:** [March 18, 2026, 10:21am UTC](https://root-forum.cern.ch/t/sumcoefrange-or-equivalent-argument-for-rooabspdf-ploton/64758 "2026-03-18T10:21:05Z")

</div>

Dear experts, I have a composite pdf (e.g. f \* F\_1 + (1-f) \* F\_2) which I fit over a certain range, and therefore f is defined with respect to that range. However, I wish to plot this pdf over a different range. Simply …

---

## [Roofit - multiple fit different datasets using different PDFs with some shared parameters - ROOT version issue](https://root-forum.cern.ch/t/roofit-multiple-fit-different-datasets-using-different-pdfs-with-some-shared-parameters-root-version-issue/64750)

<div class="topic-metadata">

**Author:** [@andrea.celentano](https://root-forum.cern.ch/u/andrea.celentano)\
**Replies:** 3\
**Last updated:** [March 17, 2026, 9:18am UTC](https://root-forum.cern.ch/t/roofit-multiple-fit-different-datasets-using-different-pdfs-with-some-shared-parameters-root-version-issue/64750 "2026-03-17T09:18:24Z")

</div>

Dear colleagues, I’d like to follow-up on the issue that I was discussing here: Roofit - multiple fit different datasets using different PDFs with some shared parameters - #10 Apparently, the error was that I was using…

---

## [How to clean/delete properly RooDataSet in PyROOT?](https://root-forum.cern.ch/t/how-to-clean-delete-properly-roodataset-in-pyroot/64749)

<div class="topic-metadata">

**Author:** [@ibelyaev](https://root-forum.cern.ch/u/ibelyaev)\
**Replies:** 14\
**Last updated:** [March 14, 2026, 2:55pm UTC](https://root-forum.cern.ch/t/how-to-clean-delete-properly-roodataset-in-pyroot/64749 "2026-03-14T14:55:52Z")

</div>

What is the correct/recommended way to clean/delete RooDataSet in PyROOT ? I have a use case where relatively large dataset is created and used inside the loop. and I see that memory is not free after the loop. import…

---

## [Fit Convergence with Status 5](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745)

<div class="topic-metadata">

**Author:** [@Mustaphaa](https://root-forum.cern.ch/u/Mustaphaa)\
**Replies:** 3\
**Last updated:** [March 11, 2026, 3:40am UTC](https://root-forum.cern.ch/t/fit-convergence-with-status-5/64745 "2026-03-11T03:40:41Z")

</div>

Dear Experts, I’m trying to minimize a given likelihood and obtained the following results, where the pulls seem reasonable and the uncertainties as well, but the status it gives is 5, meaning the Hessian failed. Info …

---

## [Splot with fixed yield](https://root-forum.cern.ch/t/splot-with-fixed-yield/64728)

<div class="topic-metadata">

**Author:** [@pierabattista](https://root-forum.cern.ch/u/pierabattista)\
**Replies:** 1\
**Last updated:** [March 3, 2026, 10:48am UTC](https://root-forum.cern.ch/t/splot-with-fixed-yield/64728 "2026-03-03T10:48:40Z")

</div>

Dear experts, I have a question about the Splot function of ROOT with fixed yields. In my analysis, I am performing a simultaneous fit between two categories, which we can call category A and category B. Category A is w…

---

## [Minimizer issue: inconsistent results across ROOT versions](https://root-forum.cern.ch/t/minimizer-issue-inconsistent-results-across-root-versions/64721)

<div class="topic-metadata">

**Author:** [@fsimone](https://root-forum.cern.ch/u/fsimone)\
**Replies:** 4\
**Last updated:** [March 2, 2026, 12:41pm UTC](https://root-forum.cern.ch/t/minimizer-issue-inconsistent-results-across-root-versions/64721 "2026-03-02T12:41:04Z")

</div>

Dear experts, I have a simple code that fits two mass peaks simultaneously. The setup is pretty simple, RooGaussian + RooChebychev, where the mean and sigma of the gaussian are shared between the two mass regions (RooC…

---

## [Error in StandardHypoTestInvDemo.C after ROOT 6.32](https://root-forum.cern.ch/t/error-in-standardhypotestinvdemo-c-after-root-6-32/64722)

<div class="topic-metadata">

**Author:** [@fsili](https://root-forum.cern.ch/u/fsili)\
**Replies:** 1\
**Last updated:** [February 27, 2026, 5:40pm UTC](https://root-forum.cern.ch/t/error-in-standardhypotestinvdemo-c-after-root-6-32/64722 "2026-02-27T17:40:47Z")

</div>

Hello experts, I want to use the macro StandardHypoTestInvDemo.C to compute limits with toys. I am currently using ROOT version 6.36 but I found that the macro does not work anymore as I am getting the following error: …

---

## [How to set fit range in simultaneous fit?](https://root-forum.cern.ch/t/how-to-set-fit-range-in-simultaneous-fit/64692)

<div class="topic-metadata">

**Author:** [@fROOTtinator](https://root-forum.cern.ch/u/fROOTtinator)\
**Replies:** 2\
**Last updated:** [February 24, 2026, 10:32am UTC](https://root-forum.cern.ch/t/how-to-set-fit-range-in-simultaneous-fit/64692 "2026-02-24T10:32:11Z")

</div>

Dear Root Community, I was wondering what is the correct way to set a fit range or multiple fit ranges for a simultaneous fit? There are a few post regarding this topic and a page (p.71) dedicated to this in the RooFit …

---

## [Unexpected result with RooFFTConvPDF after ROOT 6.32](https://root-forum.cern.ch/t/unexpected-result-with-roofftconvpdf-after-root-6-32/64574)

<div class="topic-metadata">

**Author:** [@kyu](https://root-forum.cern.ch/u/kyu)\
**Replies:** 4\
**Last updated:** [February 4, 2026, 2:45pm UTC](https://root-forum.cern.ch/t/unexpected-result-with-roofftconvpdf-after-root-6-32/64574 "2026-02-04T14:45:11Z")

</div>

Dear experts, I am using the RooFFTConvPdf to describe the detector resolution. I found that the fit could easily converge with the root before v6.32.00. But diverge for the v6.32.00. Given the log RooAbsMinimizerFc…

---

## [Roofit differences in LCG\_105 and LCG\_107](https://root-forum.cern.ch/t/roofit-differences-in-lcg-105-and-lcg-107/64625)

<div class="topic-metadata">

**Author:** [@nicolo.trevisani](https://root-forum.cern.ch/u/nicolo.trevisani)\
**Replies:** 1\
**Last updated:** [February 2, 2026, 12:55pm UTC](https://root-forum.cern.ch/t/roofit-differences-in-lcg-105-and-lcg-107/64625 "2026-02-02T12:55:13Z")

</div>

Dear ROOT experts, I am trying to fit a distribution using a gaussian to describe the J/Psi resonance and an error function to describe the background. I noticed that if I use LCG\_105, I get a sensible result, while us…

---

## [redirectServers - Server not redirected](https://root-forum.cern.ch/t/redirectservers-server-not-redirected/64612)

<div class="topic-metadata">

**Author:** [@Rishabh\_Mehta](https://root-forum.cern.ch/u/Rishabh_Mehta)\
**Replies:** 5\
**Last updated:** [January 29, 2026, 7:28pm UTC](https://root-forum.cern.ch/t/redirectservers-server-not-redirected/64612 "2026-01-29T19:28:42Z")

</div>

I have a pdf which is a convolution of an exponential with a resolution function (RooBDecay). I create an NLL from this and use it to fit. The fitting portion is fine, however, when I try to use this NLL for any other pu…

---

## [Likelihood Ratio Function (without Fit)](https://root-forum.cern.ch/t/likelihood-ratio-function-without-fit/64603)

<div class="topic-metadata">

**Author:** [@vcroft](https://root-forum.cern.ch/u/vcroft)\
**Replies:** 3\
**Last updated:** [January 26, 2026, 7:40am UTC](https://root-forum.cern.ch/t/likelihood-ratio-function-without-fit/64603 "2026-01-26T07:40:07Z")

</div>

Hi @moneta, @jonas I think I’m being an idiot and missing something, can you help out? I’d like to do a simple likelihood ratio test to say, “is the data closer to H0 or H1” I have the HistFactory model, H0 == \[norm0 = …

---

## [Roofit: PDFs with different domain in the same model (e.g. gauss + lognormal)](https://root-forum.cern.ch/t/roofit-pdfs-with-different-domain-in-the-same-model-e-g-gauss-lognormal/64505)

<div class="topic-metadata">

**Author:** [@malfonsi79](https://root-forum.cern.ch/u/malfonsi79)\
**Replies:** 8\
**Last updated:** [January 22, 2026, 12:30pm UTC](https://root-forum.cern.ch/t/roofit-pdfs-with-different-domain-in-the-same-model-e-g-gauss-lognormal/64505 "2026-01-22T12:30:33Z")

</div>

Hi all, I would like to ask how to make (and then fit to data) a Roofit model that combines model with different domain for the independent variable. For example a simple RooAddPdf between a RooLognormal, which is defin…

---

## [Pdf projection difference between root 6.36.06 and root 6.38.00](https://root-forum.cern.ch/t/pdf-projection-difference-between-root-6-36-06-and-root-6-38-00/64585)

<div class="topic-metadata">

**Author:** [@de\_Vivie](https://root-forum.cern.ch/u/de_Vivie)\
**Replies:** 2\
**Last updated:** [January 15, 2026, 1:13pm UTC](https://root-forum.cern.ch/t/pdf-projection-difference-between-root-6-36-06-and-root-6-38-00/64585 "2026-01-15T13:13:23Z")

</div>

Hello, I am trying to fit a model to some data, with 3 regions, and then draw the projections. In root 6.36.06, the plots look fine. In 6.38.00, the normalisation of the pdf seem crazy in the projection (the fits in bot…

---

## [Comparison of binned data to results of unbinned fit](https://root-forum.cern.ch/t/comparison-of-binned-data-to-results-of-unbinned-fit/64567)

<div class="topic-metadata">

**Author:** [@read](https://root-forum.cern.ch/u/read)\
**Replies:** 2\
**Last updated:** [January 9, 2026, 3:35pm UTC](https://root-forum.cern.ch/t/comparison-of-binned-data-to-results-of-unbinned-fit/64567 "2026-01-09T15:35:11Z")

</div>

I have studied recent ATLAS plots that compare binned MC data to the pdf that is fitted unbinned to the same MC data. For pdfs with a peaking structure, like a Gaussian or Crystal Ball function, there is a characteristic…

---

## [Automatic axis range for 2D and 3D histograms](https://root-forum.cern.ch/t/automatic-axis-range-for-2d-and-3d-histograms/19962)

<div class="topic-metadata">

**Author:** [@tangzhch](https://root-forum.cern.ch/u/tangzhch)\
**Replies:** 3\
**Last updated:** [December 1, 2025, 6:34pm UTC](https://root-forum.cern.ch/t/automatic-axis-range-for-2d-and-3d-histograms/19962 "2025-12-01T18:34:26Z")

</div>

Hi, I am trying to fill a 2D histogram which have unknown range of X-value, but the range of Y-axis is already known. I use the automatic axis range feature, namely set both the upper and lower limit of X-axis to 0, li…

---

## [TFoam error?](https://root-forum.cern.ch/t/tfoam-error/64492)

<div class="topic-metadata">

**Author:** [@Vikas\_Raj](https://root-forum.cern.ch/u/Vikas_Raj)\
**Replies:** 1\
**Last updated:** [December 1, 2025, 8:25am UTC](https://root-forum.cern.ch/t/tfoam-error/64492 "2025-12-01T08:25:52Z")

</div>

Dear experts, I am generating toys using TFoam inside a multiprocessing setup (running many toys in parallel). The job finishes and the output ROOT files are created correctly, but during the run TFoam prints many error…

---

## [Pythonization of RooDataSetHelper with weights not working?](https://root-forum.cern.ch/t/pythonization-of-roodatasethelper-with-weights-not-working/64413)

<div class="topic-metadata">

**Author:** [@rquaglia](https://root-forum.cern.ch/u/rquaglia)\
**Replies:** 9\
**Last updated:** [November 18, 2025, 2:51pm UTC](https://root-forum.cern.ch/t/pythonization-of-roodatasethelper-with-weights-not-working/64413 "2025-11-18T14:51:23Z")

</div>

Dear experts, Here is a reproducer of the problem. ( basically a tutorial script with the weight var for RDataFrame → RooDataSet making) import ROOT import math # Set up # ------------------------ # We create an …

---

## [Implementation of the Complex Part of a PDF](https://root-forum.cern.ch/t/implementation-of-the-complex-part-of-a-pdf/64402)

<div class="topic-metadata">

**Author:** [@Mustaphaa](https://root-forum.cern.ch/u/Mustaphaa)\
**Replies:** 1\
**Last updated:** [November 13, 2025, 11:15am UTC](https://root-forum.cern.ch/t/implementation-of-the-complex-part-of-a-pdf/64402 "2025-11-13T11:15:59Z")

</div>

Dear Experts, I am trying to fit a PDF that has a real part S^0 and a complex part, as shown in the following figure: I have implemented the real part (S0) using RooAbsPdf (RooClassFactory::makePdfInstance(): ((0…

[Next page](https://root-forum.cern.ch/c/roofit-and-roostats/12.md?page=1)
