42 Double_t result = par[0] + par[1]*x[0];
43 for (
Int_t p=0;p<npeaks;p++) {
53 TH1F *h =
new TH1F(
"h",
"test",500,0,1000);
59 for (p=0;p<npeaks;p++) {
64 TF1 *f =
new TF1(
"f",fpeaks,0,1000,2+3*npeaks);
76 printf(
"Found %d candidate peaks to fit\n",nfound);
84 TF1 *fline =
new TF1(
"fline",
"pol1",0,1000);
91 for (p=0;p<nfound;p++) {
101 printf(
"Found %d useful peaks to fit\n",npeaks);
102 printf(
"Now fitting: Be patient\n");
103 TF1 *fit =
new TF1(
"fit",fpeaks,0,1000,2+3*npeaks);
virtual void SetParameters(const Double_t *params)
virtual void SetNpx(Int_t npx=100)
Set the number of points used to draw the function.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
1-D histogram with a float per channel (see TH1 documentation)}
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
One-dimensional peak search function.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
R__EXTERN TRandom * gRandom
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculate a gaussian function with mean and sigma.
Double_t * GetPositionX() const
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual TH1 * Background(const TH1 *hist, Int_t niter=20, Option_t *option="")
One-dimensional background estimation function.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
Advanced Spectra Processing.
virtual Double_t GetParameter(Int_t ipar) const
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
Double_t Sqrt(Double_t x)
virtual void Update()
Update canvas pad buffers.
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.
double norm(double *x, double *p)