53 using namespace RooStats;
57 double HypoTestInverter::fgCLAccuracy = 0.005;
58 unsigned int HypoTestInverter::fgNToys = 500;
60 double HypoTestInverter::fgAbsAccuracy = 0.05;
61 double HypoTestInverter::fgRelAccuracy = 0.05;
62 std::
string HypoTestInverter::fgAlgo = "logSecant";
64 bool HypoTestInverter::fgCloseProof = false;
69 struct HypoTestWrapper {
71 static void SetToys(HypoTestType *
h,
int toyNull,
int toyAlt) { h->SetToys(toyNull,toyAlt); }
76 void HypoTestInverter::SetCloseProof(
Bool_t flag) {
106 if (!modelSB || ! modelB)
108 assert(modelSB && modelB);
111 <<
"\t\t using as S+B (null) model : "
113 <<
"\t\t using as B (alternate) model : "
114 << modelB->
GetName() <<
"\n" << std::endl;
119 if (!bPdf || !bObs) {
130 if (!poiB || !poiB->
find(scanVariable.
GetName()) ||
133 << scanVariable.
GetName() <<
" not equal to zero "
134 <<
" user must check input model configurations " << endl;
135 if (poiB)
delete poiB;
140 HypoTestInverter::HypoTestInverter( ) :
150 fCalcType(kUndefined),
151 fNBins(0), fXmin(1), fXmax(1),
162 fScannedVariable(scannedVariable),
168 fCalcType(kUndefined),
169 fNBins(0), fXmin(1), fXmax(1),
188 HybridCalculator * hybCalc =
dynamic_cast<HybridCalculator*
>(&hc);
194 FrequentistCalculator * freqCalc =
dynamic_cast<FrequentistCalculator*
>(&hc);
200 AsymptoticCalculator * asymCalc =
dynamic_cast<AsymptoticCalculator*
>(&hc);
216 fScannedVariable(scannedVariable),
223 fNBins(0), fXmin(1), fXmax(1),
250 fScannedVariable(scannedVariable),
256 fCalcType(kFrequentist),
257 fNBins(0), fXmin(1), fXmax(1),
280 fScannedVariable(scannedVariable),
286 fCalcType(kAsymptotic),
287 fNBins(0), fXmin(1), fXmax(1),
315 RooRealVar * scannedVariable, ECalculatorType type,
double size) :
319 fScannedVariable(scannedVariable),
326 fNBins(0), fXmin(1), fXmax(1),
348 fCalculator0(0), fScannedVariable(0),
363 if (
this == &rhs)
return *
this;
420 TString results_name =
"result_";
452 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::GetInterval - return an already existing interval " << std::endl;
457 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::GetInterval - run a fixed scan" << std::endl;
460 oocoutE((
TObject*)0,
Eval) <<
"HypoTestInverter::GetInterval - error running a fixed scan " << std::endl;
463 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::GetInterval - run an automatic scan" << std::endl;
464 double limit(0),err(0);
467 oocoutE((
TObject*)0,
Eval) <<
"HypoTestInverter::GetInterval - error running an auto scan " << std::endl;
523 while (clsMidErr >= fgCLAccuracy && (clsTarget == -1 ||
fabs(clsMid-clsTarget) < 3*clsMidErr) ) {
524 std::unique_ptr<HypoTestResult> more(hc.
GetHypoTest());
529 hcResult->
Append(more.get());
532 if (
fVerbose) std::cout << (
fUseCLs ?
"\tCLs = " :
"\tCLsplusb = ") << clsMid <<
" +/- " << clsMidErr << std::endl;
539 "\tCLs = " << hcResult->
CLs() <<
" +/- " << hcResult->
CLsError() <<
"\n" <<
540 "\tCLb = " << hcResult->
CLb() <<
" +/- " << hcResult->
CLbError() <<
"\n" <<
579 if ( nBins==1 && xMin!=xMax ) {
582 if ( xMin==xMax && nBins>1 ) {
588 << xMin <<
") smaller that xMax (" << xMax <<
")\n";
592 if (xMin < fScannedVariable->getMin()) {
595 << xMin << std::endl;
600 << xMax << std::endl;
604 for (
int i=0; i<nBins; i++) {
608 thisX =
exp(
log(xMin) + i*(
log(xMax)-
log(xMin))/(nBins-1) );
610 thisX = xMin + i*(xMax-xMin)/(nBins-1);
616 if ( status==
false ) {
617 std::cout <<
"\t\tLoop interrupted because of failed status\n";
635 if ( rVal < fScannedVariable->getMin() ) {
638 <<
" on the scanned variable rather than " << rVal<<
"\n";
646 <<
" on the scanned variable rather than " << rVal<<
"\n";
661 const_cast<ModelConfig*
>(sbModel)->SetSnapshot(poi);
682 else lastXtested = -999;
687 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::RunOnePoint - Merge with previous result for "
691 prevResult->
Append(result);
696 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::RunOnePoint - replace previous empty result\n";
733 if ((hint != 0) && (*hint > r->
getMin())) {
734 r->
setMax(std::min<double>(3.0 * (*hint), r->
getMax()));
735 r->
setMin(std::max<double>(0.3 * (*hint), r->
getMin()));
737 <<
" search in interval " << r->
getMin() <<
" , " << r->
getMax() << std::endl;
744 typedef std::pair<double,double> CLs_t;
745 double clsTarget =
fSize;
746 CLs_t clsMin(1,0), clsMax(0,0), clsMid(0,0);
748 limit = 0.5*(rMax + rMin);
749 limitErr = 0.5*(rMax - rMin);
752 TF1 expoFit(
"expoFit",
"[0]*exp([1]*(x-[2]))", rMin, rMax);
778 if (
fVerbose > 0) std::cout <<
"Search for upper limit to the limit" << std::endl;
779 for (
int tries = 0; tries < 6; ++tries) {
782 oocoutE((
TObject*)0,
Eval) <<
"HypoTestInverter::RunLimit - Hypotest failed" << std::endl;
786 if (clsMax.first == 0 || clsMax.first + 3 *
fabs(clsMax.second) < clsTarget )
break;
790 <<
" = " << rMax <<
" still get "
791 << (
fUseCLs ?
"CLs" :
"CLsplusb") <<
" = " << clsMax.first << std::endl;
796 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::RunLimit - Search for lower limit to the limit" << std::endl;
806 if (clsMin.first != 1 && clsMin.first - 3 *
fabs(clsMin.second) < clsTarget) {
812 for (
int tries = 0; tries < 6; ++tries) {
815 if (clsMin.first == 1 || clsMin.first - 3 *
fabs(clsMin.second) > clsTarget)
break;
819 <<
" = " << rMin <<
" still get " << (
fUseCLs ?
"CLs" :
"CLsplusb")
820 <<
" = " << clsMin.first << std::endl;
828 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::RunLimit - Now doing proper bracketing & bisection" << std::endl;
833 oocoutW((
TObject*)0,
Eval) <<
"HypoTestInverter::RunLimit - maximum number of toys reached " << std::endl;
839 limit = 0.5*(rMin+rMax); limitErr = 0.5*(rMax-rMin);
840 if (
fgAlgo ==
"logSecant" && clsMax.first != 0) {
841 double logMin =
log(clsMin.first), logMax =
log(clsMax.first), logTarget =
log(clsTarget);
842 limit = rMin + (rMax-rMin) * (logTarget - logMin)/(logMax - logMin);
843 if (clsMax.second != 0 && clsMin.second != 0) {
844 limitErr = hypot((logTarget-logMax) * (clsMin.second/clsMin.first), (logTarget-logMin) * (clsMax.second/clsMax.first));
845 limitErr *= (rMax-rMin)/((logMax-logMin)*(logMax-logMin));
851 if (limitErr <
std::max(absAccuracy, relAccuracy * limit)) {
853 oocoutI((
TObject*)0,
Eval) <<
"HypoTestInverter::RunLimit - reached accuracy " << limitErr
854 <<
" below " <<
std::max(absAccuracy, relAccuracy * limit) << std::endl;
861 if (!
RunOnePoint(limit,
true, clsTarget) )
return false;
864 if (clsMid.second == -1) {
865 std::cerr <<
"Hypotest failed" << std::endl;
870 if (
fabs(clsMid.first-clsTarget) >= 2*clsMid.second) {
871 if ((clsMid.first>clsTarget) == (clsMax.first>clsTarget)) {
872 rMax = limit; clsMax = clsMid;
874 rMin = limit; clsMin = clsMid;
877 if (
fVerbose > 0) std::cout <<
"Trying to move the interval edges closer" << std::endl;
878 double rMinBound = rMin, rMaxBound = rMax;
880 while (clsMin.second == 0 ||
fabs(rMin-limit) >
std::max(absAccuracy, relAccuracy * limit)) {
881 rMin = 0.5*(rMin+limit);
882 if (!
RunOnePoint(rMin,
true, clsTarget) )
return false;
885 if (
fabs(clsMin.first-clsTarget) <= 2*clsMin.second)
break;
888 while (clsMax.second == 0 ||
fabs(rMax-limit) >
std::max(absAccuracy, relAccuracy * limit)) {
889 rMax = 0.5*(rMax+limit);
891 if (!
RunOnePoint(rMax,
true,clsTarget) )
return false;
893 if (
fabs(clsMax.first-clsTarget) <= 2*clsMax.second)
break;
896 expoFit.SetRange(rMinBound,rMaxBound);
904 std::cout <<
"Limit: " << r->
GetName() <<
" < " << limit <<
" +/- " << limitErr <<
" [" << rMin <<
", " << rMax <<
"]\n";
907 expoFit.FixParameter(0,clsTarget);
908 expoFit.SetParameter(1,
log(clsMax.first/clsMin.first)/(rMax-rMin));
909 expoFit.SetParameter(2,limit);
910 double rMinBound, rMaxBound; expoFit.GetRange(rMinBound, rMaxBound);
918 for (
int j = 0; j <
fLimitPlot->GetN(); ++j) {
921 for (
int i = 0, imax = 8; i <= imax; ++i, ++npoints) {
925 oocoutI((
TObject*)0,
Eval) <<
"Fit to " << npoints <<
" points: " << expoFit.GetParameter(2) <<
" +/- " << expoFit.GetParError(2) << std::endl;
927 if ((rMin < expoFit.GetParameter(2)) && (expoFit.GetParameter(2) < rMax) && (expoFit.GetParError(2) < 0.5*(rMaxBound-rMinBound))) {
929 limit = expoFit.GetParameter(2);
930 limitErr = expoFit.GetParError(2);
931 if (limitErr <
std::max(absAccuracy, relAccuracy * limit))
break;
936 if (!
RunOnePoint(rTry,
true,clsTarget) )
return false;
949 for (
int j = 0; j <
fLimitPlot->GetN(); ++j) {
955 fLimitPlot->GetYaxis()->SetRangeUser(0.5*clsTarget, 1.5*clsTarget);
957 expoFit.Draw(
"SAME");
961 line.SetLineWidth(1);
line.SetLineStyle(2);
962 line.DrawLine(limit-limitErr, 0, limit-limitErr,
fLimitPlot->GetY()[0]);
963 line.DrawLine(limit+limitErr, 0, limit+limitErr,
fLimitPlot->GetY()[0]);
968 <<
"\tLimit: " << r->
GetName() <<
" < " << limit <<
" +/- " << limitErr <<
" @ " << (1-
fSize) * 100 <<
"% CL\n";
998 TList * clsbDist = 0;
1022 TList * clsDist = 0;
1023 TList * clsbDist = 0;
1047 if (!bModel || ! sbModel)
return 0;
1055 <<
" assume is for POI = 0" << std::endl;
1060 paramPoint = *poibkg;
1064 if (!toymcSampler) {
1069 if (dynamic_cast<RooStats::AsymptoticCalculator*>(
fCalculator0) ) {
1083 bool storePValues = clsDist || clsbDist || clbDist;
1084 if (
fNBins <=0 && storePValues) {
1085 oocoutW((
TObject*)0,
InputArguments) <<
"HypoTestInverter::RebuildDistribution - cannot return p values distribution with the auto scan" << std::endl;
1086 storePValues =
false;
1099 if (nToys <= 0) nToys = 100;
1101 std::vector<std::vector<double> > CLs_values(nPoints);
1102 std::vector<std::vector<double> > CLsb_values(nPoints);
1103 std::vector<std::vector<double> > CLb_values(nPoints);
1106 for (
int i = 0; i < nPoints; ++i) {
1107 CLs_values[i].reserve(nToys);
1108 CLb_values[i].reserve(nToys);
1109 CLsb_values[i].reserve(nToys);
1113 std::vector<double> limit_values; limit_values.reserve(nToys);
1116 << nToys << std::endl;
1132 TFile * fileOut =
TFile::Open(outputfile,
"RECREATE");
1135 <<
" - the resulting limits will not be stored" << std::endl;
1138 TH1D * hL =
new TH1D(
"lowerLimitDist",
"Rebuilt lower limit distribution",100,1.,0.);
1139 TH1D * hU =
new TH1D(
"upperLimitDist",
"Rebuilt upper limit distribution",100,1.,0.);
1140 TH1D * hN =
new TH1D(
"nObs",
"Observed events",100,1.,0.);
1143 std::vector<TH1*> hCLb;
1144 std::vector<TH1*> hCLsb;
1145 std::vector<TH1*> hCLs;
1147 for (
int i = 0; i < nPoints; ++i) {
1148 hCLb.push_back(
new TH1D(
TString::Format(
"CLbDist_bin%d",i),
"CLb distribution",100,1.,0.));
1149 hCLs.push_back(
new TH1D(
TString::Format(
"ClsDist_bin%d",i),
"CLs distribution",100,1.,0.));
1150 hCLsb.push_back(
new TH1D(
TString::Format(
"CLsbDist_bin%d",i),
"CLs+b distribution",100,1.,0.));
1156 for (
int itoy = 0; itoy <
nToys; ++itoy) {
1158 oocoutP((
TObject*)0,
Eval) <<
"\nHypoTestInverter - RebuildDistributions - running toy # " << itoy <<
" / "
1159 << nToys << std::endl;
1162 printf(
"\n\nshnapshot of s+b model \n");
1166 if (itoy> 0) *allParams = saveParams;
1182 for (
int i = 0; i < genObs.getSize(); ++i) {
1184 if (x) nObs += x->
getVal();
1199 if (r == 0)
continue;
1202 limit_values.push_back( value );
1207 std::cout <<
"The computed upper limit for toy #" << itoy <<
" is " << value << std::endl;
1210 if (itoy%10 == 0 || itoy == nToys-1) {
1216 if (!storePValues)
continue;
1226 for (
int ipoint = 0; ipoint < nPoints; ++ipoint) {
1229 CLs_values[ipoint].push_back( hr->
CLs() );
1230 CLsb_values[ipoint].push_back( hr->
CLsplusb() );
1231 CLb_values[ipoint].push_back( hr->
CLb() );
1232 hCLs[ipoint]->Fill( hr->
CLs() );
1233 hCLb[ipoint]->Fill( hr->
CLb() );
1234 hCLsb[ipoint]->Fill( hr->
CLsplusb() );
1242 if (itoy%10 == 0 || itoy == nToys-1) {
1243 for (
int ipoint = 0; ipoint < nPoints; ++ipoint) {
1257 if (clsDist) clsDist->
SetOwner(
true);
1258 if (clbDist) clbDist->
SetOwner(
true);
1259 if (clsbDist) clsbDist->
SetOwner(
true);
1263 for (
int ipoint = 0; ipoint < nPoints; ++ipoint) {
1286 for (
int i = 0; i < nPoints && storePValues; ++i) {
1293 const char * disName = (isUpper) ?
"upperLimit_dist" :
"lowerLimit_dist";
virtual Double_t sumEntries() const =0
virtual ~HypoTestInverter()
virtual HypoTestInverterResult * GetInterval() const
Main interface to get a ConfInterval, pure virtual.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
void SetBackgroundAsAlt(Bool_t l=kTRUE)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
RooAbsPdf * GetPdf() const
get model PDF (return NULL if pdf has not been specified or does not exist)
static double fgRelAccuracy
Double_t CLbError() const
The error on the "confidence level" of the null hypothesis.
Small helper to implement the function to create,access and destroy iterators.
HypoTestInverter class for performing an hypothesis test inversion by scanning the hypothesis test re...
IntervalCalculator is an interface class for a tools which produce RooStats ConfIntervals.
virtual void SetParametersForTestStat(const RooArgSet &nullpoi)
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
virtual TestStatistic * GetTestStatistic() const =0
virtual void SetGlobalObservables(const RooArgSet &o)
int ArraySize() const
number of entries in the results array
virtual Double_t CLs() const
CLs is simply CLs+b/CLb (not a method, but a quantity)
const RooArgSet * GetGlobalObservables() const
get RooArgSet for global observables (return NULL if not existing)
bool RunOnePoint(double thisX, bool adaptive=false, double clTarget=-1) const
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
std::unique_ptr< TGraphErrors > fLimitPlot
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
virtual void SetName(const char *name)
Change (i.e.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
TestStatistic * GetTestStatistic() const
HypoTestResult is a base class for results from hypothesis tests.
SamplingDistribution * GetUpperLimitDistribution(bool rebuild=false, int nToys=100)
virtual void SetNEventsPerToy(const Int_t nevents)
virtual RooAbsData * GenerateToyData(RooArgSet ¶mPoint, RooAbsPdf &pdf) const
virtual Double_t getMin(const char *name=0) const
static void CheckInputModels(const HypoTestCalculatorGeneric &hc, const RooRealVar &scanVar)
bool RunFixedScan(int nBins, double xMin, double xMax, bool scanLog=false) const
SamplingDistribution * GetAltDistribution(void) const
SamplingDistribution * GetUpperLimitDistribution() const
get expected upper limit distributions implemented using interpolation
Int_t GetSize() const
size of samples
virtual Double_t CLsplusb() const
Convert AlternatePValue into a "confidence level".
const RooArgSet * GetNuisanceParameters() const
get RooArgSet containing the nuisance parameters (return NULL if not existing)
HypoTestInverterResult * fResults
void setMax(const char *name, Double_t value)
Set maximum of name range to given value.
virtual void SetBuffer(Int_t buffersize, Option_t *option="")
set the maximum number of entries to be kept in the buffer
HypoTestInverter & operator=(const HypoTestInverter &rhs)
virtual void SetTestStatistic(TestStatistic *testStatistic)=0
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
RooAbsArg * first() const
void plot(TString fname="data.root", TString var0="var0", TString var1="var1")
Common base class for the Hypothesis Test Calculators.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual HypoTestResult * GetHypoTest() const
inherited methods from HypoTestCalculator interface
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
TestStatSampler * GetTestStatSampler(void) const
ECalculatorType fCalcType
static Vc_ALWAYS_INLINE Vector< T > abs(const Vector< T > &x)
void UseCLs(bool on=true)
flag to switch between using CLsb (default) or CLs as confidence level
Double_t getVal(const RooArgSet *set=0) const
virtual Double_t NullPValue() const
Return p-value for null hypothesis.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Double_t LowerLimit()
lower and upper bound of the confidence interval (to get upper/lower limits, multiply the size( = 1-c...
virtual void SetData(RooAbsData &data)
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
HypoTestResult * GetResult(int index) const
return a pointer to the i^th result object
RooRealVar represents a fundamental (non-derived) real valued object.
virtual const RooArgSet * get() const
const ModelConfig * GetAlternateModel(void) const
Bool_t AreEqualAbs(Double_t af, Double_t bf, Double_t epsilon)
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
virtual void setVal(Double_t value)
Set value of variable to 'value'.
HypoTestResult * Eval(HypoTestCalculatorGeneric &hc, bool adaptive, double clsTarget) const
virtual Double_t CLb() const
Convert NullPValue into a "confidence level".
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
const ModelConfig * GetNullModel(void) const
TGraphErrors * MakePlot(Option_t *opt="")
return a TGraphErrors with the obtained observed p-values resultinf from the scan By default (Option ...
RooAbsArg * find(const char *name) const
Find object with given name in list.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
void setMin(const char *name, Double_t value)
Set minimum of name range to given value.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
int fTotalToysRun
plot of limits
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual Int_t numEntries() const
void PrintListContent(const RooArgList &l, std::ostream &os=std::cout)
TList fExpPValues
list of HypoTestResult for each point
RooRealVar * fScannedVariable
pointer to the generic hypotest calculator used
HypoTestCalculatorGeneric * fCalculator0
virtual const char * GetName() const
Returns name of object.
RooAbsData is the common abstract base class for binned and unbinned datasets.
double GetLastYValue() const
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
ToyMCSampler is an implementation of the TestStatSampler interface.
1-D histogram with a double per channel (see TH1 documentation)}
Bool_t GetPValueIsRightTail(void) const
void SetTestStatisticData(const Double_t tsd)
This class simply holds a sampling distribution of some test statistic.
double GetLastYError() const
virtual void Append(const HypoTestResult *other)
add values from another HypoTestResult
This class implements the Hypothesis test calculation using an hybrid (frequentist/bayesian) procedur...
ClassImp(RooStats::HypoTestInverter) using namespace RooStats
const RooArgSet * GetObservables() const
get RooArgSet for observables (return NULL if not existing)
double GetXValue(int index) const
function to return the value of the parameter of interest for the i^th entry in the results ...
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
HypoTestInverterResult class: holds the array of hypothesis test results and compute a confidence int...
void CreateResults() const
virtual void SetObservables(const RooArgSet &o)
Class to plot an HypoTestInverterResult, result of the HypoTestInverter calculator.
Bool_t canBeExtended() const
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
SamplingDistribution * GetNullDistribution(void) const
const RooArgSet * GetSnapshot() const
get RooArgSet for parameters for a particular hypothesis (return NULL if not existing) ...
virtual void SetPdf(RooAbsPdf &pdf)
bool SetTestStatistic(TestStatistic &stat)
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual Double_t AlternatePValue() const
Return p-value for alternate hypothesis.
Mother of all ROOT objects.
virtual Double_t getMax(const char *name=0) const
static double fgAbsAccuracy
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual void Add(TObject *obj)
double fLowerLimitError
interpolatation option (linear or spline)
std::unique_ptr< HypoTestCalculatorGeneric > fHC
Hypothesis Test Calculator using a full frequentist procedure for sampling the test statistic distrib...
static std::string fgAlgo
SamplingDistribution * GetLowerLimitDistribution() const
get expected lower limit distributions implemented using interpolation The size for the sampling dist...
Double_t CLsplusbError() const
The error on the "confidence level" of the alternative hypothesis.
static RooRealVar * GetVariableToScan(const HypoTestCalculatorGeneric &hc)
bool RunLimit(double &limit, double &limitErr, double absTol=0, double relTol=0, const double *hint=0) const
Double_t GetTestStatisticData(void) const
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
Py_ssize_t ArraySize(const std::string &name)
Extract size from an array type, if available.
SamplingDistribution * RebuildDistributions(bool isUpper=true, int nToys=100, TList *clsDist=0, TList *clsbDist=0, TList *clbDist=0, const char *outputfile="HypoTestInverterRebuiltDist.root")
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
virtual void SetNuisanceParameters(const RooArgSet &np)
virtual void SetData(RooAbsData &)
Set the DataSet ( add to the the workspace if not already there ?)
static void CloseProof(Option_t *option="s")
close all proof connections
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
SamplingDistribution * GetLowerLimitDistribution(bool rebuild=false, int nToys=100)
Hypothesis Test Calculator based on the asymptotic formulae for the profile likelihood ratio...
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
Double_t CLsError() const
The error on the ratio CLs+b/CLb.
void setError(Double_t value)
std::vector< double > fXValues
max sigma value used to scan asymptotic expected p values