created -9.7 3.98942 1
created -9.1 19.9471 5
created -8.5 23.9365 6
created -7.9 19.9471 5
created -7.3 7.97885 2
created -6.7 15.9577 4
created -6.1 15.9577 4
created -5.5 23.9365 6
created -4.9 11.9683 3
created -4.3 31.9154 8
created -3.7 3.98942 1
created -3.1 19.9471 5
created -2.5 3.98942 1
created -1.9 3.98942 1
created -1.3 39.8942 10
created -0.7 39.8942 10
created -0.1 19.9471 5
created 0.5 7.97885 2
created 1.1 35.9048 9
created 1.7 23.9365 6
created 2.3 23.9365 6
created 2.9 23.9365 6
created 3.5 19.9471 5
created 4.1 35.9048 9
created 4.7 35.9048 9
created 5.3 11.9683 3
created 5.9 19.9471 5
created 6.5 39.8942 10
created 7.1 35.9048 9
created 7.7 39.8942 10
created 8.3 35.9048 9
created 8.9 11.9683 3
created 9.5 31.9154 8
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-4.34656e-05)
fit chi^2 = 5.54319e-06
found -1.3 (+-0.00032587) 39.894 (+-0.128476) 10.0001 (+-0.00105434)
found -0.700001 (+-0.000327105) 39.8942 (+-0.128531) 10.0002 (+-0.00105479)
found 6.5 (+-0.000326968) 39.8942 (+-0.128524) 10.0002 (+-0.00105473)
found 7.7 (+-0.000327646) 39.8944 (+-0.128557) 10.0002 (+-0.001055)
found 1.1 (+-0.000343517) 35.9045 (+-0.121881) 9.0001 (+-0.00100021)
found 4.1 (+-0.000344916) 35.9048 (+-0.12194) 9.00018 (+-0.0010007)
found 4.7 (+-0.000344389) 35.9047 (+-0.121918) 9.00015 (+-0.00100052)
found 7.1 (+-0.000345962) 35.9052 (+-0.121986) 9.00026 (+-0.00100108)
found 8.3 (+-0.000344539) 35.9048 (+-0.121925) 9.00017 (+-0.00100057)
found -4.3 (+-0.000363269) 31.915 (+-0.11487) 8.00005 (+-0.000942682)
found 9.5 (+-0.000361854) 31.9153 (+-0.11483) 8.00014 (+-0.000942352)
found 1.7 (+-0.000424096) 23.9369 (+-0.0996134) 6.00019 (+-0.000817476)
found -8.5 (+-0.000422738) 23.9366 (+-0.0995721) 6.00013 (+-0.000817137)
found -5.5 (+-0.000421646) 23.9364 (+-0.0995403) 6.00009 (+-0.000816876)
found 2.3 (+-0.000423345) 23.9367 (+-0.0995902) 6.00016 (+-0.000817286)
found 2.9 (+-0.000423041) 23.9366 (+-0.0995812) 6.00014 (+-0.000817212)
found -0.100003 (+-0.000463749) 19.9474 (+-0.0909162) 5.00016 (+-0.000746103)
found -9.1 (+-0.000461817) 19.9471 (+-0.0908685) 5.00009 (+-0.000745711)
found -7.9 (+-0.000462635) 19.9471 (+-0.0908867) 5.0001 (+-0.00074586)
found -3.1 (+-0.000459217) 19.9468 (+-0.090806) 5.00003 (+-0.000745199)
found 3.5 (+-0.000465341) 19.9475 (+-0.090954) 5.00019 (+-0.000746413)
found 5.9 (+-0.000464343) 19.9474 (+-0.09093) 5.00017 (+-0.000746216)
found -6.7 (+-0.000517198) 15.9577 (+-0.08129) 4.00008 (+-0.000667105)
found -6.1 (+-0.000519409) 15.9579 (+-0.081334) 4.00013 (+-0.000667466)
found -4.9 (+-0.000603485) 11.9688 (+-0.0704961) 3.00018 (+-0.000578525)
found 5.3 (+-0.000603342) 11.9688 (+-0.0704942) 3.00018 (+-0.000578509)
found 8.9 (+-0.00060485) 11.9689 (+-0.0705183) 3.00022 (+-0.000578708)
found 0.500004 (+-0.000742422) 7.97942 (+-0.0575966) 2.00018 (+-0.000472666)
found -7.3 (+-0.000738846) 7.97916 (+-0.0575568) 2.00012 (+-0.00047234)
found -3.70001 (+-0.00105907) 3.99002 (+-0.0407795) 1.00017 (+-0.000334657)
found -2.50001 (+-0.00104603) 3.98966 (+-0.0407073) 1.00008 (+-0.000334064)
found -9.69999 (+-0.00104352) 3.98961 (+-0.040692) 1.00007 (+-0.000333939)
found -1.89998 (+-0.00105162) 3.98993 (+-0.0407417) 1.00015 (+-0.000334347)
#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()