25 #ifndef RooStats_RooStatsUtils
30 #define NaN numeric_limits<float>::quiet_NaN()
31 #define IsNaN(a) TMath::IsNaN(a)
44 fNullPValue(
NaN), fAlternatePValue(
NaN),
45 fNullPValueError(0), fAlternatePValueError(0),
46 fTestStatisticData(
NaN),
47 fAllTestStatisticsData(
NULL),
49 fNullDetailedOutput(
NULL), fAltDetailedOutput(
NULL), fFitInfo(
NULL),
50 fPValueIsRightTail(
kTRUE),
61 fNullPValue(nullp), fAlternatePValue(altp),
62 fNullPValueError(0), fAlternatePValueError(0),
63 fTestStatisticData(
NaN),
64 fAllTestStatisticsData(
NULL),
66 fNullDetailedOutput(
NULL), fAltDetailedOutput(
NULL), fFitInfo(
NULL),
67 fPValueIsRightTail(
kTRUE),
77 fNullPValue(
NaN), fAlternatePValue(
NaN),
78 fNullPValueError(0), fAlternatePValueError(0),
79 fTestStatisticData(
NaN),
80 fAllTestStatisticsData(
NULL),
82 fNullDetailedOutput(
NULL), fAltDetailedOutput(
NULL), fFitInfo(
NULL),
83 fPValueIsRightTail( other.GetPValueIsRightTail() ),
84 fBackgroundIsAlt( other.GetBackGroundIsAlt() )
108 if (
this == &other)
return *
this;
268 if (
CLb() == 0 )
return -1;
308 std::cout << std::endl <<
"Results " <<
GetName() <<
": " << endl;
309 std::cout <<
" - Null p-value = " <<
NullPValue();
311 std::cout << std::endl;
314 std::cout << std::endl;
316 std::cout <<
" - Number of Alt toys: " <<
fAltDistr->
GetSize() << std::endl;
321 std::cout <<
" - CL_b: " <<
CLb();
322 if (fromToys) std::cout <<
" +/- " <<
CLbError();
323 std::cout << std::endl;
324 std::cout <<
" - CL_s+b: " <<
CLsplusb();
326 std::cout << std::endl;
327 std::cout <<
" - CL_s: " <<
CLs();
328 if (fromToys) std::cout <<
" +/- " <<
CLsError();
329 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 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.
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
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)
Namespace for the RooStats classes.
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