How to plot nuisance parameter distributions

Hi,

When we get limits or p values with a calculator that makes toys (frequentist, hybrid …) we need to fit the Signal + Background or just Background toys to the data, from these fits, that give us the distribution of the test statistic (from which the limits come) one should be able to get the nuisance parameters. The fits are done inside the calculator and my question is:

Is it possible to retrieve the values of the nuisance parameters for each fit? Or at least the plots of the distributions of the nuisance parameters?

Tell me if I was not clear.

Thanks.

Hi,

The RooStats macro, StandardHypoTestInvDemo has an option that enables the detailed output. This produces a data set with all the fitted nuisance parameter value for each generated toy.

Just do:

.L StandardHypoTestInvDemo.C
enableDetailedOutput=true;
StandardHypoTestInvDemo(...........)

and the result file will contains this information

Best Regards

Lorenzo

Hi,

I did not really know how to open and read the result_poi file until I found: [root.cern.ch/phpBB3/viewtopic.p … put#p77917](CLs upper limits using RooStats
The code attached is very clear and I got it working.

Thanks.

Hi,

For some reason I never thought of this but would not it be easier to just put the fit results in a tree where each branch is a vector of doubles? Each branch would represent a parameter in the fit and the vector would store the data for each toy.

It would not take much work to write an executable to transform the HypoTestObject into a Tree, but it would be convenient if its like that by default.

Hi,

Why do you think is more convenient having the result object written as a TTree of double ?
The result object is quite complex, it contains the p-values for S+B and B at each scanned point.
All the needed information is encapsulated in the result object which has should have all the getter methods that you need. In addition there exists also a Plot class taking that object and displaying the result.
This allows also to merge easy the results in case of multiple runs.

For the detailed output, a tree is instead written with the results of the fit

Best Regards

Lorenzo

Hi,

Why do you think is more convenient having the result object written as a TTree of double ?

Because I think its easier to manipulate the data when plotting for instance, I can do:

truth->Draw(“jet_AntiKt4TruthJets_m:jet_AntiKt4TruthJets_pt”,“EventNumber==234”,"*")

To draw the mass vs the pt for a given event. If I had a tree I could do the same between the nuisance parameter a and b for a given sampling point, just to see if there is a correlation between these variables, for instance. Otherwise I have to write code to fill histograms.

The result object is quite complex, it contains the p-values for S+B and B at each scanned point.

These numbers can be put in two extra branches.

All the needed information is encapsulated in the result object which has should have all the getter methods that you need. In addition there exists also a Plot class taking that object and displaying the result.
This allows also to merge easy the results in case of multiple runs.

Ok, merging them probably would not be straightforward, hadd would just put the old scanning points before the new ones.

For the detailed output, a tree is instead written with the results of the fit

Ok, I will check again, I could not find the tree, I must have missed that.