Hi Lorenzo,
Thank you very much for prompt reply and help.
I was trying to follow this post:
[url]RooDataHist: Setting my own error bars
But, did not have luck…
Nevertheless, I will post add-hoc solution I found and maybe it will be useful for other users.
- Add following lines in $ROOTDIRECTORY/roofit/roofitcore/src/RooHist.cxx
Line 405.
ym = (n==0) ? 0 : (ROOT::Math::gamma_quantile((1 - 0.6827)/2,n,1.));
yp = ROOT::Math::gamma_quantile_c((1 - 0.6827)/2,n+1,1) ;
just after…
if(!RooHistError::instance().getPoissonInterval(Int_t(n),ym,yp,_nSigma)) {
coutE(Plotting) << "RooHist::addBin: unable to add bin with " << n << " events" << endl;
return;}
- Also added necessary headers into same file to be safe.
#include "TROOT.h"
#include "Math/QuantFuncMathCore.h"
Then, compile and run. It should give you “correct” errors for zero entries (1.8 instead of 1.2). Call your dataSet with either Poisson or Idle. it worked for me same as my data is unweighted…
dataSet.plotOn(framex,Name(“dataX”));
or
dataSet.plotOn(framex,Name(“dataX”),DataError(RooAbsData::Poisson));
Hope this will be helpful to somebody.
Maksat