Hello everyone,
I have a spectrum (histogram) of kind TH1F called “h_tof” and I would like to fit the background using the function Background here in the documentation : root.cern.ch/root/html/TSpectru … Background
Since it outputs a TH1, that I will call for example “ambiant” I understand I need to declare it first, then use the function. I’m sorry I’m very new and this might be completely wrong, this I why I post something here
#include "TSpectrum.h"
TSpectrum *s = new TSpectrum ();
TH1 *ambiant = new TH1("ambiant");
ambiant=s->Background(h_tof,20,"");
I also tried TH1::TH1 *ambiant = new TH1::TH1("ambiant");
"this outputs : Error: Can’t call TH1::TH1(“arriereplan”) in current scope
None of them work.
Also , is there a way of evaluating this background fit afterwards at one given point? All this is of course to compute the signal to background ratio.
Thanks in advance for your help,
Regards
David Luis