_ROOT Version: 5.34/09
_Platform: Linux 3.11.10-100.fc18.x86_64
_Compiler: gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC)
Hello,
With the help of excellent ROOT Support I have learned how to search and fit the peaks in a gamma-spectrum using TSpectrum, and also to estimate background. The way the background is estimated is excellent, as visible from the top Pad on executing the attached macro.
In the present version of the macro the (linear) background is generated as a part of a fit function.
But then where is the use of the excellent background estimation from “TSpectrum::Background”?
I want to use the background generated by “TSpectrum::Background” instead of linear (in the attached macro) or quadratic or any other type. Can someone please help me?
You can run the attached macro as follows:
++++++++++++++++++++++++++++++++++++
root [0] TFile *f = new TFile(“hist.root”);
root [1] .L pfit.C++
root [2] pfit(“Addbackspectra00”,200,3000);
++++++++++++++++++++++++++++++++++++
With best regards,
Ajay
pfit.C (3.0 KB)
hist.root (9.6 KB)