66#define NaN numeric_limits<float>::quiet_NaN()
67#define IsNaN(a) TMath::IsNaN(a)
77HypoTestResult::HypoTestResult(
const char*
name) :
79 fNullPValue(
NaN), fAlternatePValue(
NaN),
80 fNullPValueError(0), fAlternatePValueError(0),
81 fTestStatisticData(
NaN),
82 fAllTestStatisticsData(NULL),
83 fNullDistr(NULL), fAltDistr(NULL),
84 fNullDetailedOutput(NULL), fAltDetailedOutput(NULL), fFitInfo(NULL),
85 fPValueIsRightTail(
kTRUE),
95 fNullPValue(nullp), fAlternatePValue(altp),
96 fNullPValueError(0), fAlternatePValueError(0),
97 fTestStatisticData(
NaN),
98 fAllTestStatisticsData(NULL),
99 fNullDistr(NULL), fAltDistr(NULL),
100 fNullDetailedOutput(NULL), fAltDetailedOutput(NULL), fFitInfo(NULL),
101 fPValueIsRightTail(
kTRUE),
111 fNullPValue(
NaN), fAlternatePValue(
NaN),
112 fNullPValueError(0), fAlternatePValueError(0),
113 fTestStatisticData(
NaN),
114 fAllTestStatisticsData(NULL),
115 fNullDistr(NULL), fAltDistr(NULL),
116 fNullDetailedOutput(NULL), fAltDetailedOutput(NULL), fFitInfo(NULL),
117 fPValueIsRightTail( other.GetPValueIsRightTail() ),
118 fBackgroundIsAlt( other.GetBackGroundIsAlt() )
141 if (
this == &other)
return *
this;
305 if (
CLb() == 0 )
return -1;
343 std::cout << std::endl <<
"Results " <<
GetName() <<
": " << endl;
344 std::cout <<
" - Null p-value = " <<
NullPValue();
346 std::cout << std::endl;
349 std::cout << std::endl;
351 std::cout <<
" - Number of Alt toys: " <<
fAltDistr->
GetSize() << std::endl;
356 std::cout <<
" - CL_b: " <<
CLb();
357 if (fromToys) std::cout <<
" +/- " <<
CLbError();
358 std::cout << std::endl;
359 std::cout <<
" - CL_s+b: " <<
CLsplusb();
361 std::cout << std::endl;
362 std::cout <<
" - CL_s: " <<
CLs();
363 if (fromToys) std::cout <<
" +/- " <<
CLsError();
364 std::cout << std::endl;
double pow(double, double)
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooDataSet is a container class to hold unbinned data.
void append(RooDataSet &data)
Add all data points of given data set to this data set.
static Double_t infinity()
Return internal infinity representation.
RooRealVar represents a fundamental (non-derived) real valued object.
HypoTestResult is a base class for results from hypothesis tests.
RooDataSet * GetFitInfo(void) const
RooDataSet * fAltDetailedOutput
HypoTestResult & operator=(const HypoTestResult &other)
assignment operator
Double_t fTestStatisticData
Double_t fNullPValueError
virtual ~HypoTestResult()
destructor
HypoTestResult(const char *name=0)
default constructor
Double_t CLbError() const
The error on the "confidence level" of the null hypothesis.
void SetAllTestStatisticsData(const RooArgList *tsd)
Double_t NullPValueError() const
The error on the Null p-value.
Bool_t GetPValueIsRightTail(void) const
Double_t GetTestStatisticData(void) const
virtual void Append(const HypoTestResult *other)
add values from another HypoTestResult
virtual Double_t CLb() const
Convert NullPValue into a "confidence level".
virtual Double_t CLsplusb() const
Convert AlternatePValue into a "confidence level".
virtual Double_t Significance() const
familiar name for the Null p-value in terms of 1-sided Gaussian significance
RooDataSet * GetNullDetailedOutput(void) const
void SetPValueIsRightTail(Bool_t pr)
RooDataSet * fNullDetailedOutput
SamplingDistribution * fAltDistr
virtual Double_t NullPValue() const
Return p-value for null hypothesis.
void SetTestStatisticData(const Double_t tsd)
void SetNullDistribution(SamplingDistribution *null)
Double_t CLsplusbError() const
The error on the "confidence level" of the alternative hypothesis.
virtual Double_t CLs() const
is simply (not a method, but a quantity)
Bool_t GetBackGroundIsAlt(void) const
void SetAltDistribution(SamplingDistribution *alt)
Bool_t fPValueIsRightTail
RooDataSet * GetAltDetailedOutput(void) const
const RooArgList * fAllTestStatisticsData
void UpdatePValue(const SamplingDistribution *distr, Double_t &pvalue, Double_t &perror, Bool_t pIsRightTail)
updates the pvalue if sufficient data is available
SamplingDistribution * GetNullDistribution(void) const
Bool_t HasTestStatisticData(void) const
Double_t SignificanceError() const
The error on the significance, computed from NullPValueError via error propagation.
Double_t fAlternatePValue
Double_t fAlternatePValueError
Double_t CLsError() const
The error on the ratio .
void Print(const Option_t *="") const
Print out some information about the results Note: use Alt/Null labels for the hypotheses here as the...
SamplingDistribution * fNullDistr
SamplingDistribution * GetAltDistribution(void) const
This class simply holds a sampling distribution of some test statistic.
Int_t GetSize() const
size of samples
Double_t IntegralAndError(Double_t &error, Double_t low, Double_t high, Bool_t normalize=kTRUE, Bool_t lowClosed=kTRUE, Bool_t highClosed=kFALSE) const
numerical integral in these limits including error estimation
void Add(const SamplingDistribution *other)
merge two sampling distributions
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
double normal_pdf(double x, double sigma=1, double x0=0)
Probability density function of the normal (Gaussian) distribution.
Namespace for the RooStats classes.
Double_t Sqrt(Double_t x)