Hi,

I know it’s late but the code is exactly what I am looking for. It does everything I want. 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