created -9.7 3.98942 1
created -9.1 3.98942 1
created -8.5 23.9365 6
created -7.9 11.9683 3
created -7.3 39.8942 10
created -6.7 39.8942 10
created -6.1 15.9577 4
created -5.5 19.9471 5
created -4.9 15.9577 4
created -4.3 11.9683 3
created -3.7 39.8942 10
created -3.1 3.98942 1
created -2.5 31.9154 8
created -1.9 31.9154 8
created -1.3 31.9154 8
created -0.7 19.9471 5
created -0.1 31.9154 8
created 0.5 27.926 7
created 1.1 35.9048 9
created 1.7 35.9048 9
created 2.3 39.8942 10
created 2.9 15.9577 4
created 3.5 7.97885 2
created 4.1 7.97885 2
created 4.7 15.9577 4
created 5.3 35.9048 9
created 5.9 7.97885 2
created 6.5 3.98942 1
created 7.1 23.9365 6
created 7.7 31.9154 8
created 8.3 7.97885 2
created 8.9 39.8942 10
created 9.5 11.9683 3
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-2.73693e-05)
fit chi^2 = 2.16216e-06
found -7.3 (+-0.000203992) 39.8941 (+-0.0802595) 10.0002 (+-0.000658649)
found -6.7 (+-0.000204154) 39.8942 (+-0.0802668) 10.0002 (+-0.000658709)
found -3.7 (+-0.000202726) 39.8936 (+-0.0802009) 10 (+-0.000658168)
found 2.3 (+-0.000204068) 39.8941 (+-0.0802625) 10.0002 (+-0.000658674)
found 8.9 (+-0.000202995) 39.8937 (+-0.0802122) 10.0001 (+-0.000658261)
found 1.1 (+-0.000215669) 35.9049 (+-0.076168) 9.00021 (+-0.000625072)
found 1.7 (+-0.000215974) 35.9051 (+-0.0761817) 9.00024 (+-0.000625185)
found 5.3 (+-0.000214261) 35.9044 (+-0.0761077) 9.00007 (+-0.000624578)
found -2.5 (+-0.000227632) 31.9152 (+-0.0717712) 8.00012 (+-0.00058899)
found -1.9 (+-0.000228976) 31.9156 (+-0.0718208) 8.00021 (+-0.000589397)
found -1.3 (+-0.000228573) 31.9154 (+-0.0718049) 8.00017 (+-0.000589267)
found -0.0999995 (+-0.000228452) 31.9154 (+-0.0718001) 8.00016 (+-0.000589227)
found 7.7 (+-0.000227715) 31.9152 (+-0.0717725) 8.0001 (+-0.000589)
found 0.5 (+-0.000245183) 27.9263 (+-0.0671963) 7.00022 (+-0.000551446)
found -8.5 (+-0.000262345) 23.9363 (+-0.0621401) 6.00005 (+-0.000509953)
found 7.1 (+-0.000263314) 23.9365 (+-0.0621693) 6.00012 (+-0.000510192)
found -5.5 (+-0.000289129) 19.9471 (+-0.0567668) 5.0001 (+-0.000465856)
found -0.7 (+-0.000290842) 19.9476 (+-0.0568103) 5.00021 (+-0.000466213)
found -6.1 (+-0.000325552) 15.9582 (+-0.0508212) 4.00019 (+-0.000417064)
found -4.9 (+-0.000323765) 15.9578 (+-0.050784) 4.0001 (+-0.000416759)
found 2.9 (+-0.000324425) 15.958 (+-0.0507992) 4.00016 (+-0.000416884)
found 4.7 (+-0.000324239) 15.9579 (+-0.0507951) 4.00014 (+-0.00041685)
found -7.9 (+-0.000377402) 11.9689 (+-0.0440363) 3.00021 (+-0.000361384)
found 9.5 (+-0.000372469) 11.9687 (+-0.0439717) 3.00017 (+-0.000360854)
found -4.3 (+-0.000376656) 11.9688 (+-0.0440247) 3.00018 (+-0.000361288)
found 8.3 (+-0.000465345) 7.97962 (+-0.0359903) 2.00023 (+-0.000295354)
found 5.89999 (+-0.00046045) 7.97921 (+-0.0359393) 2.00013 (+-0.000294936)
found 3.5 (+-0.000459413) 7.979 (+-0.0359256) 2.00008 (+-0.000294823)
found 4.1 (+-0.000459413) 7.979 (+-0.0359256) 2.00008 (+-0.000294823)
found -3.1 (+-0.000665057) 3.99028 (+-0.0254902) 1.00023 (+-0.000209185)
found 6.50001 (+-0.00065627) 3.98976 (+-0.0254394) 1.00011 (+-0.000208769)
found -9.09999 (+-0.000654142) 3.98971 (+-0.0254286) 1.00009 (+-0.00020868)
found -9.7 (+-0.000646113) 3.9894 (+-0.0253829) 1.00001 (+-0.000208305)
#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()