42 delete gROOT->FindObject(
"h");
58 std::cout <<
"created "
64 std::cout <<
"the total number of created peaks = " <<
npeaks
65 <<
" with sigma = " <<
sigma << std::endl;
78 Int_t nbins =
h->GetNbinsX();
83 for (i = 0; i < nbins; i++)
source[i] =
h->GetBinContent(i + 1);
95 for (i = 0; i <
nfound; i++) {
97 Amp[i] =
h->GetBinContent(bin);
100 pfit->SetFitParameters(0, (nbins - 1), 1000, 0.1,
pfit->kFitOptimChiCounts,
101 pfit->kFitAlphaHalving,
pfit->kFitPower2,
102 pfit->kFitTaylorOrderFirst);
112 delete gROOT->FindObject(
"d");
113 TH1F *
d =
new TH1F(*
h);
d->SetNameTitle(
"d",
"");
d->Reset(
"M");
114 for (i = 0; i < nbins; i++)
d->SetBinContent(i + 1,
source[i]);
124 std::cout <<
"the total number of found peaks = " <<
nfound
127 std::cout <<
"fit chi^2 = " <<
pfit->GetChi() << std::endl;
128 for (i = 0; i <
nfound; i++) {
130 Pos[i] =
d->GetBinCenter(bin);
131 Amp[i] =
d->GetBinContent(bin);
139 std::cout <<
"found "
145 d->SetLineColor(
kRed);
d->SetLineWidth(1);
149 h->GetListOfFunctions()->Remove(
pm);
153 h->GetListOfFunctions()->Add(
pm);
154 pm->SetMarkerStyle(23);
156 pm->SetMarkerSize(1);
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()