Skip to content
Snippets Groups Projects
Commit a7008bec authored by Lorenzo Moneta's avatar Lorenzo Moneta
Browse files

fix the Print() method in case of results without toys (asymptotic). Move also Print() in .cxx file

git-svn-id: http://root.cern.ch/svn/root/trunk@42492 27541ba8-7e3a-0410-8455-c3a389f83636
parent a2ca7d13
No related branches found
No related tags found
No related merge requests found
...@@ -129,31 +129,7 @@ namespace RooStats { ...@@ -129,31 +129,7 @@ namespace RooStats {
Double_t NullPValueError() const; Double_t NullPValueError() const;
void Print(const Option_t* = "") const { void Print(const Option_t* = "") const;
// Print out some information about the results
// Note: use Alt/Null labels for the hypotheses here as the Null
// might be the s+b hypothesis.
cout << endl << "Results " << GetName() << ": " << endl;
if(HasTestStatisticData() && fNullDistr) {
cout << " - Null p-value = " << NullPValue() << " +/- " << NullPValueError() << endl;
cout << " - Significance = " << Significance() << " sigma" << endl;
}
if(fAltDistr)
cout << " - Number of Alt toys: " << fAltDistr->GetSize() << std::endl;
if(fNullDistr)
cout << " - Number of Null toys: " << fNullDistr->GetSize() << std::endl;
if(HasTestStatisticData())
cout << " - Test statistic evaluated on data: " << fTestStatisticData << std::endl;
if(HasTestStatisticData() && fNullDistr)
cout << " - CL_b: " << CLb() << " +/- " << CLbError() << std::endl;
if(HasTestStatisticData() && fAltDistr)
cout << " - CL_s+b: " << CLsplusb() << " +/- " << CLsplusbError() << std::endl;
if(HasTestStatisticData() && fAltDistr && fNullDistr)
cout << " - CL_s: " << CLs() << " +/- " << CLsError() << std::endl;
return;
}
private: private:
void UpdatePValue(const SamplingDistribution* distr, Double_t &pvalue, Double_t &perror, Bool_t pIsRightTail); void UpdatePValue(const SamplingDistribution* distr, Double_t &pvalue, Double_t &perror, Bool_t pIsRightTail);
......
...@@ -207,3 +207,35 @@ void HypoTestResult::UpdatePValue(const SamplingDistribution* distr, Double_t &p ...@@ -207,3 +207,35 @@ void HypoTestResult::UpdatePValue(const SamplingDistribution* distr, Double_t &p
} }
} }
void HypoTestResult::Print(Option_t * ) const
{
// Print out some information about the results
// Note: use Alt/Null labels for the hypotheses here as the Null
// might be the s+b hypothesis.
bool fromToys = (fAltDistr || fNullDistr);
cout << endl << "Results " << GetName() << ": " << endl;
cout << " - Null p-value = " << NullPValue();
if (fromToys) cout << " +/- " << NullPValueError();
cout << endl;
cout << " - Significance = " << Significance() << " sigma" << endl;
if(fAltDistr)
cout << " - Number of Alt toys: " << fAltDistr->GetSize() << std::endl;
if(fNullDistr)
cout << " - Number of Null toys: " << fNullDistr->GetSize() << std::endl;
if (HasTestStatisticData() ) cout << " - Test statistic evaluated on data: " << fTestStatisticData << std::endl;
cout << " - CL_b: " << CLb();
if (fromToys) cout << " +/- " << CLbError();
cout << std::endl;
cout << " - CL_s+b: " << CLsplusb();
if (fromToys) cout << " +/- " << CLsplusbError();
cout << std::endl;
cout << " - CL_s: " << CLs();
if (fromToys) cout << " +/- " << CLsError();
cout << std::endl;
return;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment