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

fix initialization of fInterval data member

this fises crash in rs701 tutorial


git-svn-id: http://root.cern.ch/svn/root/trunk@30756 27541ba8-7e3a-0410-8455-c3a389f83636
parent 386cace0
No related branches found
No related tags found
Loading
...@@ -40,6 +40,7 @@ BayesianCalculator::BayesianCalculator() : ...@@ -40,6 +40,7 @@ BayesianCalculator::BayesianCalculator() :
fPdf(0), fPdf(0),
fPriorPOI(0), fPriorPOI(0),
fProductPdf (0), fLogLike(0), fLikelihood (0), fIntegratedLikelihood (0), fPosteriorPdf(0), fProductPdf (0), fLogLike(0), fLikelihood (0), fIntegratedLikelihood (0), fPosteriorPdf(0),
fInterval(0),
fSize(0.05) fSize(0.05)
{ {
// default constructor // default constructor
...@@ -57,6 +58,7 @@ BayesianCalculator::BayesianCalculator( /* const char* name, const char* title, ...@@ -57,6 +58,7 @@ BayesianCalculator::BayesianCalculator( /* const char* name, const char* title,
fPOI(POI), fPOI(POI),
fPriorPOI(&priorPOI), fPriorPOI(&priorPOI),
fProductPdf (0), fLogLike(0), fLikelihood (0), fIntegratedLikelihood (0), fPosteriorPdf(0), fProductPdf (0), fLogLike(0), fLikelihood (0), fIntegratedLikelihood (0), fPosteriorPdf(0),
fInterval(0),
fSize(0.05) fSize(0.05)
{ {
// constructor // constructor
...@@ -69,6 +71,7 @@ BayesianCalculator::BayesianCalculator( RooAbsData& data, ...@@ -69,6 +71,7 @@ BayesianCalculator::BayesianCalculator( RooAbsData& data,
fPdf(model.GetPdf()), fPdf(model.GetPdf()),
fPriorPOI( model.GetPriorPdf()), fPriorPOI( model.GetPriorPdf()),
fProductPdf (0), fLogLike(0), fLikelihood (0), fIntegratedLikelihood (0), fPosteriorPdf(0), fProductPdf (0), fLogLike(0), fLikelihood (0), fIntegratedLikelihood (0), fPosteriorPdf(0),
fInterval(0),
fSize(0.05) fSize(0.05)
{ {
// constructor from Model Config // constructor from Model Config
......
...@@ -24,10 +24,10 @@ using namespace RooStats; ...@@ -24,10 +24,10 @@ using namespace RooStats;
void rs701_BayesianCalculator() void rs701_BayesianCalculator()
{ {
/*
RooWorkspace* w = new RooWorkspace("w",true); RooWorkspace* w = new RooWorkspace("w",true);
w->factory("SUM::pdf(s[0,15]*Uniform(x[0,1]),b[0.001,0,2]*Uniform(x))"); w->factory("SUM::pdf(s[0,15]*Uniform(x[0,1]),b[1,0,2]*Uniform(x))");
w->factory("Gaussian::prior_b(b,0.001,1)"); w->factory("Gaussian::prior_b(b,1,1)");
w->factory("PROD::model(pdf,prior_b)"); w->factory("PROD::model(pdf,prior_b)");
RooAbsPdf* model = w->pdf("model"); // pdf*priorNuisance RooAbsPdf* model = w->pdf("model"); // pdf*priorNuisance
const RooArgSet nuisanceParameters(*(w->var("b"))); const RooArgSet nuisanceParameters(*(w->var("b")));
...@@ -46,7 +46,7 @@ void rs701_BayesianCalculator() ...@@ -46,7 +46,7 @@ void rs701_BayesianCalculator()
std::cout << "90% CL interval: [ " << interval->LowerLimit() << " - " << interval->UpperLimit() << " ] or 95% CL limits\n"; std::cout << "90% CL interval: [ " << interval->LowerLimit() << " - " << interval->UpperLimit() << " ] or 95% CL limits\n";
RooPlot * plot = bcalc.GetPosteriorPlot(); RooPlot * plot = bcalc.GetPosteriorPlot();
plot->Draw(); plot->Draw();
*/
// observe one event while expecting one background event -> the 95% CL upper limit on s is 4.10 // observe one event while expecting one background event -> the 95% CL upper limit on s is 4.10
// observe one event while expecting zero background event -> the 95% CL upper limit on s is 4.74 // observe one event while expecting zero background event -> the 95% CL upper limit on s is 4.74
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment