{ using namespace RooFit; using namespace RooStats; RooRealVar n("n","observed yield",0.,50.); RooRealVar s("s","# of signal",1.,0.,10.); RooConstVar b("b","# of background",3.); RooAddition mean("mean","s+b",RooArgList(s,b)); RooPoisson pois("pois","Poisson PDF",n, mean); RooDataSet data("data","data",RooArgSet(n)); n.setVal(3); data.add(RooArgSet(n)); RooWorkspace *wspace = new RooWorkspace("wspace"); ModelConfig cfg(wspace); cfg.SetPdf(pois); cfg.SetParametersOfInterest(s); cfg.SetObservables(n); FeldmanCousins *fc = new FeldmanCousins(data,cfg); fc->SetConfidenceLevel(0.9); fc->UseAdaptiveSampling(true); fc->FluctuateNumDataEntries(false); fc->SetNBins(100); PointSetInterval* interval = fc->GetInterval(); printf("F&C interval: [%.2f, %.2f]\n",interval->LowerLimit(s),interval->UpperLimit(s)); }