43 Double_t result = par[0] + par[1]*x[0];
44 for (
Int_t p=0;p<npeaks;p++) {
52 void peaks(
Int_t np=10) {
54 TH1F *
h =
new TH1F(
"h",
"test",500,0,1000);
60 for (p=0;p<npeaks;p++) {
65 TF1 *f =
new TF1(
"f",fpeaks,0,1000,2+3*npeaks);
77 printf(
"Found %d candidate peaks to fit\n",nfound);
85 TF1 *fline =
new TF1(
"fline",
"pol1",0,1000);
92 for (p=0;p<nfound;p++) {
102 printf(
"Found %d useful peaks to fit\n",npeaks);
103 printf(
"Now fitting: Be patient\n");
104 TF1 *fit =
new TF1(
"fit",fpeaks,0,1000,2+3*npeaks);
virtual void SetParameters(const Double_t *params)
virtual void SetNpx(Int_t npx=100)
Set the number of points used to draw the function.
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
1-D histogram with a float per channel (see TH1 documentation)}
Double_t * GetPositionX() const
virtual Double_t Rndm()
Machine independent random number generator.
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
One-dimensional peak search function.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
R__EXTERN TRandom * gRandom
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculate a gaussian function with mean and sigma.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual TH1 * Background(const TH1 *hist, Int_t niter=20, Option_t *option="")
One-dimensional background estimation function.
static constexpr double s
Advanced Spectra Processing.
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
virtual Double_t GetParameter(Int_t ipar) const
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
Double_t Sqrt(Double_t x)
virtual void Update()
Update canvas pad buffers.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...