created -9.7 27.926 7
created -9.1 11.9683 3
created -8.5 35.9048 9
created -7.9 39.8942 10
created -7.3 35.9048 9
created -6.7 7.97885 2
created -6.1 11.9683 3
created -5.5 7.97885 2
created -4.9 23.9365 6
created -4.3 35.9048 9
created -3.7 27.926 7
created -3.1 35.9048 9
created -2.5 31.9154 8
created -1.9 15.9577 4
created -1.3 39.8942 10
created -0.7 15.9577 4
created -0.1 19.9471 5
created 0.5 7.97885 2
created 1.1 7.97885 2
created 1.7 35.9048 9
created 2.3 3.98942 1
created 2.9 23.9365 6
created 3.5 35.9048 9
created 4.1 3.98942 1
created 4.7 7.97885 2
created 5.3 31.9154 8
created 5.9 3.98942 1
created 6.5 23.9365 6
created 7.1 39.8942 10
created 7.7 35.9048 9
created 8.3 23.9365 6
created 8.9 15.9577 4
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 (+-3.75716e-05)
fit chi^2 = 4.20262e-06
found -7.9 (+-0.000285289) 39.8944 (+-0.111937) 10.0002 (+-0.000918612)
found -1.3 (+-0.00028373) 39.8939 (+-0.111862) 10.0001 (+-0.000917996)
found 7.1 (+-0.000284868) 39.8942 (+-0.111917) 10.0002 (+-0.000918443)
found -8.5 (+-0.000299998) 35.9048 (+-0.106163) 9.00017 (+-0.000871223)
found -7.3 (+-0.000299693) 35.9047 (+-0.106151) 9.00015 (+-0.000871123)
found -4.3 (+-0.000300219) 35.9048 (+-0.106171) 9.00017 (+-0.000871289)
found -3.1 (+-0.000300539) 35.9049 (+-0.106185) 9.00019 (+-0.000871405)
found 1.7 (+-0.000297759) 35.9043 (+-0.106069) 9.00004 (+-0.000870454)
found 3.5 (+-0.000298691) 35.9045 (+-0.106108) 9.00009 (+-0.000870776)
found 7.7 (+-0.000300643) 35.9049 (+-0.10619) 9.00021 (+-0.000871446)
found -2.5 (+-0.000318591) 31.9154 (+-0.100106) 8.00017 (+-0.000821517)
found 5.3 (+-0.000315974) 31.9149 (+-0.100008) 8.00004 (+-0.000820716)
found -3.7 (+-0.000342003) 27.9264 (+-0.0936895) 7.00023 (+-0.000768861)
found -9.7 (+-0.000339463) 27.9256 (+-0.0935941) 7.00004 (+-0.000768079)
found 8.3 (+-0.000368701) 23.9368 (+-0.0867189) 6.00017 (+-0.000711658)
found -4.9 (+-0.000367908) 23.9366 (+-0.0866967) 6.00014 (+-0.000711476)
found 2.9 (+-0.000367301) 23.9366 (+-0.0866808) 6.00013 (+-0.000711345)
found 6.5 (+-0.000367484) 23.9367 (+-0.0866867) 6.00014 (+-0.000711393)
found 9.5 (+-0.000364467) 23.9366 (+-0.0866086) 6.00013 (+-0.000710752)
found -0.100001 (+-0.000402172) 19.947 (+-0.0791205) 5.00008 (+-0.000649302)
found -1.9 (+-0.000454903) 15.9583 (+-0.0708748) 4.00023 (+-0.000581633)
found -0.700003 (+-0.000453875) 15.9582 (+-0.0708534) 4.00019 (+-0.000581458)
found 8.9 (+-0.000453066) 15.958 (+-0.0708358) 4.00016 (+-0.000581313)
found -9.1 (+-0.000526262) 11.9689 (+-0.0613955) 3.00021 (+-0.000503841)
found -6.1 (+-0.000519706) 11.9683 (+-0.0612935) 3.00005 (+-0.000503004)
found -6.70001 (+-0.000644733) 7.97932 (+-0.0501327) 2.00016 (+-0.000411413)
found -5.5 (+-0.000643085) 7.97916 (+-0.0501139) 2.00012 (+-0.000411259)
found 0.499997 (+-0.000641265) 7.97906 (+-0.0500948) 2.00009 (+-0.000411102)
found 1.10001 (+-0.000643574) 7.97927 (+-0.0501211) 2.00014 (+-0.000411318)
found 4.70001 (+-0.00064145) 7.97917 (+-0.0500997) 2.00012 (+-0.000411143)
found 2.29999 (+-0.000924284) 3.99013 (+-0.0355203) 1.0002 (+-0.000291497)
found 5.9 (+-0.000923385) 3.99008 (+-0.0355148) 1.00018 (+-0.000291452)
found 4.09998 (+-0.000917855) 3.98992 (+-0.0354847) 1.00014 (+-0.000291205)
#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()