57#if defined(__PEAKS_C_FIT_AREAS__) 
   66   TH1F *
h = 
new TH1F(
"h",
"test",500,0,1000);
 
   72   for (
p=0;
p<npeaks;
p++) {
 
   76#if defined(__PEAKS_C_FIT_AREAS__) 
   80   TF1 *
f = 
new TF1(
"f",fpeaks,0,1000,2+3*npeaks);
 
   82   f->SetParameters(par);
 
   86   h->FillRandom(
"f",200000);
 
   92   printf(
"Found %d candidate peaks to fit\n",nfound);
 
  100   TF1 *fline = 
new TF1(
"fline",
"pol1",0,1000);
 
  101   h->Fit(
"fline",
"qn");
 
  108   for (
p=0;
p<nfound;
p++) {
 
  110      Int_t bin = 
h->GetXaxis()->FindBin(xp);
 
  113      par[3*npeaks+2] = yp; 
 
  114      par[3*npeaks+3] = xp; 
 
  116#if defined(__PEAKS_C_FIT_AREAS__) 
  121   printf(
"Found %d useful peaks to fit\n",npeaks);
 
  122   printf(
"Now fitting: Be patient\n");
 
  123   TF1 *
fit = 
new TF1(
"fit",fpeaks,0,1000,2+3*npeaks);
 
  126   fit->SetParameters(par);
 
RooFitResult * fit(const char *options)
 
winID h TVirtualViewer3D TVirtualGLPainter p
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
 
R__EXTERN TRandom * gRandom
 
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
 
virtual Double_t GetParameter(Int_t ipar) const
 
1-D histogram with a float per channel (see TH1 documentation)}
 
TH1 is the base class of all histogram classes in ROOT.
 
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
 
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
 
Double_t Rndm() override
Machine independent random number generator.
 
Advanced Spectra Processing.
 
virtual TH1 * Background(const TH1 *hist, Int_t niter=20, Option_t *option="")
One-dimensional background estimation function.
 
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
One-dimensional peak search function.
 
Double_t * GetPositionX() const
 
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.
 
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.
 
Double_t Sqrt(Double_t x)
Returns the square root of x.
 
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
 
constexpr Double_t TwoPi()