created -9.7 3.98942 1
created -9.1 11.9683 3
created -8.5 15.9577 4
created -7.9 23.9365 6
created -7.3 7.97885 2
created -6.7 11.9683 3
created -6.1 19.9471 5
created -5.5 23.9365 6
created -4.9 23.9365 6
created -4.3 11.9683 3
created -3.7 7.97885 2
created -3.1 31.9154 8
created -2.5 7.97885 2
created -1.9 15.9577 4
created -1.3 27.926 7
created -0.7 31.9154 8
created -0.1 39.8942 10
created 0.5 39.8942 10
created 1.1 39.8942 10
created 1.7 23.9365 6
created 2.3 11.9683 3
created 2.9 23.9365 6
created 3.5 31.9154 8
created 4.1 15.9577 4
created 4.7 27.926 7
created 5.3 35.9048 9
created 5.9 39.8942 10
created 6.5 19.9471 5
created 7.1 15.9577 4
created 7.7 15.9577 4
created 8.3 15.9577 4
created 8.9 19.9471 5
created 9.5 23.9365 6
the total number of created peaks = 33 with sigma = 0.1
the total number of found peaks = 33 with sigma = 0.100002 (+-3.81181e-05)
fit chi^2 = 4.14708e-06
found -0.0999996 (+-0.000283389) 39.8944 (+-0.111195) 10.0002 (+-0.000912519)
found 0.5 (+-0.000283636) 39.8945 (+-0.111207) 10.0003 (+-0.00091262)
found 1.1 (+-0.000283098) 39.8943 (+-0.111181) 10.0002 (+-0.000912403)
found 5.9 (+-0.000282811) 39.8942 (+-0.111167) 10.0002 (+-0.000912289)
found 5.3 (+-0.000298817) 35.905 (+-0.105493) 9.00022 (+-0.000865729)
found -3.1 (+-0.000314336) 31.915 (+-0.0993609) 8.00005 (+-0.000815404)
found -0.699999 (+-0.000317246) 31.9156 (+-0.0994721) 8.00022 (+-0.000816317)
found 3.5 (+-0.000315975) 31.9153 (+-0.0994219) 8.00013 (+-0.000815905)
found -1.3 (+-0.000338499) 27.926 (+-0.0930253) 7.00015 (+-0.000763411)
found 4.7 (+-0.000338672) 27.9261 (+-0.0930315) 7.00017 (+-0.000763462)
found 1.7 (+-0.000366088) 23.9367 (+-0.0861398) 6.00017 (+-0.000706905)
found -7.9 (+-0.000364271) 23.9364 (+-0.0860854) 6.00008 (+-0.000706459)
found -5.5 (+-0.00036591) 23.9366 (+-0.0861328) 6.00014 (+-0.000706848)
found -4.9 (+-0.00036526) 23.9365 (+-0.086114) 6.00012 (+-0.000706694)
found 2.9 (+-0.000365708) 23.9366 (+-0.0861278) 6.00014 (+-0.000706807)
found 9.5 (+-0.000362341) 23.9366 (+-0.0860431) 6.00014 (+-0.000706112)
found 6.5 (+-0.000402049) 19.9475 (+-0.0786599) 5.00018 (+-0.000645522)
found -6.1 (+-0.000400667) 19.9472 (+-0.0786244) 5.00012 (+-0.00064523)
found 8.9 (+-0.000401078) 19.9472 (+-0.0786344) 5.00013 (+-0.000645312)
found 4.1 (+-0.000451038) 15.9582 (+-0.0703867) 4.00019 (+-0.000577628)
found 7.1 (+-0.000448891) 15.9578 (+-0.0703421) 4.00012 (+-0.000577262)
found -8.5 (+-0.000448762) 15.9578 (+-0.0703399) 4.00012 (+-0.000577244)
found -1.9 (+-0.00044847) 15.9579 (+-0.0703351) 4.00012 (+-0.000577204)
found 7.7 (+-0.000448468) 15.9578 (+-0.0703335) 4.0001 (+-0.000577191)
found 8.3 (+-0.000448891) 15.9578 (+-0.0703421) 4.00012 (+-0.000577262)
found -4.3 (+-0.000518697) 11.9685 (+-0.0609247) 3.0001 (+-0.000499978)
found 2.3 (+-0.000521167) 11.9687 (+-0.0609623) 3.00016 (+-0.000500287)
found -9.1 (+-0.000516574) 11.9683 (+-0.060893) 3.00006 (+-0.000499718)
found -6.7 (+-0.000518225) 11.9684 (+-0.0609171) 3.00009 (+-0.000499916)
found -3.69999 (+-0.000639961) 7.97926 (+-0.0497946) 2.00014 (+-0.000408639)
found -2.5 (+-0.00064088) 7.97931 (+-0.0498042) 2.00016 (+-0.000408717)
found -7.3 (+-0.000638822) 7.97916 (+-0.0497816) 2.00012 (+-0.000408533)
found -9.69999 (+-0.000899665) 3.9895 (+-0.0351795) 1.00004 (+-0.000288701)
   
 
#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()