How to eliminate background counts?

You need to use one of the two:

  1. first eliminate the background and then fit your (clean) peaks,
  2. fit your histogram using a fit function which simultaneously models the peaks and the background.

BTW. The TSpectrum class provides some background estimation / elimination methods.