How can I take a histogram of the values of a roohist histogram. I have:
RooHist* pull_distrubution;
pull_distrubution = fit_frame->pullHist();
which works but now I would like to take a histogram of the bincontents of “pull_distrubution”.
I have been looking for a way to do this and could not find a way to access the bin contents of a roohist. Is their a “GetBinContents” function for RooHist?
I got the same question, but couldn’t find a way to extract the values from RooHist. In the RooHist class, couldn’t find a useful function to do it either.
Hi! The object returned by fit_frame->pullHist() is a RooHist, and as such it inherits from TGraph. You should use the TGraph interface to retrieve the contents, e.g.:
double *xArr = pull_distrubution->GetX();
double *yArr = pull_distrubution->GetY();
for (int i = 0; i < pull_distrubution->GetN(); ++i) {
std::cout << xArr[i] << ", " << yArr[i] << std::endl;
}