ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TF1.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Rene Brun 18/08/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 // ---------------------------------- F1.h
12 
13 #ifndef ROOT_TF1
14 #define ROOT_TF1
15 
16 
17 
18 //////////////////////////////////////////////////////////////////////////
19 // //
20 // TF1 //
21 // //
22 // The Parametric 1-D function //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #include "RConfigure.h"
27 
28 #ifndef ROOT_TFormula
29 #include "TFormula.h"
30 #endif
31 #ifndef ROOT_TAttLine
32 #include "TAttLine.h"
33 #endif
34 #ifndef ROOT_TAttFill
35 #include "TAttFill.h"
36 #endif
37 #ifndef ROOT_TAttMarker
38 #include "TAttMarker.h"
39 #endif
40 
41 #ifndef ROOT_Math_ParamFunctor
42 #include "Math/ParamFunctor.h"
43 #endif
44 
45 class TF1;
46 class TH1;
47 class TAxis;
48 class TMethodCall;
49 
50 namespace ROOT {
51  namespace Fit {
52  class FitResult;
53  }
54 }
55 
57 public:
58  TF1Parameters() {} // needed for the I/O
60  fParameters(std::vector<Double_t>(npar) ),
61  fParNames(std::vector<std::string>(npar) )
62  {
63  for (int i = 0; i < npar; ++i ){
64  fParNames[i] = std::string(TString::Format("p%d",i).Data() );
65  }
66  }
67  // copy constructor
70  fParNames(rhs.fParNames)
71  {}
72  // assignment
74  if (&rhs == this) return *this;
76  fParNames = rhs.fParNames;
77  return *this;
78  }
79  virtual ~TF1Parameters() {}
80 
81  // getter methods
82  Double_t GetParameter(Int_t iparam) const {
83  return (CheckIndex(iparam)) ? fParameters[iparam] : 0;
84  }
85  Double_t GetParameter(const char * name) const {
86  return GetParameter(GetParNumber(name) );
87  }
88  const Double_t *GetParameters() const {
89  return fParameters.data();
90  }
91  const std::vector<double> & ParamsVec() const { return fParameters; }
92 
93  Int_t GetParNumber(const char * name) const;
94 
95  const char *GetParName(Int_t iparam) const {
96  return (CheckIndex(iparam)) ? fParNames[iparam].c_str() : "";
97  }
98 
99 
100  // setter methods
102  if (!CheckIndex(iparam)) return;
103  fParameters[iparam] = value;
104  }
105  void SetParameters(const Double_t *params) {
106  std::copy(params, params + fParameters.size(), fParameters.begin() );
107  }
109  Double_t p5=0,Double_t p6=0,Double_t p7=0,Double_t p8=0,
110  Double_t p9=0,Double_t p10=0);
111 
112  void SetParameter(const char *name, Double_t value) {
113  SetParameter(GetParNumber(name),value);
114  }
115  void SetParName(Int_t iparam, const char * name) {
116  if (!CheckIndex(iparam)) return;
117  fParNames[iparam] = std::string(name);
118  }
119  void SetParNames(const char *name0="p0",const char *name1="p1",const char *name2="p2",
120  const char *name3="p3",const char*name4="p4", const char *name5="p5",
121  const char *name6="p6",const char *name7="p7",const char *name8="p8",
122  const char *name9="p9",const char *name10="p10");
123 
124 
125 
126  ClassDef(TF1Parameters,1) // The Parameters of a parameteric function
127 private:
128 
129  bool CheckIndex(Int_t i) const {
130  return (i >= 0 && i < int(fParameters.size()) );
131  }
132 
133  std::vector<Double_t> fParameters; // parameter values
134  std::vector<std::string> fParNames; // parameter names
135 };
136 
137 namespace ROOT {
138  namespace Internal {
139  /// Internal class used by TF1 for defining
140  /// template specialization for different TF1 constructors
141  template<class Func>
142  struct TF1Builder {
143  static void Build(TF1 * f, Func func);
144  };
145  }
146 }
147 
148 
149 class TF1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
150 
151  template<class Func>
153 
154 protected:
155  Double_t fXmin; //Lower bounds for the range
156  Double_t fXmax; //Upper bounds for the range
157  Int_t fNpar; //Number of parameters
158  Int_t fNdim; //Function dimension
159  Int_t fNpx; //Number of points used for the graphical representation
160  Int_t fType; //(=0 for standard functions, 1 if pointer to function)
161  Int_t fNpfits; //Number of points used in the fit
162  Int_t fNDF; //Number of degrees of freedom in the fit
163  Double_t fChisquare; //Function fit chisquare
164  Double_t fMinimum; //Minimum value for plotting
165  Double_t fMaximum; //Maximum value for plotting
166  std::vector<Double_t> fParErrors; //Array of errors of the fNpar parameters
167  std::vector<Double_t> fParMin; //Array of lower limits of the fNpar parameters
168  std::vector<Double_t> fParMax; //Array of upper limits of the fNpar parameters
169  std::vector<Double_t> fSave; //Array of fNsave function values
170  std::vector<Double_t> fIntegral; //!Integral of function binned on fNpx bins
171  std::vector<Double_t> fAlpha; //!Array alpha. for each bin in x the deconvolution r of fIntegral
172  std::vector<Double_t> fBeta; //!Array beta. is approximated by x = alpha +beta*r *gamma*r**2
173  std::vector<Double_t> fGamma; //!Array gamma.
174  TObject *fParent; //!Parent object hooking this function (if one)
175  TH1 *fHistogram; //!Pointer to histogram used for visualisation
176  TMethodCall *fMethodCall; //!Pointer to MethodCall in case of interpreted function
177  Bool_t fNormalized; //Normalization option (false by default)
178  Double_t fNormIntegral;//Integral of the function before being normalized
179  ROOT::Math::ParamFunctor fFunctor; //! Functor object to wrap any C++ callable object
180  TFormula *fFormula; //Pointer to TFormula in case when user define formula
181  TF1Parameters *fParams; //Pointer to Function parameters object (exusts only for not-formula functions)
182 
183  static Bool_t fgAbsValue; //use absolute value of function when computing integral
184  static Bool_t fgRejectPoint; //True if point must be rejected in a fit
185  static Bool_t fgAddToGlobList; //True if we want to register the function in the global list
186  static TF1 *fgCurrent; //pointer to current function being processed
187 
188 
189  //void CreateFromFunctor(const char *name, Int_t npar, Int_t ndim = 1);
190  void DoInitialize();
191 
193 
194  virtual Double_t GetMinMaxNDim(Double_t * x , Bool_t findmax, Double_t epsilon = 0, Int_t maxiter = 0) const;
195  virtual void GetRange(Double_t * xmin, Double_t * xmax) const;
196  virtual TH1 *DoCreateHistogram(Double_t xmin, Double_t xmax, Bool_t recreate = kFALSE);
197 
198  enum {
199  kNotGlobal = BIT(10), // don't register in global list of functions
200  };
201 
202 public:
203  // TF1 status bits
204  enum {
205  kNotDraw = BIT(9) // don't draw the function when in a TH1
206  };
207 
208  TF1();
209  TF1(const char *name, const char *formula, Double_t xmin=0, Double_t xmax = 1);
210  TF1(const char *name, Double_t xmin, Double_t xmax, Int_t npar,Int_t ndim = 1);
211 #ifndef __CINT__
212  TF1(const char *name, Double_t (*fcn)(Double_t *, Double_t *), Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim = 1);
213  TF1(const char *name, Double_t (*fcn)(const Double_t *, const Double_t *), Double_t xmin=0, Double_t xmax=1, Int_t npar=0,Int_t ndim = 1);
214 #endif
215 
216  // Constructors using functors (compiled mode only)
217  TF1(const char *name, ROOT::Math::ParamFunctor f, Double_t xmin = 0, Double_t xmax = 1, Int_t npar = 0,Int_t ndim = 1);
218 
219  // Template constructors from any C++ callable object, defining the operator() (double * , double *)
220  // and returning a double.
221  // The class name is not needed when using compile code, while it is required when using
222  // interpreted code via the specialized constructor with void *.
223  // An instance of the C++ function class or its pointer can both be used. The former is reccomended when using
224  // C++ compiled code, but if CINT compatibility is needed, then a pointer to the function class must be used.
225  // xmin and xmax specify the plotting range, npar is the number of parameters.
226  // See the tutorial math/exampleFunctor.C for an example of using this constructor
227  template <typename Func>
228  TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar,Int_t ndim = 1 );
229 
230  // backward compatible interface
231  template <typename Func>
232  TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, const char * ) :
233  TNamed(name,name), TAttLine(), TAttFill(), TAttMarker(),
234  fXmin(xmin), fXmax(xmax),
235  fNpar(npar), fNdim(1),
236  fNpx(100), fType(1),
237  fNpfits(0), fNDF(0), fChisquare(0),
238  fMinimum(-1111), fMaximum(-1111),
239  fParErrors(std::vector<Double_t>(npar)),
240  fParMin(std::vector<Double_t>(npar)),
241  fParMax(std::vector<Double_t>(npar)),
242  fParent(0), fHistogram(0),
243  fMethodCall(0),
245  fFunctor(ROOT::Math::ParamFunctor(f)),
246  fFormula(0),
247  fParams(new TF1Parameters(npar) )
248  {
249  DoInitialize();
250  }
251 
252 
253  // Template constructors from a pointer to any C++ class of type PtrObj with a specific member function of type
254  // MemFn.
255  // The member function must have the signature of (double * , double *) and returning a double.
256  // The class name and the method name are not needed when using compile code
257  // (the member function pointer is used in this case), while they are required when using interpreted
258  // code via the specialized constructor with void *.
259  // xmin and xmax specify the plotting range, npar is the number of parameters.
260  // See the tutorial math/exampleFunctor.C for an example of using this constructor
261  template <class PtrObj, typename MemFn>
262  TF1(const char *name, const PtrObj& p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar,Int_t ndim = 1) :
263  TNamed(name,name), TAttLine(), TAttFill(), TAttMarker(),
264  fXmin(xmin), fXmax(xmax),
265  fNpar(npar), fNdim(ndim),
266  fNpx(100), fType(1),
267  fNpfits(0), fNDF(0), fChisquare(0),
268  fMinimum(-1111), fMaximum(-1111),
269  fParErrors(std::vector<Double_t>(npar)),
270  fParMin(std::vector<Double_t>(npar)),
271  fParMax(std::vector<Double_t>(npar)),
272  fParent(0), fHistogram(0),
273  fMethodCall(0),
275  fFunctor ( ROOT::Math::ParamFunctor(p,memFn) ),
276  fFormula(0),
277  fParams(new TF1Parameters(npar) )
278  {
279  DoInitialize();
280  }
281  // backward compatible interface
282  template <class PtrObj, typename MemFn>
283  TF1(const char *name, const PtrObj& p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar,const char * , const char * ) :
284  TNamed(name,name), TAttLine(), TAttFill(), TAttMarker(),
285  fXmin(xmin), fXmax(xmax),
286  fNpar(npar), fNdim(1),
287  fNpx(100), fType(1),
288  fNpfits(0), fNDF(0), fChisquare(0),
289  fMinimum(-1111), fMaximum(-1111),
290  fParErrors(std::vector<Double_t>(npar)),
291  fParMin(std::vector<Double_t>(npar)),
292  fParMax(std::vector<Double_t>(npar)),
293  fParent(0), fHistogram(0),
294  fMethodCall(0),
296  fFunctor ( ROOT::Math::ParamFunctor(p,memFn) ),
297  fFormula(0),
298  fParams(new TF1Parameters(npar) )
299  {
300  DoInitialize();
301  }
302 
303  TF1(const TF1 &f1);
304  TF1& operator=(const TF1 &rhs);
305  virtual ~TF1();
306  virtual void AddParameter(const TString &name, Double_t value) { if (fFormula) fFormula->AddParameter(name,value); }
307  // virtual void AddParameters(const pair<TString,Double_t> *pairs, Int_t size) { fFormula->AddParameters(pairs,size); }
308  // virtual void AddVariable(const TString &name, Double_t value = 0) { if (fFormula) fFormula->AddVariable(name,value); }
309  // virtual void AddVariables(const TString *vars, Int_t size) { if (fFormula) fFormula->AddVariables(vars,size); }
310  virtual Bool_t AddToGlobalList(Bool_t on = kTRUE);
311  virtual void Browse(TBrowser *b);
312  virtual void Copy(TObject &f1) const;
313  virtual Double_t Derivative (Double_t x, Double_t *params=0, Double_t epsilon=0.001) const;
314  virtual Double_t Derivative2(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const;
315  virtual Double_t Derivative3(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const;
316  static Double_t DerivativeError();
318  virtual void Draw(Option_t *option="");
319  virtual TF1 *DrawCopy(Option_t *option="") const;
320  virtual TObject *DrawDerivative(Option_t *option="al"); // *MENU*
321  virtual TObject *DrawIntegral(Option_t *option="al"); // *MENU*
322  virtual void DrawF1(Double_t xmin, Double_t xmax, Option_t *option="");
323  virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const;
324  virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0);
325  virtual Double_t operator()(Double_t x, Double_t y=0, Double_t z = 0, Double_t t = 0) const;
326  virtual Double_t operator()(const Double_t *x, const Double_t *params=0);
327  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
328  virtual void FixParameter(Int_t ipar, Double_t value);
329  Double_t GetChisquare() const {return fChisquare;}
330  virtual TH1 *GetHistogram() const;
332  virtual TFormula *GetFormula() { return fFormula;}
333  virtual const TFormula *GetFormula() const { return fFormula;}
334  virtual TString GetExpFormula(Option_t *option="") const { return (fFormula) ? fFormula->GetExpFormula(option) : ""; }
335  virtual const TObject *GetLinearPart(Int_t i) const { return (fFormula) ? fFormula->GetLinearPart(i) : nullptr;}
336  virtual Double_t GetMaximum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon = 1.E-10, Int_t maxiter = 100, Bool_t logx = false) const;
337  virtual Double_t GetMinimum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon = 1.E-10, Int_t maxiter = 100, Bool_t logx = false) const;
338  virtual Double_t GetMaximumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon = 1.E-10, Int_t maxiter = 100, Bool_t logx = false) const;
339  virtual Double_t GetMinimumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon = 1.E-10, Int_t maxiter = 100, Bool_t logx = false) const;
340  virtual Double_t GetMaximumStored() const {return fMaximum;}
341  virtual Double_t GetMinimumStored() const {return fMinimum;}
342  virtual Int_t GetNpar() const { return fNpar;}
343  virtual Int_t GetNdim() const { return fNdim;}
344  virtual Int_t GetNDF() const;
345  virtual Int_t GetNpx() const {return fNpx;}
347  virtual Int_t GetNumber() const { return (fFormula) ? fFormula->GetNumber() : 0;}
348  virtual Int_t GetNumberFreeParameters() const;
349  virtual Int_t GetNumberFitPoints() const {return fNpfits;}
350  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
351  TObject *GetParent() const {return fParent;}
352  virtual Double_t GetParameter(Int_t ipar) const {
353  return (fFormula) ? fFormula->GetParameter(ipar) : fParams->GetParameter(ipar);
354  }
355  virtual Double_t GetParameter(const TString &name) const {
356  return (fFormula) ? fFormula->GetParameter(name) : fParams->GetParameter(name);
357  }
358  virtual Double_t *GetParameters() const {
359  return (fFormula) ? fFormula->GetParameters() : const_cast<Double_t*>(fParams->GetParameters());
360  }
361  virtual void GetParameters(Double_t *params) { if (fFormula) fFormula->GetParameters(params);
362  else std::copy(fParams->ParamsVec().begin(), fParams->ParamsVec().end(), params); }
363  virtual const char *GetParName(Int_t ipar) const {
364  return (fFormula) ? fFormula->GetParName(ipar) : fParams->GetParName(ipar);
365  }
366  virtual Int_t GetParNumber(const char* name) const {
367  return (fFormula) ? fFormula->GetParNumber(name) : fParams->GetParNumber(name);
368  }
369  virtual Double_t GetParError(Int_t ipar) const;
370  virtual const Double_t *GetParErrors() const {return fParErrors.data();}
371  virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const;
372  virtual Double_t GetProb() const;
373  virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum);
374  virtual Double_t GetRandom();
376  virtual void GetRange(Double_t &xmin, Double_t &xmax) const;
377  virtual void GetRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const;
378  virtual void GetRange(Double_t &xmin, Double_t &ymin, Double_t &zmin, Double_t &xmax, Double_t &ymax, Double_t &zmax) const;
379  virtual Double_t GetSave(const Double_t *x);
380  virtual Double_t GetX(Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon = 1.E-10, Int_t maxiter = 100, Bool_t logx = false) const;
381  virtual Double_t GetXmin() const {return fXmin;}
382  virtual Double_t GetXmax() const {return fXmax;}
383  TAxis *GetXaxis() const ;
384  TAxis *GetYaxis() const ;
385  TAxis *GetZaxis() const ;
386  virtual Double_t GetVariable(const TString &name) { return (fFormula) ? fFormula->GetVariable(name) : 0;}
387  virtual Double_t GradientPar(Int_t ipar, const Double_t *x, Double_t eps=0.01);
388  virtual void GradientPar(const Double_t *x, Double_t *grad, Double_t eps=0.01);
389  virtual void InitArgs(const Double_t *x, const Double_t *params);
390  static void InitStandardFunctions();
391  virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12);
392  virtual Double_t IntegralOneDim(Double_t a, Double_t b, Double_t epsrel, Double_t epsabs, Double_t &err);
393  virtual Double_t IntegralError(Double_t a, Double_t b, const Double_t *params=0, const Double_t *covmat=0, Double_t epsilon=1.E-2);
394  virtual Double_t IntegralError(Int_t n, const Double_t * a, const Double_t * b, const Double_t *params=0, const Double_t *covmat=0, Double_t epsilon=1.E-2);
395  // virtual Double_t IntegralFast(const TGraph *g, Double_t a, Double_t b, Double_t *params=0);
396  virtual Double_t IntegralFast(Int_t num, Double_t *x, Double_t *w, Double_t a, Double_t b, Double_t *params=0, Double_t epsilon=1e-12);
397  virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Int_t maxpts, Double_t epsrel, Double_t epsabs ,Double_t &relerr,Int_t &nfnevl, Int_t &ifail);
398  virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Int_t /*minpts*/, Int_t maxpts, Double_t epsrel, Double_t &relerr,Int_t &nfnevl, Int_t &ifail) {
399  return IntegralMultiple(n,a,b,maxpts, epsrel, epsrel, relerr, nfnevl, ifail);
400  }
401  virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Double_t epsrel, Double_t &relerr);
402  virtual Bool_t IsEvalNormalized() const { return fNormalized; }
403  /// return kTRUE if the point is inside the function range
404  virtual Bool_t IsInside(const Double_t *x) const { return !( ( x[0] < fXmin) || ( x[0] > fXmax ) ); }
405  virtual Bool_t IsLinear() const { return (fFormula) ? fFormula->IsLinear() : false;}
406  virtual Bool_t IsValid() const;
407  virtual void Print(Option_t *option="") const;
408  virtual void Paint(Option_t *option="");
409  virtual void ReleaseParameter(Int_t ipar);
410  virtual void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax);
411  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
412  virtual void SetChisquare(Double_t chi2) {fChisquare = chi2;}
413  virtual void SetFitResult(const ROOT::Fit::FitResult & result, const Int_t * indpar = 0);
414  template <class PtrObj, typename MemFn>
415  void SetFunction( PtrObj& p, MemFn memFn );
416  template <typename Func>
417  void SetFunction( Func f );
418  virtual void SetMaximum(Double_t maximum=-1111); // *MENU*
419  virtual void SetMinimum(Double_t minimum=-1111); // *MENU*
420  virtual void SetNDF(Int_t ndf);
422  virtual void SetNormalized(Bool_t flag) { fNormalized = flag; Update(); }
423  virtual void SetNpx(Int_t npx=100); // *MENU*
424  virtual void SetParameter(Int_t param, Double_t value) {
425  (fFormula) ? fFormula->SetParameter(param,value) : fParams->SetParameter(param,value);
426  Update();
427  }
428  virtual void SetParameter(const TString &name, Double_t value) {
429  (fFormula) ? fFormula->SetParameter(name,value) : fParams->SetParameter(name,value);
430  Update();
431  }
432  virtual void SetParameters(const Double_t *params) {
433  (fFormula) ? fFormula->SetParameters(params) : fParams->SetParameters(params);
434  Update();
435  }
437  Double_t p5=0,Double_t p6=0,Double_t p7=0,Double_t p8=0,
438  Double_t p9=0,Double_t p10=0) {
439  if (fFormula) fFormula->SetParameters(p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
440  else fParams->SetParameters(p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
441  Update();
442  } // *MENU*
443  virtual void SetParName(Int_t ipar, const char *name);
444  virtual void SetParNames(const char *name0="p0",const char *name1="p1",const char *name2="p2",
445  const char *name3="p3",const char *name4="p4", const char *name5="p5",
446  const char *name6="p6",const char *name7="p7",const char *name8="p8",
447  const char *name9="p9",const char *name10="p10"); // *MENU*
448  virtual void SetParError(Int_t ipar, Double_t error);
449  virtual void SetParErrors(const Double_t *errors);
450  virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax);
451  virtual void SetParent(TObject *p=0) {fParent = p;}
452  virtual void SetRange(Double_t xmin, Double_t xmax); // *MENU*
455  virtual void SetSavedPoint(Int_t point, Double_t value);
456  virtual void SetTitle(const char *title=""); // *MENU*
457  virtual void Update();
458 
459  static TF1 *GetCurrent();
460  static void AbsValue(Bool_t reject=kTRUE);
461  static void RejectPoint(Bool_t reject=kTRUE);
462  static Bool_t RejectedPoint();
463  static void SetCurrent(TF1 *f1);
464 
465  //Moments
466  virtual Double_t Moment(Double_t n, Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001);
467  virtual Double_t CentralMoment(Double_t n, Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001);
468  virtual Double_t Mean(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001) {return Moment(1,a,b,params,epsilon);}
469  virtual Double_t Variance(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001) {return CentralMoment(2,a,b,params,epsilon);}
470 
471  //some useful static utility functions to compute sampling points for Integral
472  //static void CalcGaussLegendreSamplingPoints(TGraph *g, Double_t eps=3.0e-11);
473  //static TGraph *CalcGaussLegendreSamplingPoints(Int_t num=21, Double_t eps=3.0e-11);
474  static void CalcGaussLegendreSamplingPoints(Int_t num, Double_t *x, Double_t *w, Double_t eps=3.0e-11);
475 
476  ClassDef(TF1,9) //The Parametric 1-D function
477 };
478 
479 ///ctor implementation
480 template <typename Func>
481 TF1::TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar,Int_t ndim ) :
482  TNamed(name,name), TAttLine(), TAttFill(), TAttMarker(),
483  fXmin(xmin), fXmax(xmax),
484  fNpar(npar), fNdim(ndim),
485  fNpx(100), fType(1),
486  fNpfits(0), fNDF(0), fChisquare(0),
487  fMinimum(-1111), fMaximum(-1111),
488  fParErrors(std::vector<Double_t>(npar)),
489  fParMin(std::vector<Double_t>(npar)),
490  fParMax(std::vector<Double_t>(npar)),
491  fParent(0), fHistogram(0),
492  fMethodCall(0),
493  fNormalized(false), fNormIntegral(0),
494  //fFunctor(ROOT::Math::ParamFunctor(f)),
495  fFormula(0),
496  fParams(0)
497 {
499  DoInitialize();
500 }
501 
502 namespace ROOT {
503  namespace Internal {
504 
505  template<class Func>
507  f->fType = 1;
509  f->fParams = new TF1Parameters(f->fNpar);
510  }
511  /// TF1 building from a string
512  /// used to build a TFormula based on a lambda function
513  template<>
514  struct TF1Builder<const char *> {
515  static void Build(TF1 * f, const char * formula) {
516  f->fType = 0;
517  f->fFormula = new TFormula("tf1lambda",formula,f->fNdim,f->fNpar,false);
518  TString formulaExpression(formula);
519  Ssiz_t first = formulaExpression.Index("return")+7;
520  Ssiz_t last = formulaExpression.Last(';');
521  TString title = formulaExpression( first, last-first);
522  f->SetTitle(title);
523  }
524  };
525  }
526 }
527 
528 
529 
530 
532  { return Eval(x,y,z,t); }
533 inline Double_t TF1::operator()(const Double_t *x, const Double_t *params)
534  {
535 
536  if (fMethodCall) InitArgs(x,params);
537  return EvalPar(x,params);
538  }
539 
540 
542  { TF1::SetRange(xmin, xmax); }
544  { TF1::SetRange(xmin, xmax); }
545 
546 template <typename Func>
548  // set function from a generic C++ callable object
549  fType = 1;
551 }
552 template <class PtrObj, typename MemFn>
553 void TF1::SetFunction( PtrObj& p, MemFn memFn ) {
554  // set from a pointer to a member function
555  fType = 1;
557 }
558 
559 
560 
561 
562 #endif
const std::vector< double > & ParamsVec() const
Definition: TF1.h:91
ROOT::Math::ParamFunctor fFunctor
Definition: TF1.h:179
Double_t fMaximum
Definition: TF1.h:165
virtual void SetParameters(Double_t p0, Double_t p1, Double_t p2=0, Double_t p3=0, Double_t p4=0, Double_t p5=0, Double_t p6=0, Double_t p7=0, Double_t p8=0, Double_t p9=0, Double_t p10=0)
Definition: TF1.h:436
virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum)
Compute Quantiles for density distribution of this function.
Definition: TF1.cxx:1669
TF1Parameters(Int_t npar)
Definition: TF1.h:59
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:851
virtual void AddParameter(const TString &name, Double_t value)
Definition: TF1.h:306
virtual void SetParameters(const Double_t *params)
Definition: TF1.h:432
virtual Double_t GetRandom()
Return a random number following this function shape.
Definition: TF1.cxx:1762
Int_t fNpx
Definition: TF1.h:159
Bool_t fNormalized
Pointer to MethodCall in case of interpreted function.
Definition: TF1.h:177
float xmin
Definition: THbookFile.cxx:93
const char * GetParName(Int_t iparam) const
Definition: TF1.h:95
void grad()
Definition: grad.C:17
virtual TFormula * GetFormula()
Definition: TF1.h:332
virtual void SetNpx(Int_t npx=100)
Set the number of points used to draw the function.
Definition: TF1.cxx:3116
virtual void ReleaseParameter(Int_t ipar)
Release parameter number ipar If used in a fit, the parameter can vary freely.
Definition: TF1.cxx:2820
void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
Definition: Ifit.C:26
static double p3(double t, double a, double b, double c, double d)
virtual void SetParName(Int_t ipar, const char *name)
Set name of parameter number ipar.
Definition: TF1.cxx:3134
virtual void SetParNames(const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
Set up to 10 parameter names.
Definition: TF1.cxx:3147
virtual Int_t GetNumberFreeParameters() const
Return the number of free parameters.
Definition: TF1.cxx:1579
const char Option_t
Definition: RtypesCore.h:62
float ymin
Definition: THbookFile.cxx:93
virtual Int_t GetNumberFitPoints() const
Definition: TF1.h:349
virtual const char * GetParName(Int_t ipar) const
Definition: TF1.h:363
void SetParameters(const Double_t *params)
#define BIT(n)
Definition: Rtypes.h:120
virtual const TObject * GetLinearPart(Int_t i) const
Definition: TF1.h:335
virtual Double_t IntegralFast(Int_t num, Double_t *x, Double_t *w, Double_t a, Double_t b, Double_t *params=0, Double_t epsilon=1e-12)
Gauss-Legendre integral, see CalcGaussLegendreSamplingPoints.
Definition: TF1.cxx:2481
static TF1 * GetCurrent()
Static function returning the current function being processed.
Definition: TF1.cxx:1265
Int_t fNpar
Definition: TF1.h:157
TObject * fParent
Array gamma.
Definition: TF1.h:174
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
Definition: TF1.cxx:3200
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TF1.cxx:1237
Double_t fChisquare
Definition: TF1.h:163
virtual void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
Save values of function in array fSave.
Definition: TF1.cxx:2830
virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Int_t maxpts, Double_t epsrel, Double_t epsabs, Double_t &relerr, Int_t &nfnevl, Int_t &ifail)
This function computes, to an attempted specified accuracy, the value of the integral.
Definition: TF1.cxx:2556
std::vector< std::string > fParNames
Definition: TF1.h:134
Basic string class.
Definition: TString.h:137
virtual void SetNumberFitPoints(Int_t npfits)
Definition: TF1.h:421
static Double_t DerivativeError()
Static function returning the error of the last call to the of Derivative's functions.
Definition: TF1.cxx:996
Double_t fNormIntegral
Definition: TF1.h:178
int Int_t
Definition: RtypesCore.h:41
void SetParameter(const char *name, Double_t value)
Definition: TF1.h:112
bool Bool_t
Definition: RtypesCore.h:59
TObject * GetParent() const
Definition: TF1.h:351
TArc * a
Definition: textangle.C:12
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Definition: TF1.cxx:1608
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
Definition: TF1.cxx:1052
void SetFunction(PtrObj &p, MemFn memFn)
Definition: TF1.h:553
Int_t GetParNumber(const char *name) const
virtual Double_t Derivative2(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const
Returns the second derivative of the function at point x, computed by Richardson's extrapolation meth...
Definition: TF1.cxx:895
Internal class used by TF1 for defining template specialization for different TF1 constructors...
Definition: TF1.h:142
void IntegrateForNormalization()
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum value along Y for this function In case the function is already drawn, set also the minimum in the helper histogram.
Definition: TF1.cxx:3090
Float_t py
Definition: hprod.C:33
const Double_t * GetParameters() const
Definition: TF1.h:88
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
Definition: TF1.cxx:2241
virtual void SetNormalized(Bool_t flag)
Definition: TF1.h:422
virtual TObject * DrawIntegral(Option_t *option="al")
Draw integral of this function.
Definition: TF1.cxx:1127
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
Definition: TIterator.cxx:21
virtual Int_t GetNDF() const
Return the number of degrees of freedom in the fit the fNDF parameter has been previously computed du...
Definition: TF1.cxx:1568
virtual Double_t GetXmin() const
Definition: TF1.h:381
TFile * f
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to vusualize the function.
Definition: TF1.cxx:1274
static void SetCurrent(TF1 *f1)
Static function setting the current function.
Definition: TF1.cxx:3026
virtual Double_t GetMinMaxNDim(Double_t *x, Bool_t findmax, Double_t epsilon=0, Int_t maxiter=0) const
Find the minimum of a function of whatever dimension.
Definition: TF1.cxx:1404
TF1 Parameters class.
Definition: TF1.h:56
TMethodCall * GetMethodCall() const
Definition: TF1.h:346
virtual Int_t GetParNumber(const char *name) const
Definition: TF1.h:366
Marker Attributes class.
Definition: TAttMarker.h:32
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a function.
Definition: TF1.cxx:1012
const TObject * GetLinearPart(Int_t i) const
virtual Double_t GetMinimumStored() const
Definition: TF1.h:341
virtual Double_t GetMaximumStored() const
Definition: TF1.h:340
virtual void SetParent(TObject *p=0)
Definition: TF1.h:451
virtual Double_t Moment(Double_t n, Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Return nth moment of function between a and b.
Definition: TF1.cxx:3386
TFormula * fFormula
Functor object to wrap any C++ callable object.
Definition: TF1.h:180
Fill Area Attributes class.
Definition: TAttFill.h:32
Double_t x[n]
Definition: legend1.C:17
virtual Bool_t IsValid() const
Return kTRUE if the function is valid.
Definition: TF1.cxx:2586
#define ClassDef(name, id)
Definition: Rtypes.h:254
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2321
Double_t GetChisquare() const
Definition: TF1.h:329
virtual TString GetExpFormula(Option_t *option="") const
Definition: TF1.h:334
const char * GetParName(Int_t ipar) const
Int_t fNpfits
Definition: TF1.h:161
Int_t fNdim
Definition: TF1.h:158
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Double_t GetVariable(const TString &name)
Definition: TF1.h:386
virtual void GetParameters(Double_t *params)
Definition: TF1.h:361
virtual void DrawF1(Double_t xmin, Double_t xmax, Option_t *option="")
Draw function between xmin and xmax.
Definition: TF1.cxx:1143
void SetParameter(const char *name, Double_t value)
Definition: TFormula.cxx:2271
static double p2(double t, double a, double b, double c)
virtual void Copy(TObject &f1) const
Copy this F1 to a new F1.
Definition: TF1.cxx:736
TF1()
TF1 default constructor.
Definition: TF1.cxx:392
void SetParameters(const Double_t *params)
Definition: TF1.h:105
std::vector< std::vector< double > > Data
TString GetExpFormula(Option_t *option="") const
virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Int_t, Int_t maxpts, Double_t epsrel, Double_t &relerr, Int_t &nfnevl, Int_t &ifail)
Definition: TF1.h:398
ClassDef(TAttLine, 2)
virtual Bool_t IsLinear() const
Definition: TF1.h:405
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
Definition: TF1.cxx:1953
Method or function calling interface.
Definition: TMethodCall.h:41
Float_t z[5]
Definition: Ifit.C:16
virtual Double_t GetXmax() const
Definition: TF1.h:382
char * out
Definition: TBase64.cxx:29
ClassDef(TF1Parameters, 1) private std::vector< Double_t > fParameters
Definition: TF1.h:126
Double_t GetParameter(const char *name) const
Definition: TF1.h:85
virtual const Double_t * GetParErrors() const
Definition: TF1.h:370
TF1Parameters & operator=(const TF1Parameters &rhs)
Definition: TF1.h:73
std::vector< Double_t > fIntegral
Definition: TF1.h:170
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
Definition: TF1.cxx:1618
virtual Double_t GradientPar(Int_t ipar, const Double_t *x, Double_t eps=0.01)
Compute the gradient (derivative) wrt a parameter ipar.
Definition: TF1.cxx:2117
static Bool_t fgAbsValue
Definition: TF1.h:183
static TF1 * fgCurrent
Definition: TF1.h:186
Double_t * GetParameters() const
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual void SetChisquare(Double_t chi2)
Definition: TF1.h:412
TThread * t[5]
Definition: threadsh1.C:13
float ymax
Definition: THbookFile.cxx:93
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
Definition: TF1.cxx:3183
static Bool_t fgRejectPoint
Definition: TF1.h:184
TF1Parameters()
Definition: TF1.h:58
TH1 * fHistogram
Parent object hooking this function (if one)
Definition: TF1.h:175
Double_t GetParameter(Int_t iparam) const
Definition: TF1.h:82
Class to manage histogram axis.
Definition: TAxis.h:36
IParamFunction interface (abstract class) describing multi-dimensional parameteric functions It is a ...
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
The F O R M U L A class.
Definition: TFormula.h:89
virtual void SetParError(Int_t ipar, Double_t error)
Set error for parameter number ipar.
Definition: TF1.cxx:3158
void DoInitialize()
Common initialization of the TF1.
Definition: TF1.cxx:606
virtual const TFormula * GetFormula() const
Definition: TF1.h:333
virtual Int_t GetNdim() const
Definition: TF1.h:343
virtual void FixParameter(Int_t ipar, Double_t value)
Fix the value of a parameter The specified value will be used in a fit operation. ...
Definition: TF1.cxx:1253
Int_t fType
Definition: TF1.h:160
bool first
Definition: line3Dfit.C:48
Double_t E()
Definition: TMath.h:54
tuple w
Definition: qtexample.py:51
Double_t fMinimum
Definition: TF1.h:164
static void RejectPoint(Bool_t reject=kTRUE)
Static function to set the global flag to reject points the fgRejectPoint global flag is tested by al...
Definition: TF1.cxx:3367
static void InitStandardFunctions()
Create the basic function objects.
Definition: TF1.cxx:2213
float xmax
Definition: THbookFile.cxx:93
static double p1(double t, double a, double b)
virtual Bool_t IsEvalNormalized() const
Definition: TF1.h:402
virtual void Update()
Called by functions such as SetRange, SetNpx, SetParameters to force the deletion of the associated h...
Definition: TF1.cxx:3337
virtual ~TF1()
TF1 default destructor.
Definition: TF1.cxx:674
virtual Double_t GetProb() const
Return the fit probability.
Definition: TF1.cxx:1633
Double_t GetVariable(const char *name) const
Definition: TFormula.cxx:2061
virtual void SetParameter(const TString &name, Double_t value)
Definition: TF1.h:428
virtual TH1 * DoCreateHistogram(Double_t xmin, Double_t xmax, Bool_t recreate=kFALSE)
Create histogram with bin content equal to function value computed at the bin center This histogram w...
Definition: TF1.cxx:2727
TF1(const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim=1)
Definition: TF1.h:262
REAL epsilon
Definition: triangle.c:617
TAxis * GetYaxis() const
Get y axis of the function.
Definition: TF1.cxx:2083
void SetParameter(Int_t iparam, Double_t value)
Definition: TF1.h:101
virtual Double_t Mean(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Definition: TF1.h:468
static void CalcGaussLegendreSamplingPoints(Int_t num, Double_t *x, Double_t *w, Double_t eps=3.0e-11)
Type safe interface (static method) The number of sampling points are taken from the TGraph...
Definition: TF1.cxx:3509
PyObject * fType
virtual Double_t GetMinimum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the minimum value of the function on the (xmin, xmax) interval.
Definition: TF1.cxx:1380
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum value along Y for this function In case the function is already drawn, set also the maximum in the helper histogram.
Definition: TF1.cxx:3077
virtual void SetTitle(const char *title="")
Set function title if title has the form "fffffff;xxxx;yyyy", it is assumed that the function title i...
Definition: TF1.cxx:3227
virtual Int_t GetNpx() const
Definition: TF1.h:345
virtual Double_t Derivative(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const
Returns the first derivative of the function at point x, computed by Richardson's extrapolation metho...
Definition: TF1.cxx:829
int Ssiz_t
Definition: RtypesCore.h:63
class containg the result of the fit and all the related information (fitted parameter values...
Definition: FitResult.h:52
Int_t fNDF
Definition: TF1.h:162
TF1(const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, const char *, const char *)
Definition: TF1.h:283
double Double_t
Definition: RtypesCore.h:55
std::vector< Double_t > fSave
Definition: TF1.h:169
virtual Double_t GetX(Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the X value corresponding to the function value fy for (xmin<x<xmax).
Definition: TF1.cxx:1545
Int_t GetNumber() const
Definition: TFormula.h:179
std::vector< Double_t > fParErrors
Definition: TF1.h:166
Bool_t IsLinear() const
Definition: TFormula.h:190
Double_t fXmin
Definition: TF1.h:155
virtual Double_t GetMaximum(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the maximum value of the function.
Definition: TF1.cxx:1304
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:133
virtual Double_t Derivative3(Double_t x, Double_t *params=0, Double_t epsilon=0.001) const
Returns the third derivative of the function at point x, computed by Richardson's extrapolation metho...
Definition: TF1.cxx:961
virtual void Print(Option_t *option="") const
Print TNamed name and title.
Definition: TF1.cxx:2600
void SetParName(Int_t iparam, const char *name)
Definition: TF1.h:115
static Bool_t fgAddToGlobList
Definition: TF1.h:185
void AddParameter(const TString &name, Double_t value=0)
Definition: TFormula.h:164
Double_t y[n]
Definition: legend1.C:17
std::vector< Double_t > fGamma
Array beta. is approximated by x = alpha +beta*r *gamma*r**2.
Definition: TF1.h:173
double func(double *x, double *p)
Definition: stressTF1.cxx:213
virtual Double_t Variance(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Definition: TF1.h:469
The TH1 histogram class.
Definition: TH1.h:80
TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, const char *)
Definition: TF1.h:232
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TF1.cxx:2881
std::vector< Double_t > fAlpha
Integral of function binned on fNpx bins.
Definition: TF1.h:171
virtual Int_t GetNumber() const
Definition: TF1.h:347
Int_t GetParNumber(const char *name) const
Returns the parameter number given a name not very efficient but list of parameters is typically smal...
Definition: TF1.cxx:3529
virtual void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
Definition: TF1.cxx:2198
std::vector< Double_t > fBeta
Array alpha. for each bin in x the deconvolution r of fIntegral.
Definition: TF1.h:172
TAxis * GetZaxis() const
Get z axis of the function. (In case this object is a TF2 or TF3)
Definition: TF1.cxx:2094
void SetParNames(const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
Set parameter names.
Definition: TF1.cxx:3561
virtual Double_t GetSave(const Double_t *x)
Get value corresponding to X in array of fSave values.
Definition: TF1.cxx:2016
virtual Double_t GetParameter(Int_t ipar) const
Definition: TF1.h:352
TAxis * GetXaxis() const
Get x axis of the function.
Definition: TF1.cxx:2072
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Double_t * GetParameters() const
Definition: TF1.h:358
Float_t px
Definition: hprod.C:33
TMethodCall * fMethodCall
Pointer to histogram used for visualisation.
Definition: TF1.h:176
virtual TH1 * CreateHistogram()
Definition: TF1.h:331
virtual Double_t IntegralOneDim(Double_t a, Double_t b, Double_t epsrel, Double_t epsabs, Double_t &err)
Return Integral of function between a and b using the given parameter values and relative and absolut...
Definition: TF1.cxx:2330
virtual Double_t GetMaximumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the X value corresponding to the maximum value of the function.
Definition: TF1.cxx:1342
virtual Double_t operator()(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Definition: TF1.h:531
virtual ~TF1Parameters()
Definition: TF1.h:79
static void Build(TF1 *f, Func func)
Definition: TF1.h:506
static Bool_t RejectedPoint()
See TF1::RejectPoint above.
Definition: TF1.cxx:3376
virtual void SetParErrors(const Double_t *errors)
Set errors for all active parameters when calling this function, the array errors must have at least ...
Definition: TF1.cxx:3169
virtual Double_t GetParameter(const TString &name) const
Definition: TF1.h:355
virtual Bool_t AddToGlobalList(Bool_t on=kTRUE)
Add to global list of functions (gROOT->GetListOfFunctions() ) return previous status (true of functi...
Definition: TF1.cxx:630
1-Dim function class
Definition: TF1.h:149
virtual void SetSavedPoint(Int_t point, Double_t value)
Restore value of function saved at point.
Definition: TF1.cxx:3211
virtual void SetFitResult(const ROOT::Fit::FitResult &result, const Int_t *indpar=0)
Set the result from the fit parameter values, errors, chi2, etc...
Definition: TF1.cxx:3038
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
Definition: TF1.cxx:1162
TF1 * f1
Definition: legend1.C:11
Param Functor class for Multidimensional functions.
Definition: ParamFunctor.h:209
static void Build(TF1 *f, const char *formula)
Definition: TF1.h:515
TF1Parameters * fParams
Definition: TF1.h:181
static void AbsValue(Bool_t reject=kTRUE)
Static function: set the fgAbsValue flag.
Definition: TF1.cxx:715
virtual void SetNDF(Int_t ndf)
Set the number of degrees of freedom ndf should be the number of points used in a fit - the number of...
Definition: TF1.cxx:3102
virtual Double_t GetMinimumX(Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
Returns the X value corresponding to the minimum value of the function on the (xmin, xmax) interval.
Definition: TF1.cxx:1508
std::vector< double > errors
Definition: TwoHistoFit2D.C:33
virtual Double_t IntegralError(Double_t a, Double_t b, const Double_t *params=0, const Double_t *covmat=0, Double_t epsilon=1.E-2)
Return Error on Integral of a parameteric function between a and b due to the parameter uncertainties...
Definition: TF1.cxx:2422
double result[121]
TF1 & operator=(const TF1 &rhs)
Operator =.
Definition: TF1.cxx:662
virtual void SetParameter(Int_t param, Double_t value)
Definition: TF1.h:424
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:582
virtual Bool_t IsInside(const Double_t *x) const
return kTRUE if the point is inside the function range
Definition: TF1.h:404
std::vector< Double_t > fParMax
Definition: TF1.h:168
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Redefines TObject::GetObjectInfo.
Definition: TF1.cxx:1596
virtual Double_t CentralMoment(Double_t n, Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Return nth central moment of function between a and b (i.e the n-th moment around the mean value) ...
Definition: TF1.cxx:3422
const Bool_t kTRUE
Definition: Rtypes.h:91
float * q
Definition: THbookFile.cxx:87
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
Definition: TF1.cxx:1192
virtual void Browse(TBrowser *b)
Browse.
Definition: TF1.cxx:724
float value
Definition: math.cpp:443
Bool_t reject
Definition: fitExclude.C:7
std::vector< Double_t > fParMin
Definition: TF1.h:167
const Int_t n
Definition: legend1.C:16
Line Attributes class.
Definition: TAttLine.h:32
Double_t fXmax
Definition: TF1.h:156
virtual Int_t GetNpar() const
Definition: TF1.h:342
Double_t GetParameter(const char *name) const
Int_t npfits
Definition: fit2dHist.C:46
virtual void Paint(Option_t *option="")
Paint this function with its current attributes.
Definition: TF1.cxx:2649
virtual TObject * DrawDerivative(Option_t *option="al")
Draw derivative of this function.
Definition: TF1.cxx:1102
virtual TF1 * DrawCopy(Option_t *option="") const
Draw a copy of this function with its current attributes.
Definition: TF1.cxx:1080
TF1Parameters(const TF1Parameters &rhs)
Definition: TF1.h:68