Skip to content

[RF] Support FitGauss() also in RooMCStudy::plotParam() and friends - #23208

Merged
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:issue-12387
Sep 1, 2026
Merged

[RF] Support FitGauss() also in RooMCStudy::plotParam() and friends#23208
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:issue-12387

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

So far, the FitGauss() command argument that overlays a Gaussian fit of the plotted distribution was only implemented for RooMCStudy::plotPull(). It is now also supported by plotParam(), and hence by plotError() and plotNLL(), which are implemented in terms of plotParam(). Fitting the distribution of the parameter itself with a Gaussian is what one needs for linearity studies, which is why it was requested in the issue.

The code that fits the Gaussian, overlays it and adds the box with the fitted parameters is shared between the pull and the parameter case.

The parameters of the Gaussian are seeded from the moments of the plotted distribution. Seeding them from the frame range instead would fail in two ways: the fitted width runs into the parameter limit if the distribution is much narrower than the frame, and the fitted mean is off if the frame range is not resolved by the precision of the RooWorkspace factory expression that builds the Gaussian.

Closes #12387.

🤖 Done with the help of AI

So far, the FitGauss() command argument that overlays a Gaussian fit of
the plotted distribution was only implemented for RooMCStudy::plotPull().
It is now also supported by plotParam(), and hence by plotError() and
plotNLL(), which are implemented in terms of plotParam(). Fitting the
distribution of the parameter itself with a Gaussian is what one needs
for linearity studies, which is why it was requested in the issue.

The code that fits the Gaussian, overlays it and adds the box with the
fitted parameters is shared between the pull and the parameter case.

The parameters of the Gaussian are seeded from the moments of the plotted
distribution. Seeding them from the frame range instead would fail in two
ways: the fitted width runs into the parameter limit if the distribution
is much narrower than the frame, and the fitted mean is off if the frame
range is not resolved by the precision of the RooWorkspace factory
expression that builds the Gaussian.

Closes root-project#12387.

🤖 Done with the help of AI
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 10h 38m 37s ⏱️
 3 860 tests  3 860 ✅ 0 💤 0 ❌
74 899 runs  74 899 ✅ 0 💤 0 ❌

Results for commit f4f24ad.

@dpiparo dpiparo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I know that may sound picky, but would it be useful to have a test for this new feature?

@couet
couet removed their request for review September 1, 2026 08:56
@guitargeek

Copy link
Copy Markdown
Contributor Author

It is tested by the updated rf801_mcstudy tutorials.

@guitargeek
guitargeek merged commit a20aac9 into root-project:master Sep 1, 2026
39 of 42 checks passed
@guitargeek
guitargeek deleted the issue-12387 branch September 1, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RF] Fitting parameter of interest with Gaussian in RooMCStudy in addition to its pull

2 participants