# RooAbsOptTestStatistic: ERROR minimum of FUNC observable X is smaller than that of X in the dataset

**URL:** <https://root-forum.cern.ch/t/rooabsoptteststatistic-error-minimum-of-func-observable-x-is-smaller-than-that-of-x-in-the-dataset/52465>\
**Category:** Roofit and RooStats\
**Created:** [November 21, 2022, 3:11pm UTC](https://root-forum.cern.ch/t/rooabsoptteststatistic-error-minimum-of-func-observable-x-is-smaller-than-that-of-x-in-the-dataset/52465 "2022-11-21T15:11:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emil\_R](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/emil_r/32/31255_2.png) [@Emil\_R](https://root-forum.cern.ch/u/Emil_R)\
**Post date:** [November 21, 2022, 3:11pm UTC](https://root-forum.cern.ch/t/rooabsoptteststatistic-error-minimum-of-func-observable-x-is-smaller-than-that-of-x-in-the-dataset/52465/1 "2022-11-21T15:11:20Z")

</div>

Hi,  
I know it’s late but [the code is exactly what I am looking for](https://root-forum.cern.ch/t/can-we-shift-histogram-for-several-channels/12050). [It does everything I want.](https://root-forum.cern.ch/t/can-we-shift-histogram-for-several-channels/12050) But now I also want to fit a pdf to the shifted histogram. This gives me the following error message:

> [#1] INFO:DataHandling – RooDataHist::adjustBinning(Values): fit range of variable Mass expanded to nearest bin boundaries: [825,1800] → [825,1801]
> 
> [#1] INFO:DataHandling – RooDataHist::adjustBinning(Valuescontroll): fit range of variable Mass expanded to nearest bin boundaries: [825,1801] → [824,1804]
> 
> [#1] INFO:DataHandling – RooDataHist::adjustBinning(Sim1405): fit range of variable Mass expanded to nearest bin boundaries: [824,1804] → [820,1820]
> 
> [#1] INFO:Minimization – p.d.f. provides expected number of events, including extended term in likelihood.
> 
> [#1] INFO:Eval – RooRealVar::setRange(Mass) new range named ‘fit’ created with bounds [1050,1580]
> 
> [#0] ERROR:InputArguments – RooAbsOptTestStatistic: ERROR minimum of FUNC observable Mass(820) is smaller than that of Mass in the dataset (825)

Note: Mass is my observable (what is usually called x)  
I do not understand what the problem is. When I change the “Mass” (eg mass(“Mass”,“Mass”,800,1800)) I get the same error, just with different numbers. Maybe someone has had this problem in the meantime too.  
Thanks,  
Emil

---

<div class="post-metadata">

**Author:** ![Emil\_R](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/emil_r/32/31255_2.png) [@Emil\_R](https://root-forum.cern.ch/u/Emil_R)\
**Post date:** [November 22, 2022, 10:31am UTC](https://root-forum.cern.ch/t/rooabsoptteststatistic-error-minimum-of-func-observable-x-is-smaller-than-that-of-x-in-the-dataset/52465/2 "2022-11-22T10:31:27Z")

</div>

I have solved the problem now. The Code changed the TAxis, which I did not see. Therefore the bins are different and this leads to a problem. As I only wanted to shift the bins, it was simpler to fill a new histogram with the data (and shifted x Axis). Afterwards no problems occurred. Thus I can not recommend scaling only one histogram with the code and afterwards fitting to different data. This leads to errors.  
Greetings,  
Emil

---

<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:** [December 6, 2022, 10:32am UTC](https://root-forum.cern.ch/t/rooabsoptteststatistic-error-minimum-of-func-observable-x-is-smaller-than-that-of-x-in-the-dataset/52465/3 "2022-12-06T10:32:01Z")

</div>

Closed on December 6, 2022, 10:32am UTC

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