If you get the message “Attempt to divide histograms with different number of bins”"
your histograms that you want to divide have different numbers of bins. Please check your code
Attempting to produce a macro and a root file that I could upload for you, I found the problem. The division histogram had a different number of bins (x as y and other way around). The error message was misleading.
If you want I can upload the files.
Sorry for the trouble