Standard Deviation in y-axis for TH1

Hi,

I want to calculate the standard deviation for the y-axis rather than the x-axis, is there a way besides Hist.Stats.RMSY to do so?

https://root.cern.ch/root/htmldoc/guides/users-guide/Histograms.html and search for RMS :wink:

but, when I called the RMS on the histogram, I still get the deviation from X-axis, I am trying to calculate it, for the values in the y-axis.

I want to calculate how much the data changes, instead of the spread of the data

Sorry, but I don’t understand what you’re asking for (you can’t get the RMS on the y axis of a 1D histogram), maybe @moneta can help you more than me.

// assuming "h" is a pointer to your 1-dimensional histogram
std::cout << "h X : " << h->GetMean(1) << " : " << h->GetRMS(1) << std::endl;
TGraphErrors *g = new TGraphErrors(h);
// warning: note that g->Get*(1) != h->Get*(1)
std::cout << "g X : " << g->GetMean(1) << " : " << g->GetRMS(1) << std::endl;
std::cout << "g Y : " << g->GetMean(2) << " : " << g->GetRMS(2) << std::endl;
delete g; // no longer needed
2 Likes

@IP25 would you mind if we keep your question, moving it to the ROOT category? Else I will hide this, as agreed for the Newbie section; let me know.

you can move it! Thank you! @Axel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.