Spuriours errors from TProfile

Here’s another one:

I’m working with a data set that has y-values in the interval [0, 0.4] and would like to set the errors in y explicitly to 0.05y (or some other meaningful scaling).

Unfortunately none of the following have worked:

TProfile *prof = h2->ProfileX(“profile”, -1, -1, “s”),
TProfile *prof = h2->ProfileX(“profile”, -1, -1, “i”);

TProfile *prof = h2->ProfileX();

while (bin–){
Double_t value;
value = prof->GetBinContent(bin);
prof->SetBinError(bin, 0.05*value);


Calling SetBinError for a TProfile does not make much sense.
Use a ProjectionX instead of a ProfileX