What is bin number -1

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

https://root.cern.ch/root/html604/TH2.html#TH2:ProjectionY

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

Hi,
-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

Lorenzo

1 Like

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