created -9.76 14.9603 3
created -9.28 9.97356 2
created -8.8 14.9603 3
created -8.32 49.8678 10
created -7.84 39.8942 8
created -7.36 39.8942 8
created -6.88 14.9603 3
created -6.4 44.881 9
created -5.92 44.881 9
created -5.44 19.9471 4
created -4.96 49.8678 10
created -4.48 9.97356 2
created -4 49.8678 10
created -3.52 39.8942 8
created -3.04 49.8678 10
created -2.56 9.97356 2
created -2.08 39.8942 8
created -1.6 4.98678 1
created -1.12 39.8942 8
created -0.64 34.9074 7
created -0.16 34.9074 7
created 0.32 44.881 9
created 0.8 49.8678 10
created 1.28 39.8942 8
created 1.76 19.9471 4
created 2.24 39.8942 8
created 2.72 14.9603 3
created 3.2 4.98678 1
created 3.68 9.97356 2
created 4.16 34.9074 7
created 4.64 24.9339 5
created 5.12 4.98678 1
created 5.6 34.9074 7
created 6.08 4.98678 1
created 6.56 4.98678 1
created 7.04 29.9207 6
created 7.52 4.98678 1
created 8 34.9074 7
created 8.48 4.98678 1
created 8.96 4.98678 1
created 9.44 34.9074 7
the total number of created peaks = 41 with sigma = 0.08
the total number of found peaks = 41 with sigma = 0.0800011 (+-2.67441e-05)
fit chi^2 = 3.98205e-06
found -8.32 (+-0.000219372) 49.8677 (+-0.134963) 10.0001 (+-0.000893748)
found -4.96 (+-0.00021866) 49.8674 (+-0.134911) 10.0001 (+-0.000893403)
found -4 (+-0.000219159) 49.8676 (+-0.134948) 10.0001 (+-0.000893651)
found -3.04 (+-0.000219159) 49.8676 (+-0.134948) 10.0001 (+-0.000893651)
found 0.8 (+-0.000220149) 49.868 (+-0.13502) 10.0002 (+-0.00089413)
found -6.4 (+-0.000231504) 44.881 (+-0.128055) 9.00012 (+-0.000848005)
found -5.92 (+-0.000231695) 44.8811 (+-0.128068) 9.00013 (+-0.000848086)
found 0.32 (+-0.000232232) 44.8813 (+-0.128104) 9.00017 (+-0.000848328)
found -7.84 (+-0.000246686) 39.8946 (+-0.120801) 8.00018 (+-0.000799963)
found -7.36 (+-0.000245627) 39.8943 (+-0.120736) 8.00011 (+-0.000799537)
found -3.52 (+-0.000246919) 39.8947 (+-0.120815) 8.0002 (+-0.000800061)
found -2.08 (+-0.000243938) 39.8938 (+-0.120638) 8.00003 (+-0.000798888)
found -1.12 (+-0.000244878) 39.8941 (+-0.120694) 8.00008 (+-0.000799259)
found 1.28 (+-0.00024607) 39.8944 (+-0.120763) 8.00014 (+-0.000799716)
found 2.24 (+-0.000245019) 39.894 (+-0.120699) 8.00007 (+-0.00079929)
found -0.64 (+-0.000263616) 34.9077 (+-0.112993) 7.00015 (+-0.000748259)
found -0.16 (+-0.000263751) 34.9078 (+-0.113) 7.00016 (+-0.000748309)
found 4.16 (+-0.000262059) 34.9073 (+-0.112911) 7.00007 (+-0.000747714)
found 5.6 (+-0.000260532) 34.9071 (+-0.112835) 7.00002 (+-0.000747213)
found 8 (+-0.000260532) 34.9071 (+-0.112835) 7.00002 (+-0.000747213)
found 9.44 (+-0.000259457) 34.9074 (+-0.112792) 7.00008 (+-0.000746931)
found 7.04 (+-0.000281578) 29.9204 (+-0.104472) 6.00002 (+-0.00069183)
found 4.64 (+-0.000310652) 24.934 (+-0.0954514) 5.00008 (+-0.000632096)
found -5.44 (+-0.000351417) 19.9478 (+-0.0855025) 4.00019 (+-0.000566213)
found 1.76 (+-0.000350774) 19.9477 (+-0.0854809) 4.00016 (+-0.00056607)
found -6.88 (+-0.000406594) 14.961 (+-0.0740682) 3.00017 (+-0.000490493)
found 2.72 (+-0.000402871) 14.9606 (+-0.0739802) 3.00009 (+-0.00048991)
found -9.76 (+-0.000400875) 14.9602 (+-0.0739234) 3.00002 (+-0.000489534)
found -8.8 (+-0.000404274) 14.9608 (+-0.0740131) 3.00012 (+-0.000490128)
found -4.48 (+-0.000501634) 9.97445 (+-0.0605409) 2.0002 (+-0.000400913)
found -2.56 (+-0.000500873) 9.97434 (+-0.0605273) 2.00018 (+-0.000400823)
found -9.28 (+-0.00049466) 9.97373 (+-0.0604209) 2.00006 (+-0.000400118)
found 3.68 (+-0.0004948) 9.97383 (+-0.060427) 2.00008 (+-0.000400159)
found -1.6 (+-0.000714504) 4.98753 (+-0.0428558) 1.00016 (+-0.000283799)
found 5.12 (+-0.000711192) 4.98733 (+-0.0428252) 1.00012 (+-0.000283596)
found 7.52 (+-0.000712137) 4.98738 (+-0.0428338) 1.00013 (+-0.000283653)
found 6.07999 (+-0.000704894) 4.98713 (+-0.0427728) 1.00008 (+-0.000283249)
found 8.47999 (+-0.000704893) 4.98713 (+-0.0427728) 1.00008 (+-0.000283249)
found 3.2 (+-0.000703132) 4.98697 (+-0.042754) 1.00005 (+-0.000283124)
found 8.96001 (+-0.000704893) 4.98713 (+-0.0427728) 1.00008 (+-0.000283249)
found 6.56001 (+-0.00070408) 4.98707 (+-0.042765) 1.00007 (+-0.000283198)
#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()