GetBinContent(Int_t binx, Int_t biny, Int_t) in TH2

The prototype of method GetBinContent(Int_t binx, Int_t biny, Int_t ) in TH2 - https://root.cern.ch/doc/master/classTH2.html#a84bfa4a81446cdc420a9f000d0e89688 specifies that the first parameter is the bin number of the x axis, the second parameter is the bin number of the y axis. What is the third parameter?

TH3::GetBinContent
TH1::GetBinContent

So in TH2, the third parameter is just a placeholder and doesn’t matter? (and by extension, the second and third parameter do not matter for TH1?)
In that case, is there any reason the method with that prototype exists? (Does it have to inherit from a super class and not be implemented in the class itself)

TH1::GetBinContent(Int_t bin)

I still do not understand the utility of the 3rd parameter for TH2 and the 2nd and 3rd parameter for a TH1. Changing those does not change the global bin number.

they aren’t used.
they are leftovers of a wrong design decision in how the inheritance tree bw TH1, TH2 and TH3 was setup.

1 Like

Is there no way to refactor the code to fix this without changing existing functionality? (Not sure if it would even be worth the time…)