What is bin number -1

What is meant by -1
TH1D * ProjectionY(const char* name = “_py”, Int_t firstxbin = 0, Int_t lastxbin = -1, Option_t* option = “”) const


If I try to read bin content with number -1 I get 0.0, while my overflow bin is filled.

-1 is used as a convention in this specific function (ProjectionY) to indicate a default case that the over-flow bin is included.
This convention does not apply to TH1::GetBinContent or other similar functions requiring the bin number


1 Like

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