Hello, I have a question in profile likelihood analysis by roostats.
As a practice, I used “StandardProfileLikelihoodDemo.C” in $ROOTSYS/tutorial/roostats/.
I can show the log-likelihood parabola using above macro, so now I’d like to extract this curve as a function.
I just would like to know the parameter of this calculated parabolic function.
Or I’d like to extract each likelihood value and x-axis value as a ASCII style.
Is it possible?
This is because I’m planing to combine some log-likelihood curves after I get curves.
So I need to reconstruct the shape of calculated parabola.
Thank you so much for your support in advance.
If you use the option “tf1” for drawing the likelihood,
the plotted object is actually an histogram, a
TH1 and you can retrieve it using
LikelihoodIntervalPlot::GetPlottedObject(), then you can retrieve the corresponding likelihood values as bin content of the histogram. Example:
plot.SetNPoints(nScanPoints); // nScanPoints will be the number of histogram bins
auto h = (TH1*) plot.GetPlottedObjet();
for (int i = 1; i <= h->GetNbinsX(); ++i)
std::cout << " x = " << h->GetBinCenter(i) << " Liikelihood(x) = " << h->GetBinContent(i) << std::endl;
Thank you so much for your quick reply!!
And I succeeded to do it following your suggestion.
Thank you so much again.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.