created -9.7 15.9577 4
created -9.1 7.97885 2
created -8.5 39.8942 10
created -7.9 19.9471 5
created -7.3 27.926 7
created -6.7 15.9577 4
created -6.1 19.9471 5
created -5.5 27.926 7
created -4.9 3.98942 1
created -4.3 31.9154 8
created -3.7 31.9154 8
created -3.1 35.9048 9
created -2.5 15.9577 4
created -1.9 3.98942 1
created -1.3 7.97885 2
created -0.7 15.9577 4
created -0.1 35.9048 9
created 0.5 7.97885 2
created 1.1 19.9471 5
created 1.7 7.97885 2
created 2.3 35.9048 9
created 2.9 11.9683 3
created 3.5 15.9577 4
created 4.1 3.98942 1
created 4.7 35.9048 9
created 5.3 31.9154 8
created 5.9 23.9365 6
created 6.5 23.9365 6
created 7.1 23.9365 6
created 7.7 7.97885 2
created 8.3 11.9683 3
created 8.9 7.97885 2
created 9.5 3.98942 1
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-1.77615e-05)
fit chi^2 = 7.90405e-07
found -8.5 (+-0.000122913) 39.8938 (+-0.048506) 10.0001 (+-0.000398064)
found -3.1 (+-0.000130092) 35.9047 (+-0.0460392) 9.00015 (+-0.000377821)
found -0.1 (+-0.000129546) 35.9044 (+-0.0460161) 9.00007 (+-0.000377631)
found 2.3 (+-0.00012944) 35.9044 (+-0.0460117) 9.00006 (+-0.000377594)
found 4.7 (+-0.000129672) 35.9046 (+-0.0460227) 9.00011 (+-0.000377685)
found 5.3 (+-0.000138356) 31.9155 (+-0.0434207) 8.00019 (+-0.000356332)
found -4.3 (+-0.00013763) 31.9152 (+-0.0433941) 8.00012 (+-0.000356113)
found -3.7 (+-0.00013851) 31.9156 (+-0.0434268) 8.00022 (+-0.000356382)
found -7.3 (+-0.000147507) 27.9259 (+-0.0406025) 7.00012 (+-0.000333204)
found -5.5 (+-0.000146982) 27.9257 (+-0.040586) 7.00008 (+-0.000333068)
found 5.9 (+-0.000160057) 23.9368 (+-0.0376124) 6.00018 (+-0.000308666)
found 6.5 (+-0.00015986) 23.9367 (+-0.0376064) 6.00015 (+-0.000308616)
found 7.1 (+-0.000159272) 23.9365 (+-0.0375895) 6.0001 (+-0.000308478)
found -7.9 (+-0.000175933) 19.9476 (+-0.0343508) 5.00022 (+-0.0002819)
found -6.1 (+-0.000175219) 19.9473 (+-0.0343325) 5.00014 (+-0.000281749)
found 1.1 (+-0.000174014) 19.9469 (+-0.0343031) 5.00005 (+-0.000281508)
found -6.7 (+-0.000196466) 15.958 (+-0.0307194) 4.00016 (+-0.000252099)
found -2.5 (+-0.000195661) 15.9579 (+-0.0307048) 4.00013 (+-0.000251979)
found -9.7 (+-0.000194841) 15.9575 (+-0.0306845) 4.00003 (+-0.000251812)
found -0.699996 (+-0.000196041) 15.9579 (+-0.0307116) 4.00014 (+-0.000252035)
found 3.5 (+-0.000194709) 15.9576 (+-0.0306848) 4.00005 (+-0.000251815)
found 2.9 (+-0.000227589) 11.9687 (+-0.0266157) 3.00017 (+-0.000218421)
found 8.3 (+-0.000225384) 11.9682 (+-0.0265815) 3.00005 (+-0.000218141)
found -9.09999 (+-0.000280209) 7.97942 (+-0.0217479) 2.00018 (+-0.000178474)
found 0.499996 (+-0.000280347) 7.97942 (+-0.0217491) 2.00018 (+-0.000178484)
found 1.7 (+-0.000280347) 7.97942 (+-0.0217491) 2.00018 (+-0.000178484)
found 7.7 (+-0.00027889) 7.97916 (+-0.0217332) 2.00012 (+-0.000178353)
found 8.9 (+-0.000276683) 7.9789 (+-0.0217104) 2.00005 (+-0.000178166)
found -1.3 (+-0.000277073) 7.97895 (+-0.0217145) 2.00007 (+-0.0001782)
found -4.9 (+-0.000400923) 3.99013 (+-0.0154047) 1.0002 (+-0.000126418)
found 4.10001 (+-0.000399694) 3.99002 (+-0.0153977) 1.00017 (+-0.000126361)
found -1.9 (+-0.000395681) 3.98966 (+-0.0153746) 1.00008 (+-0.000126172)
found 9.5 (+-0.000388964) 3.9895 (+-0.0153433) 1.00004 (+-0.000125914)
#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()