26 #ifndef RooStats_RooStatsUtils
31 #define NaN numeric_limits<float>::quiet_NaN()
32 #define IsNaN(a) TMath::IsNaN(a)
36 using namespace RooStats;
45 fNullPValue(
NaN), fAlternatePValue(
NaN),
46 fNullPValueError(0), fAlternatePValueError(0),
47 fTestStatisticData(
NaN),
48 fAllTestStatisticsData(
NULL),
50 fNullDetailedOutput(
NULL), fAltDetailedOutput(
NULL), fFitInfo(
NULL),
51 fPValueIsRightTail(
kTRUE),
62 fNullPValue(nullp), fAlternatePValue(altp),
63 fNullPValueError(0), fAlternatePValueError(0),
64 fTestStatisticData(
NaN),
65 fAllTestStatisticsData(
NULL),
67 fNullDetailedOutput(
NULL), fAltDetailedOutput(
NULL), fFitInfo(
NULL),
68 fPValueIsRightTail(
kTRUE),
78 fNullPValue(
NaN), fAlternatePValue(
NaN),
79 fNullPValueError(0), fAlternatePValueError(0),
80 fTestStatisticData(
NaN),
81 fAllTestStatisticsData(
NULL),
83 fNullDetailedOutput(
NULL), fAltDetailedOutput(
NULL), fFitInfo(
NULL),
84 fPValueIsRightTail( other.GetPValueIsRightTail() ),
85 fBackgroundIsAlt( other.GetBackGroundIsAlt() )
109 if (
this == &other)
return *
this;
269 if (
CLb() == 0 )
return -1;
309 std::cout << std::endl <<
"Results " <<
GetName() <<
": " << endl;
310 std::cout <<
" - Null p-value = " <<
NullPValue();
312 std::cout << std::endl;
315 std::cout << std::endl;
317 std::cout <<
" - Number of Alt toys: " <<
fAltDistr->
GetSize() << std::endl;
322 std::cout <<
" - CL_b: " <<
CLb();
323 if (fromToys) std::cout <<
" +/- " <<
CLbError();
324 std::cout << std::endl;
325 std::cout <<
" - CL_s+b: " <<
CLsplusb();
327 std::cout << std::endl;
328 std::cout <<
" - CL_s: " <<
CLs();
329 if (fromToys) std::cout <<
" +/- " <<
CLsError();
330 std::cout << std::endl;
virtual const char * GetTitle() const
Returns title of object.
void SetAltDistribution(SamplingDistribution *alt)
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 CLbError() const
The error on the "confidence level" of the null hypothesis.
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
Double_t fNullPValueError
RooDataSet * GetFitInfo(void) const
const RooArgList * fAllTestStatisticsData
virtual Double_t CLs() const
CLs is simply CLs+b/CLb (not a method, but a quantity)
virtual void SetName(const char *name)
Change (i.e.
HypoTestResult is a base class for results from hypothesis tests.
HypoTestResult & operator=(const HypoTestResult &other)
assignment operator
RooDataSet * GetNullDetailedOutput(void) const
RooDataSet * fNullDetailedOutput
Double_t SignificanceError() const
The error on the significance, computed from NullPValueError via error propagation.
void UpdatePValue(const SamplingDistribution *distr, Double_t &pvalue, Double_t &perror, Bool_t pIsRightTail)
updates the pvalue if sufficient data is available
SamplingDistribution * GetAltDistribution(void) const
Int_t GetSize() const
size of samples
virtual Double_t CLsplusb() const
Convert AlternatePValue into a "confidence level".
double distr(double *x, double *p)
double normal_pdf(double x, double sigma=1, double x0=0)
Probability density function of the normal (Gaussian) distribution.
RooDataSet * GetAltDetailedOutput(void) const
The TNamed class is the base class for all named ROOT classes.
void Print(const Option_t *="") const
double pow(double, double)
Double_t fTestStatisticData
Double_t getVal(const RooArgSet *set=0) const
virtual Double_t NullPValue() const
Return p-value for null hypothesis.
RooRealVar represents a fundamental (non-derived) real valued object.
void SetAllTestStatisticsData(const RooArgList *tsd)
Double_t fAlternatePValue
virtual Double_t CLb() const
Convert NullPValue into a "confidence level".
virtual ~HypoTestResult()
destructor
Double_t NullPValueError() const
The error on the Null p-value.
SamplingDistribution * fAltDistr
Double_t fAlternatePValueError
static Double_t infinity()
Return internal infinity representation.
virtual const char * GetName() const
Returns name of object.
Bool_t fPValueIsRightTail
virtual Double_t Significance() const
familiar name for the Null p-value in terms of 1-sided Gaussian significance
void Add(const SamplingDistribution *other)
merge two sampling distributions
Bool_t HasTestStatisticData(void) const
Bool_t GetPValueIsRightTail(void) const
RooDataSet is a container class to hold unbinned data.
void SetTestStatisticData(const Double_t tsd)
This class simply holds a sampling distribution of some test statistic.
HypoTestResult(const char *name=0)
default constructor
virtual void Append(const HypoTestResult *other)
add values from another HypoTestResult
void SetPValueIsRightTail(Bool_t pr)
SamplingDistribution * fNullDistr
RooAbsArg * at(Int_t idx) const
ClassImp(RooStats::HypoTestResult)
void append(RooDataSet &data)
Add all data points of given data set to this data set.
SamplingDistribution * GetNullDistribution(void) const
RooDataSet * fAltDetailedOutput
Double_t CLsplusbError() const
The error on the "confidence level" of the alternative hypothesis.
Double_t GetTestStatisticData(void) const
Double_t Sqrt(Double_t x)
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
void SetNullDistribution(SamplingDistribution *null)
Double_t CLsError() const
The error on the ratio CLs+b/CLb.
Bool_t GetBackGroundIsAlt(void) const