created -9.76 39.8942 8
created -9.28 44.881 9
created -8.8 29.9207 6
created -8.32 39.8942 8
created -7.84 19.9471 4
created -7.36 44.881 9
created -6.88 24.9339 5
created -6.4 49.8678 10
created -5.92 9.97356 2
created -5.44 9.97356 2
created -4.96 9.97356 2
created -4.48 39.8942 8
created -4 9.97356 2
created -3.52 14.9603 3
created -3.04 19.9471 4
created -2.56 44.881 9
created -2.08 34.9074 7
created -1.6 4.98678 1
created -1.12 14.9603 3
created -0.64 34.9074 7
created -0.16 24.9339 5
created 0.32 24.9339 5
created 0.8 44.881 9
created 1.28 44.881 9
created 1.76 34.9074 7
created 2.24 39.8942 8
created 2.72 49.8678 10
created 3.2 19.9471 4
created 3.68 39.8942 8
created 4.16 19.9471 4
created 4.64 9.97356 2
created 5.12 34.9074 7
created 5.6 49.8678 10
created 6.08 44.881 9
created 6.56 44.881 9
created 7.04 24.9339 5
created 7.52 19.9471 4
created 8 9.97356 2
created 8.48 14.9603 3
created 8.96 9.97356 2
created 9.44 24.9339 5
the total number of created peaks = 41 with sigma = 0.08
the total number of found peaks = 41 with sigma = 0.0800011 (+-2.19075e-05)
fit chi^2 = 2.83639e-06
found -6.4 (+-0.000184667) 49.8675 (+-0.11387) 10.0001 (+-0.000754069)
found 2.72 (+-0.000185291) 49.8677 (+-0.113916) 10.0001 (+-0.00075437)
found 5.6 (+-0.00018571) 49.8679 (+-0.113947) 10.0002 (+-0.000754577)
found -9.28 (+-0.000195712) 44.8811 (+-0.108097) 9.00014 (+-0.000715835)
found -7.36 (+-0.000195126) 44.8809 (+-0.108057) 9.00009 (+-0.000715571)
found -2.56 (+-0.000195354) 44.881 (+-0.108072) 9.00011 (+-0.000715675)
found 0.800001 (+-0.000195682) 44.8811 (+-0.108095) 9.00014 (+-0.000715823)
found 1.28 (+-0.000195913) 44.8812 (+-0.10811) 9.00016 (+-0.000715927)
found 6.08 (+-0.00019619) 44.8814 (+-0.10813) 9.00019 (+-0.000716056)
found 6.56 (+-0.000195682) 44.8811 (+-0.108095) 9.00014 (+-0.000715823)
found -9.76 (+-0.000207601) 39.8942 (+-0.101908) 8.00009 (+-0.000674851)
found -8.32 (+-0.000207252) 39.8942 (+-0.101894) 8.0001 (+-0.000674763)
found -4.48 (+-0.000206177) 39.8939 (+-0.101832) 8.00004 (+-0.000674348)
found 2.24 (+-0.000208086) 39.8946 (+-0.101946) 8.00017 (+-0.000675103)
found 3.68 (+-0.000206967) 39.8941 (+-0.101877) 8.00008 (+-0.000674649)
found -2.08 (+-0.000221345) 34.9075 (+-0.0953061) 7.0001 (+-0.000631134)
found -0.64 (+-0.000221418) 34.9074 (+-0.0953059) 7.00008 (+-0.000631133)
found 1.76 (+-0.000222723) 34.9078 (+-0.0953763) 7.00017 (+-0.000631599)
found 5.12 (+-0.000221794) 34.9076 (+-0.0953283) 7.00012 (+-0.000631281)
found -8.8 (+-0.000240901) 29.9211 (+-0.0883174) 6.00017 (+-0.000584854)
found -6.88 (+-0.000264648) 24.9345 (+-0.0806532) 5.00019 (+-0.0005341)
found -0.16 (+-0.000263484) 24.9342 (+-0.080606) 5.00012 (+-0.000533788)
found 7.04 (+-0.000263569) 24.9342 (+-0.0806101) 5.00013 (+-0.000533815)
found 0.320001 (+-0.000263801) 24.9343 (+-0.080619) 5.00014 (+-0.000533874)
found 9.44 (+-0.000259722) 24.9339 (+-0.0804756) 5.00007 (+-0.000532924)
found -7.84 (+-0.000296229) 19.9477 (+-0.0721499) 4.00017 (+-0.00047779)
found 3.2 (+-0.000296401) 19.9478 (+-0.0721558) 4.00018 (+-0.000477828)
found 4.16 (+-0.000294356) 19.9474 (+-0.0720908) 4.0001 (+-0.000477398)
found -3.04 (+-0.000294948) 19.9475 (+-0.0721092) 4.00012 (+-0.00047752)
found 7.52 (+-0.000293699) 19.9472 (+-0.0720691) 4.00007 (+-0.000477255)
found -3.52 (+-0.000339558) 14.9604 (+-0.0624233) 3.00006 (+-0.000413378)
found -1.12 (+-0.000339762) 14.9605 (+-0.0624308) 3.00008 (+-0.000413428)
found 8.48 (+-0.000338622) 14.9603 (+-0.0624013) 3.00004 (+-0.000413232)
found -5.92001 (+-0.000419635) 9.97404 (+-0.0510324) 2.00012 (+-0.000337946)
found -4 (+-0.000419763) 9.97399 (+-0.0510328) 2.00011 (+-0.000337949)
found 4.64 (+-0.000420009) 9.97399 (+-0.0510363) 2.00011 (+-0.000337972)
found 8 (+-0.000418074) 9.97378 (+-0.0510035) 2.00007 (+-0.000337754)
found 8.96 (+-0.000418576) 9.97383 (+-0.051012) 2.00008 (+-0.000337811)
found -5.44 (+-0.000416) 9.97363 (+-0.0509701) 2.00004 (+-0.000337533)
found -4.96 (+-0.000419009) 9.97393 (+-0.051021) 2.0001 (+-0.00033787)
found -1.60001 (+-0.000598224) 4.98723 (+-0.0361259) 1.0001 (+-0.000239232)
#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()