25 ClassImp(RooStats::HypoTestPlot);
27 using namespace RooStats;
32 HypoTestPlot::HypoTestPlot(HypoTestResult& result, Int_t bins, Option_t* opt) :
33 SamplingDistPlot(bins),
34 fHypoTestResult(&result)
36 ApplyResult(result, opt);
38 HypoTestPlot::HypoTestPlot(HypoTestResult& result, Int_t bins, Double_t min, Double_t max, Option_t* opt) :
39 SamplingDistPlot(bins,min,max),
40 fHypoTestResult(&result)
42 ApplyResult(result, opt);
47 void HypoTestPlot::ApplyResult(HypoTestResult& result, Option_t* opt) {
48 fLegend =
new TLegend(0.55,0.95-0.3*0.66,0.95,0.95);
50 const SamplingDistribution *alt = result.GetAltDistribution();
51 const SamplingDistribution *null = result.GetNullDistribution();
52 if(!result.HasTestStatisticData()) {
53 if(alt) AddSamplingDistribution(alt, opt);
54 if(null) AddSamplingDistribution(null, opt);
56 if(result.GetPValueIsRightTail()) {
57 if(alt) AddSamplingDistributionShaded(alt, result.GetTestStatisticData(), RooNumber::infinity(), opt);
58 if(null) AddSamplingDistributionShaded(null, result.GetTestStatisticData(), RooNumber::infinity() , opt);
60 if(alt) AddSamplingDistributionShaded(alt, -RooNumber::infinity(), result.GetTestStatisticData(), opt);
61 if(null) AddSamplingDistributionShaded(null, - RooNumber::infinity(), result.GetTestStatisticData() , opt);
65 if(result.HasTestStatisticData()) {
66 Double_t theMin(0.), theMax(0.), theYMax(0.);
67 GetAbsoluteInterval(theMin, theMax, theYMax);
69 AddLine(result.GetTestStatisticData(), 0, result.GetTestStatisticData(), theYMax*0.66,
"test statistic data");
77 void HypoTestPlot::ApplyDefaultStyle(
void) {
78 if(!fHypoTestResult)
return;
80 const SamplingDistribution *alt = fHypoTestResult->GetAltDistribution();
81 const SamplingDistribution *null = fHypoTestResult->GetNullDistribution();
85 SetLineColor(kBlue, alt);
88 SetLineWidth(2, null);
89 SetLineColor(kRed, null);