created -9.7 39.8942 10
created -9.1 15.9577 4
created -8.5 15.9577 4
created -7.9 3.98942 1
created -7.3 15.9577 4
created -6.7 7.97885 2
created -6.1 3.98942 1
created -5.5 7.97885 2
created -4.9 39.8942 10
created -4.3 23.9365 6
created -3.7 23.9365 6
created -3.1 3.98942 1
created -2.5 27.926 7
created -1.9 7.97885 2
created -1.3 31.9154 8
created -0.7 31.9154 8
created -0.1 23.9365 6
created 0.5 23.9365 6
created 1.1 7.97885 2
created 1.7 3.98942 1
created 2.3 19.9471 5
created 2.9 19.9471 5
created 3.5 39.8942 10
created 4.1 23.9365 6
created 4.7 3.98942 1
created 5.3 23.9365 6
created 5.9 35.9048 9
created 6.5 27.926 7
created 7.1 3.98942 1
created 7.7 11.9683 3
created 8.3 23.9365 6
created 8.9 19.9471 5
created 9.5 23.9365 6
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-4.06204e-05)
fit chi^2 = 4.18002e-06
found -9.7 (+-0.000283193) 39.8937 (+-0.111563) 10.0001 (+-0.000915537)
found -4.9 (+-0.000282826) 39.8939 (+-0.111556) 10.0001 (+-0.00091548)
found 3.5 (+-0.000283515) 39.894 (+-0.111587) 10.0001 (+-0.000915737)
found 5.9 (+-0.000299411) 35.9048 (+-0.105885) 9.00017 (+-0.000868944)
found -1.3 (+-0.000316968) 31.9153 (+-0.0998078) 8.00013 (+-0.000819071)
found -0.700001 (+-0.000318018) 31.9155 (+-0.0998469) 8.00018 (+-0.000819392)
found 6.5 (+-0.000338799) 27.926 (+-0.0933622) 7.00013 (+-0.000766176)
found -2.5 (+-0.000337076) 27.9256 (+-0.0933032) 7.00004 (+-0.000765691)
found -4.3 (+-0.000368461) 23.9369 (+-0.086508) 6.00021 (+-0.000709927)
found 4.1 (+-0.000366494) 23.9367 (+-0.0864534) 6.00014 (+-0.000709478)
found -3.7 (+-0.000365671) 23.9365 (+-0.0864275) 6.00009 (+-0.000709266)
found -0.100001 (+-0.000368077) 23.9368 (+-0.086496) 6.00018 (+-0.000709828)
found 0.499999 (+-0.000366273) 23.9365 (+-0.0864433) 6.0001 (+-0.000709396)
found 5.3 (+-0.000366312) 23.9366 (+-0.0864475) 6.00013 (+-0.00070943)
found 8.3 (+-0.000366446) 23.9365 (+-0.0864475) 6.0001 (+-0.00070943)
found 9.5 (+-0.000363777) 23.9366 (+-0.0863842) 6.00014 (+-0.000708911)
found 2.3 (+-0.000400728) 19.9471 (+-0.0789005) 5.00008 (+-0.000647496)
found 2.9 (+-0.000403997) 19.9475 (+-0.0789805) 5.00019 (+-0.000648152)
found 8.9 (+-0.000403329) 19.9474 (+-0.0789626) 5.00016 (+-0.000648006)
found -9.1 (+-0.000452223) 15.9581 (+-0.0706541) 4.00018 (+-0.000579821)
found -8.5 (+-0.00044826) 15.9577 (+-0.0705748) 4.00007 (+-0.000579171)
found -7.3 (+-0.000447153) 15.9575 (+-0.070553) 4.00004 (+-0.000578992)
found 7.7 (+-0.000519629) 11.9684 (+-0.0611506) 3.00009 (+-0.000501831)
found -1.9 (+-0.000645492) 7.97947 (+-0.0500241) 2.00019 (+-0.000410522)
found -6.7 (+-0.000637174) 7.97896 (+-0.0499362) 2.00006 (+-0.000409801)
found -5.49999 (+-0.000640674) 7.97927 (+-0.0499761) 2.00014 (+-0.000410128)
found 1.09999 (+-0.000638595) 7.97906 (+-0.0499519) 2.00009 (+-0.00040993)
found -3.1 (+-0.000919922) 3.99002 (+-0.0354133) 1.00017 (+-0.000290619)
found 4.7 (+-0.000918841) 3.98997 (+-0.0354069) 1.00016 (+-0.000290566)
found -7.9 (+-0.000913645) 3.98976 (+-0.0353768) 1.0001 (+-0.000290319)
found 7.09999 (+-0.000915641) 3.98987 (+-0.035389) 1.00013 (+-0.00029042)
found 1.70001 (+-0.0009113) 3.98971 (+-0.0353644) 1.00009 (+-0.000290217)
found -6.1 (+-0.000906265) 3.98956 (+-0.0353361) 1.00005 (+-0.000289985)
#include <iostream>
delete gROOT->FindObject(
"h");
std::cout << "created "
}
std::cout <<
"the total number of created peaks = " <<
npeaks
<<
" with sigma = " <<
sigma << std::endl;
}
void FitAwmi(void) {
for (i = 0; i < nbins; i++)
source[i] =
h->GetBinContent(i + 1);
for (i = 0; i <
nfound; i++) {
Amp[i] =
h->GetBinContent(bin);
}
pfit->SetFitParameters(0, (nbins - 1), 1000, 0.1,
pfit->kFitOptimChiCounts,
pfit->kFitAlphaHalving,
pfit->kFitPower2,
pfit->kFitTaylorOrderFirst);
delete gROOT->FindObject(
"d");
TH1F *
d =
new TH1F(*
h);
d->SetNameTitle(
"d",
"");
d->Reset(
"M");
for (i = 0; i < nbins; i++)
d->SetBinContent(i + 1,
source[i]);
std::cout <<
"the total number of found peaks = " <<
nfound
<< std::endl;
std::cout <<
"fit chi^2 = " <<
pfit->GetChi() << std::endl;
for (i = 0; i <
nfound; i++) {
Pos[i] =
d->GetBinCenter(bin);
Amp[i] =
d->GetBinContent(bin);
std::cout << "found "
<< std::endl;
}
d->SetLineColor(
kRed);
d->SetLineWidth(1);
h->GetListOfFunctions()->Remove(
pm);
}
h->GetListOfFunctions()->Add(
pm);
delete s;
return;
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char x1
R__EXTERN TRandom * gRandom
1-D histogram with a float per channel (see TH1 documentation)
A PolyMarker is defined by an array on N points in a 2-D space.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Advanced 1-dimensional spectra fitting functions.
Advanced Spectra Processing.
Int_t SearchHighRes(Double_t *source, Double_t *destVector, Int_t ssize, Double_t sigma, Double_t threshold, bool backgroundRemove, Int_t deconIterations, bool markov, Int_t averWindow)
One-dimensional high-resolution peak search function.
Double_t * GetPositionX() const
constexpr Double_t Sqrt2()
Double_t Sqrt(Double_t x)
Returns the square root of x.
constexpr Double_t TwoPi()