created -9.7 39.8942 10
created -9.1 31.9154 8
created -8.5 39.8942 10
created -7.9 15.9577 4
created -7.3 11.9683 3
created -6.7 31.9154 8
created -6.1 35.9048 9
created -5.5 27.926 7
created -4.9 31.9154 8
created -4.3 35.9048 9
created -3.7 11.9683 3
created -3.1 27.926 7
created -2.5 19.9471 5
created -1.9 7.97885 2
created -1.3 15.9577 4
created -0.7 23.9365 6
created -0.1 31.9154 8
created 0.5 35.9048 9
created 1.1 23.9365 6
created 1.7 35.9048 9
created 2.3 15.9577 4
created 2.9 31.9154 8
created 3.5 27.926 7
created 4.1 35.9048 9
created 4.7 27.926 7
created 5.3 23.9365 6
created 5.9 35.9048 9
created 6.5 3.98942 1
created 7.1 35.9048 9
created 7.7 15.9577 4
created 8.3 15.9577 4
created 8.9 7.97885 2
created 9.5 7.97885 2
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-2.1185e-05)
fit chi^2 = 1.462e-06
found -9.7 (+-0.000167866) 39.8939 (+-0.065997) 10.0001 (+-0.000541604)
found -8.5 (+-0.00016773) 39.8941 (+-0.0659961) 10.0002 (+-0.000541596)
found -6.1 (+-0.000177262) 35.9049 (+-0.0626292) 9.00019 (+-0.000513966)
found -4.3 (+-0.000176783) 35.9047 (+-0.0626089) 9.00014 (+-0.000513799)
found 0.5 (+-0.000177163) 35.9048 (+-0.0626249) 9.00018 (+-0.00051393)
found 1.7 (+-0.000176742) 35.9046 (+-0.0626065) 9.00013 (+-0.00051378)
found 4.1 (+-0.000177172) 35.9048 (+-0.0626252) 9.00018 (+-0.000513933)
found 5.9 (+-0.000176172) 35.9045 (+-0.062584) 9.00009 (+-0.000513595)
found 7.1 (+-0.000175942) 35.9044 (+-0.062574) 9.00006 (+-0.000513513)
found -9.1 (+-0.000188643) 31.9158 (+-0.0590727) 8.00026 (+-0.000484779)
found -6.7 (+-0.000187747) 31.9154 (+-0.0590377) 8.00015 (+-0.000484492)
found -4.9 (+-0.000188279) 31.9156 (+-0.0590579) 8.00021 (+-0.000484658)
found -0.0999992 (+-0.000188169) 31.9155 (+-0.0590536) 8.00019 (+-0.000484623)
found 2.9 (+-0.000187718) 31.9153 (+-0.059036) 8.00014 (+-0.000484478)
found -5.5 (+-0.000201614) 27.9263 (+-0.0552555) 7.00022 (+-0.000453454)
found 4.7 (+-0.000201379) 27.9262 (+-0.0552473) 7.00019 (+-0.000453386)
found -3.1 (+-0.000200433) 27.9258 (+-0.0552147) 7.0001 (+-0.000453119)
found 3.5 (+-0.000201614) 27.9263 (+-0.0552555) 7.00022 (+-0.000453454)
found 1.1 (+-0.000218188) 23.937 (+-0.0511696) 6.00023 (+-0.000419923)
found -0.699999 (+-0.000217348) 23.9367 (+-0.0511442) 6.00015 (+-0.000419715)
found 5.3 (+-0.000217941) 23.9369 (+-0.051162) 6.00021 (+-0.000419861)
found -2.5 (+-0.000237755) 19.9472 (+-0.0466803) 5.00012 (+-0.000383081)
found -7.9 (+-0.000267147) 15.9581 (+-0.0417792) 4.00017 (+-0.000342861)
found 2.3 (+-0.000268152) 15.9583 (+-0.0417995) 4.00022 (+-0.000343027)
found 7.7 (+-0.000267293) 15.9581 (+-0.0417818) 4.00017 (+-0.000342882)
found -1.3 (+-0.000266083) 15.9578 (+-0.0417572) 4.0001 (+-0.00034268)
found 8.3 (+-0.000265614) 15.9577 (+-0.0417475) 4.00008 (+-0.000342601)
found -3.7 (+-0.000310396) 11.9689 (+-0.0362118) 3.00021 (+-0.000297172)
found -7.3 (+-0.000309317) 11.9687 (+-0.0361946) 3.00016 (+-0.000297031)
found -1.9 (+-0.000379444) 7.97916 (+-0.0295591) 2.00012 (+-0.000242576)
found 8.9 (+-0.000377775) 7.979 (+-0.0295416) 2.00008 (+-0.000242433)
found 9.5 (+-0.000372895) 7.97889 (+-0.0294984) 2.00005 (+-0.000242078)
found 6.5 (+-0.000546918) 3.99028 (+-0.0209608) 1.00023 (+-0.000172015)
#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()