created -9.7 11.9683 3
created -9.1 39.8942 10
created -8.5 23.9365 6
created -7.9 11.9683 3
created -7.3 7.97885 2
created -6.7 27.926 7
created -6.1 15.9577 4
created -5.5 7.97885 2
created -4.9 31.9154 8
created -4.3 27.926 7
created -3.7 23.9365 6
created -3.1 15.9577 4
created -2.5 11.9683 3
created -1.9 23.9365 6
created -1.3 3.98942 1
created -0.7 27.926 7
created -0.1 23.9365 6
created 0.5 39.8942 10
created 1.1 31.9154 8
created 1.7 15.9577 4
created 2.3 31.9154 8
created 2.9 27.926 7
created 3.5 35.9048 9
created 4.1 3.98942 1
created 4.7 3.98942 1
created 5.3 11.9683 3
created 5.9 27.926 7
created 6.5 11.9683 3
created 7.1 7.97885 2
created 7.7 11.9683 3
created 8.3 19.9471 5
created 8.9 19.9471 5
created 9.5 19.9471 5
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-3.65148e-05)
fit chi^2 = 3.48892e-06
found -9.1 (+-0.000258641) 39.8939 (+-0.101928) 10.0001 (+-0.000836474)
found 0.5 (+-0.000259438) 39.8942 (+-0.101966) 10.0002 (+-0.000836783)
found 3.5 (+-0.0002723) 35.9045 (+-0.0966862) 9.0001 (+-0.000793454)
found 1.1 (+-0.000290412) 31.9155 (+-0.0912158) 8.00018 (+-0.000748562)
found -4.9 (+-0.000289429) 31.9152 (+-0.0911782) 8.00012 (+-0.000748253)
found 2.3 (+-0.000289987) 31.9153 (+-0.0911985) 8.00014 (+-0.00074842)
found -6.7 (+-0.000309046) 27.9257 (+-0.0852764) 7.00008 (+-0.00069982)
found -4.3 (+-0.00031093) 27.9261 (+-0.0853401) 7.00018 (+-0.000700342)
found -0.699998 (+-0.000309013) 27.9258 (+-0.0852773) 7.00009 (+-0.000699827)
found 2.9 (+-0.000311453) 27.9263 (+-0.0853585) 7.00022 (+-0.000700494)
found 5.9 (+-0.000309112) 27.9257 (+-0.0852782) 7.00008 (+-0.000699835)
found -8.5 (+-0.000335783) 23.9367 (+-0.0790092) 6.00017 (+-0.000648388)
found -3.7 (+-0.000335561) 23.9366 (+-0.0790013) 6.00014 (+-0.000648324)
found -1.9 (+-0.000333253) 23.9363 (+-0.0789357) 6.00005 (+-0.000647785)
found -0.0999989 (+-0.000336844) 23.937 (+-0.0790402) 6.00022 (+-0.000648643)
found 8.3 (+-0.00036722) 19.9471 (+-0.0721088) 5.0001 (+-0.00059176)
found 8.9 (+-0.000367917) 19.9473 (+-0.0721259) 5.00013 (+-0.000591901)
found 9.5 (+-0.000364324) 19.9472 (+-0.0720509) 5.00013 (+-0.000591285)
found -6.1 (+-0.000411347) 15.9579 (+-0.0645128) 4.00012 (+-0.000529424)
found -3.1 (+-0.000411614) 15.9579 (+-0.0645173) 4.00012 (+-0.000529461)
found 1.7 (+-0.000413982) 15.9582 (+-0.0645661) 4.00021 (+-0.000529861)
found -7.9 (+-0.00047576) 11.9685 (+-0.0558814) 3.0001 (+-0.00045859)
found 6.5 (+-0.000476147) 11.9685 (+-0.0558877) 3.00012 (+-0.000458642)
found -9.69999 (+-0.000476724) 11.9686 (+-0.0558939) 3.00013 (+-0.000458693)
found -2.5 (+-0.000477086) 11.9686 (+-0.0559012) 3.00013 (+-0.000458752)
found 5.3 (+-0.000475118) 11.9685 (+-0.0558735) 3.0001 (+-0.000458525)
found 7.7 (+-0.000475327) 11.9684 (+-0.0558745) 3.00009 (+-0.000458533)
found -5.5 (+-0.000587829) 7.97932 (+-0.0456814) 2.00016 (+-0.000374884)
found -7.3 (+-0.000586489) 7.97921 (+-0.045667) 2.00013 (+-0.000374765)
found 7.1 (+-0.000583797) 7.97901 (+-0.0456376) 2.00008 (+-0.000374525)
found -1.3 (+-0.000840441) 3.99002 (+-0.0323536) 1.00017 (+-0.000265509)
found 4.09998 (+-0.000833566) 3.98987 (+-0.0323178) 1.00013 (+-0.000265216)
found 4.7 (+-0.000827162) 3.98956 (+-0.0322796) 1.00005 (+-0.000264902)
#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()