created -9.7 19.9471 5
created -9.1 3.98942 1
created -8.5 19.9471 5
created -7.9 27.926 7
created -7.3 11.9683 3
created -6.7 35.9048 9
created -6.1 39.8942 10
created -5.5 3.98942 1
created -4.9 15.9577 4
created -4.3 27.926 7
created -3.7 39.8942 10
created -3.1 23.9365 6
created -2.5 35.9048 9
created -1.9 35.9048 9
created -1.3 27.926 7
created -0.7 39.8942 10
created -0.1 31.9154 8
created 0.5 23.9365 6
created 1.1 19.9471 5
created 1.7 7.97885 2
created 2.3 31.9154 8
created 2.9 7.97885 2
created 3.5 3.98942 1
created 4.1 27.926 7
created 4.7 23.9365 6
created 5.3 3.98942 1
created 5.9 15.9577 4
created 6.5 3.98942 1
created 7.1 19.9471 5
created 7.7 23.9365 6
created 8.3 7.97885 2
created 8.9 27.926 7
created 9.5 39.8942 10
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-4.88039e-05)
fit chi^2 = 6.90751e-06
found -6.1 (+-0.000363617) 39.894 (+-0.143411) 10.0001 (+-0.0011769)
found -3.7 (+-0.000364869) 39.8941 (+-0.143465) 10.0002 (+-0.00117734)
found -0.7 (+-0.000365242) 39.8943 (+-0.143483) 10.0002 (+-0.00117749)
found 9.5 (+-0.000361999) 39.8943 (+-0.143349) 10.0002 (+-0.00117639)
found -6.7 (+-0.000384608) 35.9048 (+-0.136105) 9.00017 (+-0.00111694)
found -2.5 (+-0.000385268) 35.9049 (+-0.136132) 9.00019 (+-0.00111716)
found -1.9 (+-0.000385483) 35.905 (+-0.136141) 9.00021 (+-0.00111724)
found -0.100001 (+-0.000409196) 31.9156 (+-0.128369) 8.00021 (+-0.00105346)
found 2.3 (+-0.00040568) 31.915 (+-0.128235) 8.00005 (+-0.00105235)
found -1.3 (+-0.00043867) 27.9264 (+-0.120121) 7.00025 (+-0.000985771)
found -7.9 (+-0.000435668) 27.9258 (+-0.120017) 7.0001 (+-0.000984916)
found -4.3 (+-0.000437295) 27.9262 (+-0.120073) 7.00018 (+-0.000985381)
found 4.1 (+-0.000434803) 27.9258 (+-0.119991) 7.00009 (+-0.000984705)
found 8.9 (+-0.000436407) 27.9261 (+-0.120045) 7.00016 (+-0.000985147)
found -3.1 (+-0.000474499) 23.9371 (+-0.111232) 6.00025 (+-0.000912821)
found 0.499999 (+-0.000472821) 23.9368 (+-0.11118) 6.00017 (+-0.000912399)
found 4.7 (+-0.000470369) 23.9365 (+-0.111112) 6.0001 (+-0.000911836)
found 7.7 (+-0.000470507) 23.9364 (+-0.111113) 6.00009 (+-0.000911844)
found -9.7 (+-0.000513932) 19.9468 (+-0.101388) 5.00001 (+-0.000832042)
found -8.5 (+-0.000515877) 19.9472 (+-0.101446) 5.0001 (+-0.000832512)
found 1.1 (+-0.000516439) 19.9472 (+-0.101457) 5.0001 (+-0.000832603)
found 7.1 (+-0.000515526) 19.9471 (+-0.101436) 5.00009 (+-0.000832437)
found -4.9 (+-0.000577674) 15.9578 (+-0.0907538) 4.00011 (+-0.00074477)
found 5.9 (+-0.000573718) 15.9575 (+-0.0906755) 4.00003 (+-0.000744127)
found -7.3 (+-0.000674688) 11.9689 (+-0.0787113) 3.00021 (+-0.000645943)
found 1.7 (+-0.000828119) 7.97937 (+-0.0642877) 2.00017 (+-0.000527576)
found 2.89999 (+-0.000822363) 7.97917 (+-0.0642298) 2.00012 (+-0.000527101)
found 8.3 (+-0.000828288) 7.97937 (+-0.0642892) 2.00017 (+-0.000527589)
found -5.50001 (+-0.00118264) 3.99008 (+-0.0455256) 1.00018 (+-0.000373605)
found 5.3 (+-0.00117781) 3.98987 (+-0.0454961) 1.00013 (+-0.000373363)
found -9.1 (+-0.00117805) 3.98987 (+-0.0454973) 1.00013 (+-0.000373373)
found 6.5 (+-0.00117627) 3.98982 (+-0.045487) 1.00012 (+-0.000373289)
found 3.50001 (+-0.00117436) 3.98982 (+-0.0454782) 1.00012 (+-0.000373216)
#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()