created -9.7 39.8942 10
created -9.1 3.98942 1
created -8.5 11.9683 3
created -7.9 31.9154 8
created -7.3 23.9365 6
created -6.7 23.9365 6
created -6.1 27.926 7
created -5.5 35.9048 9
created -4.9 27.926 7
created -4.3 31.9154 8
created -3.7 27.926 7
created -3.1 7.97885 2
created -2.5 19.9471 5
created -1.9 31.9154 8
created -1.3 27.926 7
created -0.7 27.926 7
created -0.1 3.98942 1
created 0.5 35.9048 9
created 1.1 11.9683 3
created 1.7 31.9154 8
created 2.3 3.98942 1
created 2.9 19.9471 5
created 3.5 35.9048 9
created 4.1 35.9048 9
created 4.7 11.9683 3
created 5.3 39.8942 10
created 5.9 11.9683 3
created 6.5 19.9471 5
created 7.1 39.8942 10
created 7.7 39.8942 10
created 8.3 3.98942 1
created 8.9 27.926 7
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.64881e-05)
fit chi^2 = 8.38748e-07
found -9.7 (+-0.000126464) 39.8935 (+-0.049957) 10 (+-0.000409972)
found 5.3 (+-0.000126555) 39.8938 (+-0.0499643) 10.0001 (+-0.000410031)
found 7.1 (+-0.00012724) 39.8942 (+-0.0499968) 10.0002 (+-0.000410298)
found 7.7 (+-0.000126759) 39.894 (+-0.0499757) 10.0001 (+-0.000410125)
found -5.5 (+-0.000134195) 35.9048 (+-0.0474341) 9.00018 (+-0.000389267)
found 0.5 (+-0.000133155) 35.9043 (+-0.0473908) 9.00005 (+-0.000388912)
found 3.5 (+-0.000134168) 35.9048 (+-0.0474331) 9.00018 (+-0.000389259)
found 4.1 (+-0.000133963) 35.9047 (+-0.0474245) 9.00015 (+-0.000389189)
found -7.9 (+-0.000141979) 31.9152 (+-0.0447077) 8.00011 (+-0.000366893)
found -4.3 (+-0.000142462) 31.9155 (+-0.0447263) 8.00018 (+-0.000367046)
found -1.9 (+-0.000142288) 31.9154 (+-0.0447195) 8.00015 (+-0.00036699)
found 1.7 (+-0.000141307) 31.915 (+-0.0446831) 8.00005 (+-0.000366692)
found -4.9 (+-0.000152708) 27.9263 (+-0.0418521) 7.00022 (+-0.000343459)
found -6.1 (+-0.00015253) 27.9262 (+-0.0418458) 7.00019 (+-0.000343407)
found -3.7 (+-0.000151922) 27.9259 (+-0.0418256) 7.00013 (+-0.000343241)
found -1.3 (+-0.000152545) 27.9262 (+-0.0418463) 7.00019 (+-0.000343411)
found -0.700002 (+-0.000151604) 27.9258 (+-0.0418155) 7.0001 (+-0.000343158)
found 8.9 (+-0.000150761) 27.9255 (+-0.0417877) 7.00002 (+-0.000342931)
found -7.3 (+-0.000164879) 23.9368 (+-0.0387456) 6.00018 (+-0.000317965)
found -6.7 (+-0.000164782) 23.9367 (+-0.0387426) 6.00017 (+-0.000317941)
found -2.5 (+-0.000180194) 19.9472 (+-0.0353599) 5.00013 (+-0.000290181)
found 2.9 (+-0.000179977) 19.9473 (+-0.0353556) 5.00013 (+-0.000290145)
found 6.5 (+-0.000180624) 19.9474 (+-0.0353706) 5.00017 (+-0.000290269)
found 1.1 (+-0.000235279) 11.9689 (+-0.0274307) 3.00022 (+-0.00022511)
found 4.7 (+-0.000235591) 11.969 (+-0.0274359) 3.00025 (+-0.000225153)
found 5.9 (+-0.000234841) 11.9688 (+-0.0274238) 3.0002 (+-0.000225054)
found -8.5 (+-0.000233126) 11.9685 (+-0.0273981) 3.00012 (+-0.000224843)
found -3.1 (+-0.000288322) 7.97932 (+-0.022399) 2.00016 (+-0.000183817)
found 8.29999 (+-0.000413776) 3.99023 (+-0.0158735) 1.00022 (+-0.000130266)
found -9.10002 (+-0.000411352) 3.99003 (+-0.0158598) 1.00017 (+-0.000130153)
found 2.29999 (+-0.000411967) 3.99002 (+-0.0158627) 1.00017 (+-0.000130177)
found -0.0999956 (+-0.000413404) 3.99018 (+-0.0158712) 1.00021 (+-0.000130247)
found 9.49999 (+-0.00040382) 3.98976 (+-0.0158241) 1.0001 (+-0.000129861)
#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()