HypoTestInverter class for performing an hypothesis test inversion by scanning the hypothesis test results of an
HypoTestCalculator for various values of the parameter of interest. By looking at the confidence level curve of
the result an upper limit, where it intersects the desired confidence level, can be derived.
The class implements the RooStats::IntervalCalculator interface and returns an RooStats::HypoTestInverterResult class.
The result is a SimpleInterval, which via the method UpperLimit returns to the user the upper limit value.
The HypoTestInverter implements various option for performing the scan. HypoTestInverter::RunFixedScan will scan using a fixed grid the parameter of interest. HypoTestInverter::RunAutoScan will perform an automatic scan to find optimally the curve and it will stop until the desired precision is obtained.
The confidence level value at a given point can be done via HypoTestInverter::RunOnePoint.
The class can scan the CLs+b values or alternativly CLs (if the method HypoTestInverter::UseCLs has been called).
Contributions to this class have been written by Giovanni Petrucciani and Annapaola Decosa

Constructor from a HypoTestCalculatorGeneric
The HypoTest calculator must be a FrequentistCalculator or HybridCalculator type
Other type of calculators are not supported.
The calculator must be created before by using the S+B model for the null and
the B model for the alt
If no variable to scan are given they are assumed to be the first variable
from the parameter of interests of the null model

Constructor from a reference to a HybridCalculator
The calculator must be created before by using the S+B model for the null and
the B model for the alt
If no variable to scan are given they are assumed to be the first variable
from the parameter of interests of the null model

Constructor from a reference to a FrequentistCalculator
The calculator must be created before by using the S+B model for the null and
the B model for the alt
If no variable to scan are given they are assumed to be the first variable
from the parameter of interests of the null model

Constructor from a reference to a AsymptoticCalculator
The calculator must be created before by using the S+B model for the null and
the B model for the alt
If no variable to scan are given they are assumed to be the first variable
from the parameter of interests of the null model

Constructor from a model for B model and a model for S+B.
An HypoTestCalculator (Hybrid of Frequentis) will be created using the
S+B model as the null and the B model as the alternate
If no variable to scan are given they are assumed to be the first variable
from the parameter of interests of the null model

run an automatic scan until the desired accurancy is reached
Start by default from the full interval (min,max) of the POI and then via bisection find the line crossing
the target line
Optionally an hint can be provided and the scan will be done closer to that value
If by bisection the desired accuracy will not be reached a fit to the points is performed

get the distribution of lower limit
if rebuild = false (default) it will re-use the results of the scan done
for obtained the observed limit and no extra toys will be generated
if rebuild a new set of B toys will be done and the procedure will be repeted
for each toy

get the distribution of lower limit
if rebuild = false (default) it will re-use the results of the scan done
for obtained the observed limit and no extra toys will be generated
if rebuild a new set of B toys will be done and the procedure will be repeted
for each toy
The nuisance parameter value used for rebuild is the current one in the model
so it is user responsability to set to the desired value (nomi

rebuild the sampling distributions by
generating some toys and find for each of theam a new upper limit
Return the upper limit distribution and optionally also the pValue distributions for Cls, Clsb and Clbxs
as a TList for each scanned point
The method uses the present parameter value. It is user responsability to give the current parameters to rebuild the distributions
It returns a upper or lower limit distribution depending on the isUpper flag, however it computes also the lower limit distribution and it is saved in the
output file as an histogram