RooFit: How to get error of fitting parameter?

Hello,

I’m trying to get the error of the final value of the fitting parameter from a saved RooFitResult.
I can get the final value as follows (I’m not sure if it’s the best way, though).

fitresult->floatParsFinal()->find(“par1”)->getVariables()->getRealValue(“par1”);

Is there any way to retrieve the value of the error of the final value (HiError and LoError)?

Thank you in advance for your help.

Wataru

Hello,

I think you could obtain them more easily.

RooRealVar *par1 = new RooRealVar(…);
//…
// after the fitting
par1->getVal();
par1->getAsymErrorHi();
par1->getAsymErrorLo();

you can find more on
http://root.cern.ch/root/html/RooRealVar.html

Jibo

Hi Jibo,

Thank you for your comment.
I may have something misunderstood, but my question is something different.

I have a file only with a saved RooFitResult.
I wanted to know how to get the value from the RooFitResult in the file instead of from the RooRealVar.

Thanks.

Wataru

Hi, Wataru,

Sorry, I really misunderstood your former question. In this case I also want to know the answer. :slight_smile:

Thanks, Jibo

Hi,

The RooRealVars stored in RooFitResult::floatParsFinal()
do contain all errors, so you can do

RooRealVar* par1_fitresult = (RooRealVar*) fitresult->floatParsFinal()->find(“par1”)
par1_fitresult->GetAsymErrorHi() ; // etc…

Wouter

1 Like

Hi Wouter,

It works. Thank you!

Wataru