Logo ROOT   6.10/09
Reference Guide
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 // TF1 //
19 // //
20 // The Parametric 1-D function //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "RConfigure.h"
25 #include <functional>
26 #include "TFormula.h"
27 #include "TAttLine.h"
28 #include "TAttFill.h"
29 #include "TAttMarker.h"
30 
31 #include "Math/ParamFunctor.h"
32 
33 class TF1;
34 class TH1;
35 class TAxis;
36 class TMethodCall;
37 
38 namespace ROOT {
39  namespace Fit {
40  class FitResult;
41  }
42 }
43 
45 public:
46  TF1Parameters() {} // needed for the I/O
48  fParameters(std::vector<Double_t>(npar)),
49  fParNames(std::vector<std::string>(npar))
50  {
51  for (int i = 0; i < npar; ++i) {
52  fParNames[i] = std::string(TString::Format("p%d", i).Data());
53  }
54  }
55  // copy constructor
57  fParameters(rhs.fParameters),
58  fParNames(rhs.fParNames)
59  {}
60  // assignment
62  {
63  if (&rhs == this) return *this;
64  fParameters = rhs.fParameters;
65  fParNames = rhs.fParNames;
66  return *this;
67  }
68  virtual ~TF1Parameters() {}
69 
70  // getter methods
71  Double_t GetParameter(Int_t iparam) const
72  {
73  return (CheckIndex(iparam)) ? fParameters[iparam] : 0;
74  }
75  Double_t GetParameter(const char *name) const
76  {
77  return GetParameter(GetParNumber(name));
78  }
79  const Double_t *GetParameters() const
80  {
81  return fParameters.data();
82  }
83  const std::vector<double> &ParamsVec() const
84  {
85  return fParameters;
86  }
87 
88  Int_t GetParNumber(const char *name) const;
89 
90  const char *GetParName(Int_t iparam) const
91  {
92  return (CheckIndex(iparam)) ? fParNames[iparam].c_str() : "";
93  }
94 
95 
96  // setter methods
97  void SetParameter(Int_t iparam, Double_t value)
98  {
99  if (!CheckIndex(iparam)) return;
100  fParameters[iparam] = value;
101  }
102  void SetParameters(const Double_t *params)
103  {
104  std::copy(params, params + fParameters.size(), fParameters.begin());
105  }
106  void SetParameters(Double_t p0, Double_t p1, Double_t p2 = 0, Double_t p3 = 0, Double_t p4 = 0,
107  Double_t p5 = 0, Double_t p6 = 0, Double_t p7 = 0, Double_t p8 = 0,
108  Double_t p9 = 0, Double_t p10 = 0);
109 
110  void SetParameter(const char *name, Double_t value)
111  {
112  SetParameter(GetParNumber(name), value);
113  }
114  void SetParName(Int_t iparam, const char *name)
115  {
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  {
131  return (i >= 0 && i < int(fParameters.size()));
132  }
133 
134  std::vector<Double_t> fParameters; // parameter values
135  std::vector<std::string> fParNames; // parameter names
136 };
137 
138 namespace ROOT {
139  namespace Internal {
140  /// Internal class used by TF1 for defining
141  /// template specialization for different TF1 constructors
142  template<class Func>
143  struct TF1Builder {
144  static void Build(TF1 *f, Func func);
145  };
146  }
147 }
148 
149 
150 class TF1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
151 
152  template<class Func>
154 
155 public:
156  // Add to list behavior
157  enum class EAddToList {
158  kDefault,
159  kAdd,
160  kNo
161  };
162 
163 protected:
164  Double_t fXmin; //Lower bounds for the range
165  Double_t fXmax; //Upper bounds for the range
166  Int_t fNpar; //Number of parameters
167  Int_t fNdim; //Function dimension
168  Int_t fNpx; //Number of points used for the graphical representation
169  Int_t fType; //(=0 for standard functions, 1 if pointer to function, 3 vectorized interface)
170  Int_t fNpfits; //Number of points used in the fit
171  Int_t fNDF; //Number of degrees of freedom in the fit
172  Double_t fChisquare; //Function fit chisquare
173  Double_t fMinimum; //Minimum value for plotting
174  Double_t fMaximum; //Maximum value for plotting
175  std::vector<Double_t> fParErrors; //Array of errors of the fNpar parameters
176  std::vector<Double_t> fParMin; //Array of lower limits of the fNpar parameters
177  std::vector<Double_t> fParMax; //Array of upper limits of the fNpar parameters
178  std::vector<Double_t> fSave; //Array of fNsave function values
179  std::vector<Double_t> fIntegral; //!Integral of function binned on fNpx bins
180  std::vector<Double_t> fAlpha; //!Array alpha. for each bin in x the deconvolution r of fIntegral
181  std::vector<Double_t> fBeta; //!Array beta. is approximated by x = alpha +beta*r *gamma*r**2
182  std::vector<Double_t> fGamma; //!Array gamma.
183  TObject *fParent; //!Parent object hooking this function (if one)
184  TH1 *fHistogram; //!Pointer to histogram used for visualisation
185  TMethodCall *fMethodCall; //!Pointer to MethodCall in case of interpreted function
186  Bool_t fNormalized; //Normalization option (false by default)
187  Double_t fNormIntegral;//Integral of the function before being normalized
188  ROOT::Math::ParamFunctor fFunctor; //! Functor object to wrap any C++ callable object
189  TFormula *fFormula; //Pointer to TFormula in case when user define formula
190  TF1Parameters *fParams; //Pointer to Function parameters object (exusts only for not-formula functions)
191 
192 public:
193 
195 
196  template<class T>
198  TF1FunctionPointerImpl(const std::function<T(const T *f, const Double_t *param)> &&func): fimpl(func) {};
199  std::function<T(const T *f, const Double_t *param)> fimpl;
200  };
201 
202  TF1FunctionPointer *fFunctp = nullptr; //!Pointer to vectorized function
203 
204  static std::atomic<Bool_t> fgAbsValue; //use absolute value of function when computing integral
205  static Bool_t fgRejectPoint; //True if point must be rejected in a fit
206  static std::atomic<Bool_t> fgAddToGlobList; //True if we want to register the function in the global list
207  static TF1 *fgCurrent; //pointer to current function being processed
208 
209 
210  //void CreateFromFunctor(const char *name, Int_t npar, Int_t ndim = 1);
211  void DoInitialize(EAddToList addToGlobList);
212 
213  void IntegrateForNormalization();
214 
215  virtual Double_t GetMinMaxNDim(Double_t *x , Bool_t findmax, Double_t epsilon = 0, Int_t maxiter = 0) const;
216  virtual void GetRange(Double_t *xmin, Double_t *xmax) const;
217  virtual TH1 *DoCreateHistogram(Double_t xmin, Double_t xmax, Bool_t recreate = kFALSE);
218 
219  enum {
220  kNotGlobal = BIT(10), // don't register in global list of functions
221  };
222 
223  // TF1 status bits
224  enum {
225  kNotDraw = BIT(9) // don't draw the function when in a TH1
226  };
227 
228  TF1();
229  TF1(const char *name, const char *formula, Double_t xmin = 0, Double_t xmax = 1, EAddToList addToGlobList = EAddToList::kDefault);
230  TF1(const char *name, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim = 1, EAddToList addToGlobList = EAddToList::kDefault);
231  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, EAddToList addToGlobList = EAddToList::kDefault);
232  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, EAddToList addToGlobList = EAddToList::kDefault);
233 
234  template<class T>
235  TF1(const char *name, std::function<T(const T *data, const Double_t *param)> *fcn, Double_t xmin = 0, Double_t xmax = 1, Int_t npar = 0, Int_t ndim = 1, EAddToList addToGlobList = EAddToList::kDefault):
236 // TF1(const char *name, (T(*)(const T*, Double_t * param)) * fcn, Double_t xmin=0, Double_t xmax=1, Int_t npar=0,Int_t ndim = 1):
237  TNamed(name, name), TAttLine(), TAttFill(), TAttMarker(),
238  fXmin(xmin), fXmax(xmax),
239  fNpar(npar), fNdim(ndim),
240  fNpx(100), fType(3),
241  fNpfits(0), fNDF(0), fChisquare(0),
242  fMinimum(-1111), fMaximum(-1111),
243  fParErrors(std::vector<Double_t>(npar)),
244  fParMin(std::vector<Double_t>(npar)),
245  fParMax(std::vector<Double_t>(npar)),
246  fParent(0), fHistogram(0),
247  fMethodCall(0),
248  fNormalized(false), fNormIntegral(0),
249  fFormula(0),
250  fParams(new TF1Parameters(npar))
251  {
252  DoInitialize(addToGlobList);
253  fFunctp = new TF1FunctionPointerImpl<T>(fcn);
254  }
255 
256  template<class T>
257  TF1(const char *name, T(*fcn)(const T *, const Double_t *), Double_t xmin = 0, Double_t xmax = 1, Int_t npar = 0, Int_t ndim = 1, EAddToList addToGlobList = EAddToList::kDefault):
258 // TF1(const char *name, (T(*)(const T*, Double_t * param)) * fcn, Double_t xmin=0, Double_t xmax=1, Int_t npar=0,Int_t ndim = 1):
259  TNamed(name, name), TAttLine(), TAttFill(), TAttMarker(),
260  fXmin(xmin), fXmax(xmax),
261  fNpar(npar), fNdim(ndim),
262  fNpx(100), fType(3),
263  fNpfits(0), fNDF(0), fChisquare(0),
264  fMinimum(-1111), fMaximum(-1111),
265  fParErrors(std::vector<Double_t>(npar)),
266  fParMin(std::vector<Double_t>(npar)),
267  fParMax(std::vector<Double_t>(npar)),
268  fParent(0), fHistogram(0),
269  fMethodCall(0),
270  fNormalized(false), fNormIntegral(0),
271  fFormula(0),
272  fParams(new TF1Parameters(npar))
273  {
274  DoInitialize(addToGlobList);
275  fFunctp = new TF1FunctionPointerImpl<T>(fcn);
276  }
277 
278  // Constructors using functors (compiled mode only)
279  TF1(const char *name, ROOT::Math::ParamFunctor f, Double_t xmin = 0, Double_t xmax = 1, Int_t npar = 0, Int_t ndim = 1, EAddToList addToGlobList = EAddToList::kDefault);
280 
281  // Template constructors from any C++ callable object, defining the operator() (double * , double *)
282  // and returning a double.
283  // The class name is not needed when using compile code, while it is required when using
284  // interpreted code via the specialized constructor with void *.
285  // An instance of the C++ function class or its pointer can both be used. The former is reccomended when using
286  // C++ compiled code, but if CINT compatibility is needed, then a pointer to the function class must be used.
287  // xmin and xmax specify the plotting range, npar is the number of parameters.
288  // See the tutorial math/exampleFunctor.C for an example of using this constructor
289  template <typename Func>
290  TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim = 1, EAddToList addToGlobList = EAddToList::kDefault);
291 
292  // backward compatible interface
293  template <typename Func>
294  TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, const char *, EAddToList addToGlobList = EAddToList::kDefault) :
295  TNamed(name, name), TAttLine(), TAttFill(), TAttMarker(),
296  fXmin(xmin), fXmax(xmax),
297  fNpar(npar), fNdim(1),
298  fNpx(100), fType(1),
299  fNpfits(0), fNDF(0), fChisquare(0),
300  fMinimum(-1111), fMaximum(-1111),
301  fParErrors(std::vector<Double_t>(npar)),
302  fParMin(std::vector<Double_t>(npar)),
303  fParMax(std::vector<Double_t>(npar)),
304  fParent(0), fHistogram(0),
305  fMethodCall(0),
306  fNormalized(false), fNormIntegral(0),
307  fFunctor(ROOT::Math::ParamFunctor(f)),
308  fFormula(0),
309  fParams(new TF1Parameters(npar))
310  {
311  DoInitialize(addToGlobList);
312  }
313 
314 
315  // Template constructors from a pointer to any C++ class of type PtrObj with a specific member function of type
316  // MemFn.
317  // The member function must have the signature of (double * , double *) and returning a double.
318  // The class name and the method name are not needed when using compile code
319  // (the member function pointer is used in this case), while they are required when using interpreted
320  // code via the specialized constructor with void *.
321  // xmin and xmax specify the plotting range, npar is the number of parameters.
322  // See the tutorial math/exampleFunctor.C for an example of using this constructor
323  template <class PtrObj, typename MemFn>
324  TF1(const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim = 1, EAddToList addToGlobList = EAddToList::kDefault) :
325  TNamed(name, name), TAttLine(), TAttFill(), TAttMarker(),
326  fXmin(xmin), fXmax(xmax),
327  fNpar(npar), fNdim(ndim),
328  fNpx(100), fType(1),
329  fNpfits(0), fNDF(0), fChisquare(0),
330  fMinimum(-1111), fMaximum(-1111),
331  fParErrors(std::vector<Double_t>(npar)),
332  fParMin(std::vector<Double_t>(npar)),
333  fParMax(std::vector<Double_t>(npar)),
334  fParent(0), fHistogram(0),
335  fMethodCall(0),
336  fNormalized(false), fNormIntegral(0),
337  fFunctor(ROOT::Math::ParamFunctor(p, memFn)),
338  fFormula(0),
339  fParams(new TF1Parameters(npar))
340  {
341  DoInitialize(addToGlobList);
342  }
343  // backward compatible interface
344  template <class PtrObj, typename MemFn>
345  TF1(const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, const char *, const char *, EAddToList addToGlobList = EAddToList::kDefault) :
346  TNamed(name, name), TAttLine(), TAttFill(), TAttMarker(),
347  fXmin(xmin), fXmax(xmax),
348  fNpar(npar), fNdim(1),
349  fNpx(100), fType(1),
350  fNpfits(0), fNDF(0), fChisquare(0),
351  fMinimum(-1111), fMaximum(-1111),
352  fParErrors(std::vector<Double_t>(npar)),
353  fParMin(std::vector<Double_t>(npar)),
354  fParMax(std::vector<Double_t>(npar)),
355  fParent(0), fHistogram(0),
356  fMethodCall(0),
357  fNormalized(false), fNormIntegral(0),
358  fFunctor(ROOT::Math::ParamFunctor(p, memFn)),
359  fFormula(0),
360  fParams(new TF1Parameters(npar))
361  {
362  DoInitialize(addToGlobList);
363  }
364 
365  TF1(const TF1 &f1);
366  TF1 &operator=(const TF1 &rhs);
367  virtual ~TF1();
368  virtual void AddParameter(const TString &name, Double_t value)
369  {
370  if (fFormula) fFormula->AddParameter(name, value);
371  }
372  // virtual void AddParameters(const pair<TString,Double_t> *pairs, Int_t size) { fFormula->AddParameters(pairs,size); }
373  // virtual void AddVariable(const TString &name, Double_t value = 0) { if (fFormula) fFormula->AddVariable(name,value); }
374  // virtual void AddVariables(const TString *vars, Int_t size) { if (fFormula) fFormula->AddVariables(vars,size); }
375  virtual Bool_t AddToGlobalList(Bool_t on = kTRUE);
376  static Bool_t DefaultAddToGlobalList(Bool_t on = kTRUE);
377  virtual void Browse(TBrowser *b);
378  virtual void Copy(TObject &f1) const;
379  virtual Double_t Derivative(Double_t x, Double_t *params = 0, Double_t epsilon = 0.001) const;
380  virtual Double_t Derivative2(Double_t x, Double_t *params = 0, Double_t epsilon = 0.001) const;
381  virtual Double_t Derivative3(Double_t x, Double_t *params = 0, Double_t epsilon = 0.001) const;
382  static Double_t DerivativeError();
383  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
384  virtual void Draw(Option_t *option = "");
385  virtual TF1 *DrawCopy(Option_t *option = "") const;
386  virtual TObject *DrawDerivative(Option_t *option = "al"); // *MENU*
387  virtual TObject *DrawIntegral(Option_t *option = "al"); // *MENU*
388  virtual void DrawF1(Double_t xmin, Double_t xmax, Option_t *option = "");
389  virtual Double_t Eval(Double_t x, Double_t y = 0, Double_t z = 0, Double_t t = 0) const;
390  virtual Double_t EvalPar(const Double_t *x, const Double_t *params = 0);
391  template<class T> T EvalPar(const T *x, const Double_t *params = 0);
392  template<class T> T EvalParVec(const T *data, const Double_t *params = 0);
393  virtual Double_t operator()(Double_t x, Double_t y = 0, Double_t z = 0, Double_t t = 0) const;
394  virtual Double_t operator()(const Double_t *x, const Double_t *params = 0);
395  template<class T> T operator()(const T *data, const Double_t *params);
396  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
397  virtual void FixParameter(Int_t ipar, Double_t value);
399  {
400  return fChisquare;
401  }
402  virtual TH1 *GetHistogram() const;
403  virtual TH1 *CreateHistogram()
404  {
405  return DoCreateHistogram(fXmin, fXmax);
406  }
407  virtual TFormula *GetFormula()
408  {
409  return fFormula;
410  }
411  virtual const TFormula *GetFormula() const
412  {
413  return fFormula;
414  }
415  virtual TString GetExpFormula(Option_t *option = "") const
416  {
417  return (fFormula) ? fFormula->GetExpFormula(option) : "";
418  }
419  virtual const TObject *GetLinearPart(Int_t i) const
420  {
421  return (fFormula) ? fFormula->GetLinearPart(i) : nullptr;
422  }
423  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;
424  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;
425  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;
426  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;
427  virtual Double_t GetMaximumStored() const
428  {
429  return fMaximum;
430  }
431  virtual Double_t GetMinimumStored() const
432  {
433  return fMinimum;
434  }
435  virtual Int_t GetNpar() const
436  {
437  return fNpar;
438  }
439  virtual Int_t GetNdim() const
440  {
441  return fNdim;
442  }
443  virtual Int_t GetNDF() const;
444  virtual Int_t GetNpx() const
445  {
446  return fNpx;
447  }
449  {
450  return fMethodCall;
451  }
452  virtual Int_t GetNumber() const
453  {
454  return (fFormula) ? fFormula->GetNumber() : 0;
455  }
456  virtual Int_t GetNumberFreeParameters() const;
457  virtual Int_t GetNumberFitPoints() const
458  {
459  return fNpfits;
460  }
461  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
463  {
464  return fParent;
465  }
466  virtual Double_t GetParameter(Int_t ipar) const
467  {
468  return (fFormula) ? fFormula->GetParameter(ipar) : fParams->GetParameter(ipar);
469  }
470  virtual Double_t GetParameter(const TString &name) const
471  {
472  return (fFormula) ? fFormula->GetParameter(name) : fParams->GetParameter(name);
473  }
474  virtual Double_t *GetParameters() const
475  {
476  return (fFormula) ? fFormula->GetParameters() : const_cast<Double_t *>(fParams->GetParameters());
477  }
478  virtual void GetParameters(Double_t *params)
479  {
480  if (fFormula) fFormula->GetParameters(params);
481  else std::copy(fParams->ParamsVec().begin(), fParams->ParamsVec().end(), params);
482  }
483  virtual const char *GetParName(Int_t ipar) const
484  {
485  return (fFormula) ? fFormula->GetParName(ipar) : fParams->GetParName(ipar);
486  }
487  virtual Int_t GetParNumber(const char *name) const
488  {
489  return (fFormula) ? fFormula->GetParNumber(name) : fParams->GetParNumber(name);
490  }
491  virtual Double_t GetParError(Int_t ipar) const;
492  virtual const Double_t *GetParErrors() const
493  {
494  return fParErrors.data();
495  }
496  virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const;
497  virtual Double_t GetProb() const;
498  virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum);
499  virtual Double_t GetRandom();
500  virtual Double_t GetRandom(Double_t xmin, Double_t xmax);
501  virtual void GetRange(Double_t &xmin, Double_t &xmax) const;
502  virtual void GetRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const;
503  virtual void GetRange(Double_t &xmin, Double_t &ymin, Double_t &zmin, Double_t &xmax, Double_t &ymax, Double_t &zmax) const;
504  virtual Double_t GetSave(const Double_t *x);
505  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;
506  virtual Double_t GetXmin() const
507  {
508  return fXmin;
509  }
510  virtual Double_t GetXmax() const
511  {
512  return fXmax;
513  }
514  TAxis *GetXaxis() const ;
515  TAxis *GetYaxis() const ;
516  TAxis *GetZaxis() const ;
517  virtual Double_t GetVariable(const TString &name)
518  {
519  return (fFormula) ? fFormula->GetVariable(name) : 0;
520  }
521  virtual Double_t GradientPar(Int_t ipar, const Double_t *x, Double_t eps = 0.01);
522  virtual void GradientPar(const Double_t *x, Double_t *grad, Double_t eps = 0.01);
523  virtual void InitArgs(const Double_t *x, const Double_t *params);
524  static void InitStandardFunctions();
525  virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel = 1.e-12);
526  virtual Double_t IntegralOneDim(Double_t a, Double_t b, Double_t epsrel, Double_t epsabs, Double_t &err);
527  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);
528  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);
529  // virtual Double_t IntegralFast(const TGraph *g, Double_t a, Double_t b, Double_t *params=0);
530  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);
531  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);
532  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)
533  {
534  return IntegralMultiple(n, a, b, maxpts, epsrel, epsrel, relerr, nfnevl, ifail);
535  }
536  virtual Double_t IntegralMultiple(Int_t n, const Double_t *a, const Double_t *b, Double_t epsrel, Double_t &relerr);
537  virtual Bool_t IsEvalNormalized() const
538  {
539  return fNormalized;
540  }
541  /// return kTRUE if the point is inside the function range
542  virtual Bool_t IsInside(const Double_t *x) const
543  {
544  return !((x[0] < fXmin) || (x[0] > fXmax));
545  }
546  virtual Bool_t IsLinear() const
547  {
548  return (fFormula) ? fFormula->IsLinear() : false;
549  }
550  virtual Bool_t IsValid() const;
551  virtual void Print(Option_t *option = "") const;
552  virtual void Paint(Option_t *option = "");
553  virtual void ReleaseParameter(Int_t ipar);
554  virtual void Save(Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax);
555  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
556  virtual void SetChisquare(Double_t chi2)
557  {
558  fChisquare = chi2;
559  }
560  virtual void SetFitResult(const ROOT::Fit::FitResult &result, const Int_t *indpar = 0);
561  template <class PtrObj, typename MemFn>
562  void SetFunction(PtrObj &p, MemFn memFn);
563  template <typename Func>
564  void SetFunction(Func f);
565  virtual void SetMaximum(Double_t maximum = -1111); // *MENU*
566  virtual void SetMinimum(Double_t minimum = -1111); // *MENU*
567  virtual void SetNDF(Int_t ndf);
568  virtual void SetNumberFitPoints(Int_t npfits)
569  {
570  fNpfits = npfits;
571  }
572  virtual void SetNormalized(Bool_t flag)
573  {
574  fNormalized = flag;
575  Update();
576  }
577  virtual void SetNpx(Int_t npx = 100); // *MENU*
578  virtual void SetParameter(Int_t param, Double_t value)
579  {
580  (fFormula) ? fFormula->SetParameter(param, value) : fParams->SetParameter(param, value);
581  Update();
582  }
583  virtual void SetParameter(const TString &name, Double_t value)
584  {
585  (fFormula) ? fFormula->SetParameter(name, value) : fParams->SetParameter(name, value);
586  Update();
587  }
588  virtual void SetParameters(const Double_t *params)
589  {
590  (fFormula) ? fFormula->SetParameters(params) : fParams->SetParameters(params);
591  Update();
592  }
593  virtual void SetParameters(Double_t p0, Double_t p1, Double_t p2 = 0, Double_t p3 = 0, Double_t p4 = 0,
594  Double_t p5 = 0, Double_t p6 = 0, Double_t p7 = 0, Double_t p8 = 0,
595  Double_t p9 = 0, Double_t p10 = 0)
596  {
597  if (fFormula) fFormula->SetParameters(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
598  else fParams->SetParameters(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
599  Update();
600  } // *MENU*
601  virtual void SetParName(Int_t ipar, const char *name);
602  virtual void SetParNames(const char *name0 = "p0", const char *name1 = "p1", const char *name2 = "p2",
603  const char *name3 = "p3", const char *name4 = "p4", const char *name5 = "p5",
604  const char *name6 = "p6", const char *name7 = "p7", const char *name8 = "p8",
605  const char *name9 = "p9", const char *name10 = "p10"); // *MENU*
606  virtual void SetParError(Int_t ipar, Double_t error);
607  virtual void SetParErrors(const Double_t *errors);
608  virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax);
609  virtual void SetParent(TObject *p = 0)
610  {
611  fParent = p;
612  }
613  virtual void SetRange(Double_t xmin, Double_t xmax); // *MENU*
614  virtual void SetRange(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax);
615  virtual void SetRange(Double_t xmin, Double_t ymin, Double_t zmin, Double_t xmax, Double_t ymax, Double_t zmax);
616  virtual void SetSavedPoint(Int_t point, Double_t value);
617  virtual void SetTitle(const char *title = ""); // *MENU*
618  virtual void Update();
619 
620  static TF1 *GetCurrent();
621  static void AbsValue(Bool_t reject = kTRUE);
622  static void RejectPoint(Bool_t reject = kTRUE);
623  static Bool_t RejectedPoint();
624  static void SetCurrent(TF1 *f1);
625 
626  //Moments
627  virtual Double_t Moment(Double_t n, Double_t a, Double_t b, const Double_t *params = 0, Double_t epsilon = 0.000001);
628  virtual Double_t CentralMoment(Double_t n, Double_t a, Double_t b, const Double_t *params = 0, Double_t epsilon = 0.000001);
629  virtual Double_t Mean(Double_t a, Double_t b, const Double_t *params = 0, Double_t epsilon = 0.000001)
630  {
631  return Moment(1, a, b, params, epsilon);
632  }
633  virtual Double_t Variance(Double_t a, Double_t b, const Double_t *params = 0, Double_t epsilon = 0.000001)
634  {
635  return CentralMoment(2, a, b, params, epsilon);
636  }
637 
638  //some useful static utility functions to compute sampling points for Integral
639  //static void CalcGaussLegendreSamplingPoints(TGraph *g, Double_t eps=3.0e-11);
640  //static TGraph *CalcGaussLegendreSamplingPoints(Int_t num=21, Double_t eps=3.0e-11);
641  static void CalcGaussLegendreSamplingPoints(Int_t num, Double_t *x, Double_t *w, Double_t eps = 3.0e-11);
642 
643  ClassDef(TF1, 9) //The Parametric 1-D function
644 };
645 
646 ///ctor implementation
647 template <typename Func>
648 TF1::TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim, EAddToList addToGlobList) :
649  TNamed(name, name), TAttLine(), TAttFill(), TAttMarker(),
650  fXmin(xmin), fXmax(xmax),
651  fNpar(npar), fNdim(ndim),
652  fNpx(100), fType(1),
653  fNpfits(0), fNDF(0), fChisquare(0),
654  fMinimum(-1111), fMaximum(-1111),
655  fParErrors(std::vector<Double_t>(npar)),
656  fParMin(std::vector<Double_t>(npar)),
657  fParMax(std::vector<Double_t>(npar)),
658  fParent(0), fHistogram(0),
659  fMethodCall(0),
660  fNormalized(false), fNormIntegral(0),
661  //fFunctor(ROOT::Math::ParamFunctor(f)),
662  fFormula(0),
663  fParams(0)
664 {
666  DoInitialize(addToGlobList);
667 }
668 
669 namespace ROOT {
670  namespace Internal {
671 
672  template<class Func>
674  {
675  f->fType = 1;
677  f->fParams = new TF1Parameters(f->fNpar);
678  }
679  /// TF1 building from a string
680  /// used to build a TFormula based on a lambda function
681  template<>
682  struct TF1Builder<const char *> {
683  static void Build(TF1 *f, const char *formula)
684  {
685  f->fType = 0;
686  f->fFormula = new TFormula("tf1lambda", formula, f->fNdim, f->fNpar, false);
687  TString formulaExpression(formula);
688  Ssiz_t first = formulaExpression.Index("return") + 7;
689  Ssiz_t last = formulaExpression.Last(';');
690  TString title = formulaExpression(first, last - first);
691  f->SetTitle(title);
692  }
693  };
694  }
695 }
696 
697 
698 
699 
701 {
702  return Eval(x, y, z, t);
703 }
704 
705 inline Double_t TF1::operator()(const Double_t *x, const Double_t *params)
706 {
707  if (fMethodCall) InitArgs(x, params);
708  return EvalPar(x, params);
709 }
710 
711 template<class T>
712 inline T TF1::operator()(const T *data, const Double_t *params)
713 {
714  return EvalParVec(data, params);
715 }
716 
717 template<class T>
718 T TF1::EvalPar(const T *x, const Double_t *params)
719 {
720  if (fType == 3) {
721  return EvalParVec(x, params);
722  }
723 }
724 
725 template<class T>
726 inline T TF1::EvalParVec(const T *data, const Double_t *params)
727 {
728  return ((TF1FunctionPointerImpl<T> *)(fFunctp))->fimpl(data, params);
729 }
730 
732 {
733  TF1::SetRange(xmin, xmax);
734 }
736 {
737  TF1::SetRange(xmin, xmax);
738 }
739 
740 template <typename Func>
742 {
743  // set function from a generic C++ callable object
744  fType = 1;
745  fFunctor = ROOT::Math::ParamFunctor(f);
746 }
747 template <class PtrObj, typename MemFn>
748 void TF1::SetFunction(PtrObj &p, MemFn memFn)
749 {
750  // set from a pointer to a member function
751  fType = 1;
752  fFunctor = ROOT::Math::ParamFunctor(p, memFn);
753 }
754 
755 #endif
ROOT::Math::ParamFunctor fFunctor
Definition: TF1.h:188
virtual TString GetExpFormula(Option_t *option="") const
Definition: TF1.h:415
Double_t fMaximum
Definition: TF1.h:174
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:593
TF1Parameters(Int_t npar)
Definition: TF1.h:47
virtual void AddParameter(const TString &name, Double_t value)
Definition: TF1.h:368
virtual void SetParameters(const Double_t *params)
Definition: TF1.h:588
Int_t fNpx
Definition: TF1.h:168
Bool_t fNormalized
Pointer to MethodCall in case of interpreted function.
Definition: TF1.h:186
float xmin
Definition: THbookFile.cxx:93
virtual Double_t operator()(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Definition: TF1.h:700
virtual TFormula * GetFormula()
Definition: TF1.h:407
virtual Int_t GetNpx() const
Definition: TF1.h:444
static double p3(double t, double a, double b, double c, double d)
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
static std::atomic< Bool_t > fgAbsValue
Pointer to vectorized function.
Definition: TF1.h:204
const char Option_t
Definition: RtypesCore.h:62
T EvalParVec(const T *data, const Double_t *params=0)
Definition: TF1.h:726
float ymin
Definition: THbookFile.cxx:93
TF1(const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, const char *, const char *, EAddToList addToGlobList=EAddToList::kDefault)
Definition: TF1.h:345
double T(double x)
Definition: ChebyshevPol.h:34
TMethodCall * GetMethodCall() const
Definition: TF1.h:448
void SetParameters(const Double_t *params)
Set a vector of parameters value.
Definition: TFormula.cxx:2489
void DoInitialize(EAddToList addToGlobList)
Common initialization of the TF1.
Definition: TF1.cxx:617
#define BIT(n)
Definition: Rtypes.h:75
virtual Double_t GetMinimumStored() const
Definition: TF1.h:431
Int_t fNpar
Definition: TF1.h:166
TObject * fParent
Array gamma.
Definition: TF1.h:183
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
Definition: TF1.cxx:3288
Double_t fChisquare
Definition: TF1.h:172
Bool_t IsLinear() const
Definition: TFormula.h:182
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:587
std::vector< std::string > fParNames
Definition: TF1.h:135
Basic string class.
Definition: TString.h:129
virtual void SetNumberFitPoints(Int_t npfits)
Definition: TF1.h:568
Double_t fNormIntegral
Definition: TF1.h:187
int Int_t
Definition: RtypesCore.h:41
void SetParameter(const char *name, Double_t value)
Definition: TF1.h:110
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
void SetFunction(PtrObj &p, MemFn memFn)
Definition: TF1.h:748
Internal class used by TF1 for defining template specialization for different TF1 constructors...
Definition: TF1.h:143
STL namespace.
virtual void SetNormalized(Bool_t flag)
Definition: TF1.h:572
TRObject operator()(const T1 &t1) const
TF1(const char *name, T(*fcn)(const T *, const Double_t *), Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
Definition: TF1.h:257
TF1 Parameters class.
Definition: TF1.h:44
Double_t GetParameter(Int_t iparam) const
Definition: TF1.h:71
Int_t GetNumber() const
Definition: TFormula.h:171
TF1(const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, const char *, EAddToList addToGlobList=EAddToList::kDefault)
Definition: TF1.h:294
Marker Attributes class.
Definition: TAttMarker.h:19
virtual void SetParent(TObject *p=0)
Definition: TF1.h:609
TFormula * fFormula
Functor object to wrap any C++ callable object.
Definition: TF1.h:189
Fill Area Attributes class.
Definition: TAttFill.h:19
void SetParameters(TFitEditor::FuncParams_t &pars, TF1 *func)
Restore the parameters from pars into the function.
Definition: TFitEditor.cxx:287
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:297
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:2345
Int_t fNpfits
Definition: TF1.h:170
Int_t fNdim
Definition: TF1.h:167
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
const char * GetParName(Int_t iparam) const
Definition: TF1.h:90
virtual Double_t GetVariable(const TString &name)
Definition: TF1.h:517
virtual void GetParameters(Double_t *params)
Definition: TF1.h:478
bool CheckIndex(Int_t i) const
Definition: TF1.h:129
void SetParameter(const char *name, Double_t value)
Sets parameter value.
Definition: TFormula.cxx:2405
static double p2(double t, double a, double b, double c)
TF1()
TF1 default constructor.
Definition: TF1.cxx:403
void SetParameters(const Double_t *params)
Definition: TF1.h:102
const TObject * GetLinearPart(Int_t i) const
Return linear part.
Definition: TFormula.cxx:2043
std::vector< std::vector< double > > Data
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:532
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:146
virtual Int_t GetNdim() const
Definition: TF1.h:439
Method or function calling interface.
Definition: TMethodCall.h:37
virtual Double_t GetMaximumStored() const
Definition: TF1.h:427
static void GetRange(const char *comments, Double_t &xmin, Double_t &xmax, Double_t &factor)
Parse comments to search for a range specifier of the style: [xmin,xmax] or [xmin,xmax,nbits] [0,1] [-10,100]; [-pi,pi], [-pi/2,pi/4],[-2pi,2*pi] [-10,100,16] [0,0,8] if nbits is not specified, or nbits <2 or nbits>32 it is set to 32 if (xmin==0 and xmax==0 and nbits <=16) the double word will be converted to a float and its mantissa truncated to nbits significative bits.
TF1Parameters & operator=(const TF1Parameters &rhs)
Definition: TF1.h:61
std::vector< Double_t > fIntegral
Definition: TF1.h:179
TF1(const char *name, std::function< T(const T *data, const Double_t *param)> *fcn, Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
Definition: TF1.h:235
virtual const char * GetParName(Int_t ipar) const
Definition: TF1.h:483
static TF1 * fgCurrent
Definition: TF1.h:207
Double_t GetVariable(const char *name) const
Returns variable value.
Definition: TFormula.cxx:2190
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
th1 Draw()
virtual void SetChisquare(Double_t chi2)
Definition: TF1.h:556
float ymax
Definition: THbookFile.cxx:93
static Bool_t fgRejectPoint
Definition: TF1.h:205
TF1Parameters()
Definition: TF1.h:46
std::vector< Double_t > fParameters
Definition: TF1.h:134
TH1 * fHistogram
Parent object hooking this function (if one)
Definition: TF1.h:184
virtual const Double_t * GetParErrors() const
Definition: TF1.h:492
Class to manage histogram axis.
Definition: TAxis.h:30
virtual Int_t GetNumberFitPoints() const
Definition: TF1.h:457
double IntegralError(TF1 *func, Int_t ndim, const double *a, const double *b, const double *params, const double *covmat, double epsilon)
Definition: TF1Helper.cxx:38
The Formula class.
Definition: TFormula.h:83
virtual const TObject * GetLinearPart(Int_t i) const
Definition: TF1.h:419
Int_t fType
Definition: TF1.h:169
virtual Bool_t IsLinear() const
Definition: TF1.h:546
Double_t fMinimum
Definition: TF1.h:173
Double_t GetParameter(const char *name) const
Definition: TF1.h:75
virtual const TFormula * GetFormula() const
Definition: TF1.h:411
float xmax
Definition: THbookFile.cxx:93
static double p1(double t, double a, double b)
const std::vector< double > & ParamsVec() const
Definition: TF1.h:83
virtual Double_t GetParameter(const TString &name) const
Definition: TF1.h:470
Int_t GetParNumber(const char *name) const
Return parameter index given a name (return -1 for not existing parameters) non need to print an erro...
Definition: TFormula.cxx:2331
virtual Double_t GetXmin() const
Definition: TF1.h:506
virtual void SetParameter(const TString &name, Double_t value)
Definition: TF1.h:583
REAL epsilon
Definition: triangle.c:617
constexpr Double_t E()
Definition: TMath.h:74
void SetParameter(Int_t iparam, Double_t value)
Definition: TF1.h:97
virtual Double_t Mean(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Definition: TF1.h:629
const Bool_t kFALSE
Definition: RtypesCore.h:92
virtual Bool_t IsEvalNormalized() const
Definition: TF1.h:537
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:3315
TF1(const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
Definition: TF1.h:324
int Ssiz_t
Definition: RtypesCore.h:63
Double_t GetChisquare() const
Definition: TF1.h:398
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:1197
class containg the result of the fit and all the related information (fitted parameter values...
Definition: FitResult.h:48
Int_t fNDF
Definition: TF1.h:171
void Copy(void *source, void *dest)
double f(double x)
void Print(std::ostream &os, const OptionType &opt)
double Double_t
Definition: RtypesCore.h:55
std::vector< Double_t > fSave
Definition: TF1.h:178
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:875
std::vector< Double_t > fParErrors
Definition: TF1.h:175
Double_t fXmin
Definition: TF1.h:164
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:134
void SetParName(Int_t iparam, const char *name)
Definition: TF1.h:114
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:3622
void AddParameter(const TString &name, Double_t value=0)
Definition: TFormula.h:156
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:182
double func(double *x, double *p)
Definition: stressTF1.cxx:213
const char * GetParName(Int_t ipar) const
Return parameter name given by integer.
Definition: TFormula.cxx:2370
virtual Double_t Variance(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
Definition: TF1.h:633
virtual Double_t GetXmax() const
Definition: TF1.h:510
The TH1 histogram class.
Definition: TH1.h:56
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
std::vector< Double_t > fAlpha
Integral of function binned on fNpx bins.
Definition: TF1.h:180
EAddToList
Definition: TF1.h:157
Namespace for new Math classes and functions.
virtual void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
Definition: TF1.cxx:2261
std::vector< Double_t > fBeta
Array alpha. for each bin in x the deconvolution r of fIntegral.
Definition: TF1.h:181
TObject * GetParent() const
Definition: TF1.h:462
Binding & operator=(OUT(*fun)(void))
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
virtual Bool_t IsInside(const Double_t *x) const
return kTRUE if the point is inside the function range
Definition: TF1.h:542
TMethodCall * fMethodCall
Pointer to histogram used for visualisation.
Definition: TF1.h:185
virtual TH1 * CreateHistogram()
Definition: TF1.h:403
RooCmdArg Save(Bool_t flag=kTRUE)
virtual Int_t GetNpar() const
Definition: TF1.h:435
virtual ~TF1Parameters()
Definition: TF1.h:68
std::function< T(const T *f, const Double_t *param)> fimpl
Definition: TF1.h:198
static void Build(TF1 *f, Func func)
Definition: TF1.h:673
TString GetExpFormula(Option_t *option="") const
Return the expression formula.
Definition: TFormula.cxx:2712
virtual Double_t GetParameter(Int_t ipar) const
Definition: TF1.h:466
1-Dim function class
Definition: TF1.h:150
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:683
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
const Double_t * GetParameters() const
Definition: TF1.h:79
TF1Parameters * fParams
Definition: TF1.h:190
static std::atomic< Bool_t > fgAddToGlobList
Definition: TF1.h:206
virtual Double_t * GetParameters() const
Definition: TF1.h:474
Double_t GetParameter(const char *name) const
Returns parameter value given by string.
Definition: TFormula.cxx:2344
double result[121]
virtual void SetParameter(Int_t param, Double_t value)
Definition: TF1.h:578
Definition: first.py:1
std::vector< Double_t > fParMax
Definition: TF1.h:177
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:1226
const Bool_t kTRUE
Definition: RtypesCore.h:91
virtual Int_t GetNumber() const
Definition: TF1.h:452
std::vector< Double_t > fParMin
Definition: TF1.h:176
const Int_t n
Definition: legend1.C:16
Line Attributes class.
Definition: TAttLine.h:18
Double_t fXmax
Definition: TF1.h:165
Double_t * GetParameters() const
Definition: TFormula.cxx:2384
virtual Int_t GetParNumber(const char *name) const
Definition: TF1.h:487
TF1Parameters(const TF1Parameters &rhs)
Definition: TF1.h:56