Any way of getting background data?

@Wile_E_Coyote @couet
fithisto.C (3.6 KB)
eu_gu_1.txt (44.1 KB)
The above code gives final spectrum which subtract background from raw data.
I am unable to understand how can i extract any data that was subtracted from raw data.
Is there any possible way of doing the above and how does the area gets affected?

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Your macro gives me this:

I am not completely sure tu understand what you want to do exactly .

You can make a clone of your histogram and apply the “background estimation” to that clone. Then you can subtract that clone (which will then be the “background”) from your original (unmodified) histogram.

@Wile_E_Coyote @couet
Thanks for your suggestion. I have tried something still unable to get result that i was expecting.
Can you please help me.
fithisto.C (3.8 KB) hist.C (905 Bytes)
eu_gu_1.txt (44.1 KB)

@Wile_E_Coyote @couet
Can you please suggest me something because after trying so hard I am still unable to get any expected result.

I get this plot. So it seems you managed to remove the background ?

@couet @Wile_E_Coyote
I have already remove the background in “fithisto.C” file using “TSpectrum:Background”. But I want to extract background data and in order to get that i was subtracting the data in which background was already subtracted from the raw data.
After subtraction I should be able to get the background but the above graph doesn’t implies background.
That’s the question.

Were you able to get anything out of it?

but the above graph doesn’t implies background.

What kind of different plot do you expect?

RAW is this:

diff is this:

So you can see that something happened - I’d call that background subtraction :slight_smile:

ok @Axel.
I will come to that part later. For the time being, could you please elaborate the following part of the code? How does it works?

TSpectrum s = new TSpectrum(2npeaks);
Int_t nfound = s->Search(h,2,"",0.06);
printf(“Found %d candidate peaks to fit\n”,nfound);

s->Background(h->GetArray() + 1, n,
10, TSpectrum::kBackDecreasingWindow,
TSpectrum::kBackOrder8, kTRUE,
TSpectrum::kBackSmoothing15, kTRUE);