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

use noRounding for the Poisson of the sidebands since the noff value can be in...

use noRounding for the Poisson of the sidebands since the noff value can be in some cause non-integer (i.e. be interpreted as a Gamma constraint)


git-svn-id: http://root.cern.ch/svn/root/trunk@43932 27541ba8-7e3a-0410-8455-c3a389f83636
parent c02a3e9b
Branches
Tags
No related merge requests found
...@@ -133,8 +133,10 @@ void NumberCountingPdfFactory::AddModel(Double_t* sig, ...@@ -133,8 +133,10 @@ void NumberCountingPdfFactory::AddModel(Double_t* sig,
RooPoisson* sigRegion = RooPoisson* sigRegion =
new RooPoisson(("sigRegion"+str.str()).c_str(),("sigRegion"+str.str()).c_str(), *x,*splusb); new RooPoisson(("sigRegion"+str.str()).c_str(),("sigRegion"+str.str()).c_str(), *x,*splusb);
//LM: need to set noRounding since y can take non integer values
RooPoisson* sideband = RooPoisson* sideband =
new RooPoisson(("sideband"+str.str()).c_str(),("sideband"+str.str()).c_str(), *y,*bTau); new RooPoisson(("sideband"+str.str()).c_str(),("sideband"+str.str()).c_str(), *y,*bTau,true);
likelihoodFactors.Add(sigRegion); likelihoodFactors.Add(sigRegion);
likelihoodFactors.Add(sideband); likelihoodFactors.Add(sideband);
...@@ -245,7 +247,11 @@ void NumberCountingPdfFactory::AddData(Double_t* mainMeas, ...@@ -245,7 +247,11 @@ void NumberCountingPdfFactory::AddData(Double_t* mainMeas,
std::stringstream str; std::stringstream str;
str<<"_"<<i; str<<"_"<<i;
Double_t _tau = 1./back[i]/back_syst[i]/back_syst[i]; //Double_t _tau = 1./back[i]/back_syst[i]/back_syst[i];
// LM: compute tau correctly for the Gamma distribution : mode = tau*b and variance is (tau*b+1)
Double_t err = back_syst[i];
Double_t _tau = (1.0 + sqrt(1 + 4 * err * err))/ (2. * err * err)/ back[i];
RooRealVar* tau = SafeObservableCreation(ws, ("tau"+str.str()).c_str(), _tau ); RooRealVar* tau = SafeObservableCreation(ws, ("tau"+str.str()).c_str(), _tau );
oocoutW(ws,ObjectHandling) << "NumberCountingPdfFactory: changed value of " << tau->GetName() << " to " << tau->getVal() << oocoutW(ws,ObjectHandling) << "NumberCountingPdfFactory: changed value of " << tau->GetName() << " to " << tau->getVal() <<
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment