StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TMDFParameters.h
1 #ifndef __TMDFParameters__
2 #define __TMDFParameters__
3 #include "TArrayI.h"
4 #include "TArrayD.h"
5 #include "TF2.h"
6 class TMDFParameters : public TObject {
7  public:
8  TMDFParameters(Double_t mean = 0,
9  Int_t nvar = 0, Double_t *minV = 0, Double_t *maxV = 0, Double_t *meanV = 0, Int_t *maxPower = 0,
10  Int_t ncoef = 0, Int_t *code = 0, Double_t *coef = 0, Double_t *dcoef = 0) :
11  fMean(mean),
12  fNvar(nvar), fVmin(nvar,minV), fVmax(nvar,maxV), fVmean(nvar,meanV), fMaxPower(nvar,maxPower),
13  fNcoef(ncoef), fCode(ncoef,code), fCoef(ncoef,coef), fdCoef(ncoef,dcoef) {fgTMDFParameters = this;}
14  virtual ~TMDFParameters() {fgTMDFParameters = 0;}
15  static TMDFParameters *Instance() {return fgTMDFParameters;}
16  TArrayD *GetTerms(Double_t *x);
17  Double_t Eval(Double_t *x);
18  Double_t dEval(Double_t *x);
19  Double_t *Tcheb(Double_t x, Int_t N, Double_t *T);
20  virtual void Print(Option_t *option="") const;
21  static Double_t Func(Double_t *x, Double_t *p = 0);
22  static TF1 *ProjectionX(Int_t code = 0);
23  static TF2 *ProjectionXY(Int_t code1 = 0, Int_t code2 = 1);
24  static Int_t Nvar() {return Instance()->fNvar;}
25  static Double_t Vmin(Int_t code) {return Instance()->fVmin[code];}
26  static Double_t Vmax(Int_t code) {return Instance()->fVmax[code];}
27  static Double_t Vmean(Int_t code) {return Instance()->fVmean[code];}
28  static void SetCurrent(TMDFParameters *p) {fgTMDFParameters = p;}
29 
30  private:
31  Double_t fMean;
32  Int_t fNvar;
33  TArrayD fVmin;
34  TArrayD fVmax;
35  TArrayD fVmean;
36  TArrayI fMaxPower;
37  Int_t fNcoef;
38  TArrayI fCode;
39  TArrayD fCoef;
40  TArrayD fdCoef;
41  static TMDFParameters *fgTMDFParameters;
42  ClassDef(TMDFParameters,1)
43 };
44 #endif