moneta
July 28, 2017, 8:21am
8
Hi,
In RooFit to plot Poisson (which is the default if you have unweighted data) you need to use the plot option DataError(RooAbsData::Poisson). Your plot looks to me done with the option DataError(RooAbsData::SumW2).
Probably you have weighted data.
For your second question you can use the code below:
double alpha = 1. - confLevel;
double lower = ROOT::Math::gamma_quantile( alpha/2, n, 1.);
double upper = ROOT::Math::gamma_quantile_c( alpha/2, n+1, 1)
See also the code in TH1.cxx,
////////////////////////////////////////////////////////////////////////////////
/// Change the name of this histogram
///
void TH1::SetName(const char *name)
{
// Histograms are named objects in a THashList.
// We must update the hashlist if we change the name
// We protect this operation
R__LOCKGUARD(gROOTMutex);
if (fDirectory) fDirectory->Remove(this);
fName = name;
if (fDirectory) fDirectory->Append(this);
}
////////////////////////////////////////////////////////////////////////////////
/// Change the name and title of this histogram
void TH1::SetNameTitle(const char *name, const char *title)
{
and
/// By default, the statistics box is drawn.
/// The paint options can be selected via gStyle->SetOptStats.
/// This function sets/resets the kNoStats bin in the histogram object.
/// It has priority over the Style option.
void TH1::SetStats(Bool_t stats)
{
ResetBit(kNoStats);
if (!stats) {
SetBit(kNoStats);
//remove the "stats" object from the list of functions
if (fFunctions) {
TObject *obj = fFunctions->FindObject("stats");
if (obj) {
fFunctions->Remove(obj);
delete obj;
}
}
}
}
Lorenzo