AliRoot Core  3dc7879 (3dc7879)
AliTRDNDFast.h
Go to the documentation of this file.
1 // Author: Daniel.Lohner@cern.ch
2 
3 #ifndef ALIROOT_AliTRDNDFast
4 #define ALIROOT_AliTRDNDFast
5 
6 #ifndef ROOT_TH1
7 #include "TH1F.h"
8 #endif
9 #ifndef ROOT_TArrayF
10 #include "TArrayF.h"
11 #endif
12 #ifndef ROOT_TF2
13 #include "TF1.h"
14 #endif
15 #ifndef ROOT_TMath
16 #include "TMath.h"
17 #endif
18 #ifndef ROOT_TRandom
19 #include "TRandom.h"
20 #endif
21 
22 using namespace std;
23 
24 extern Double_t langaufun(Double_t *x,Double_t *par);
25 
26 class AliTRDNDFast : public TObject {
27 
28 public:
29  static const Int_t kNpar = 5;
30 
31  AliTRDNDFast();
32  AliTRDNDFast(const char *name,Int_t ndim,Int_t nbins,Double_t xlow,Double_t xup);
33  AliTRDNDFast(const AliTRDNDFast&);
34  AliTRDNDFast &operator=(const AliTRDNDFast &ref);
35  virtual ~AliTRDNDFast();
36 
37  TF1 *FitLandau(TString name,TH1F *htemp,Double_t range[2],TString option);
38 
39  void Build(TH1F **hdEdx,TString path="");
40  void Build(Double_t **pars);
41  Double_t Eval(Double_t *point) const;
42  void Random(Double_t *point) const;
43  Int_t GetNDim(){return fNDim;};
44  Double_t GetParam(Int_t dim,Int_t par){if((dim>=0)&&(dim<fNDim)&&(par>=0)&&(par<kNpar)){return fPars[par].GetAt(dim);}else{return 0;}};
45  void PrintPars();
46  static void Random(Double_t *point,AliTRDNDFast *nd0,AliTRDNDFast *nd1,Double_t w0,Double_t w1);
47  Int_t GetFitOptionParameter();
48  void SetFitOptionParameter(Int_t iFitParameter=0);
49 
50 private:
51 
52  void ScaleLangauFun(TF1 *func,Double_t mpv);
53  TF1 *GetLangauFun(TString funcname,Double_t range[2],Double_t scalefactor=1);
54  void BuildHistos();
55  void Init();
56  void Cleanup();
57 
58  static Int_t BinarySearchInterpolation(Int_t start,Int_t end,Double_t *a0,Double_t *a1,Double_t w0,Double_t w1,Double_t val);
59  static Double_t GetRandomInterpolation(TH1F *hist0,TH1F *hist1,Double_t w0,Double_t w1);
60  Int_t fNDim; // Dimensions
61  TString fTitle; //title
62  TF1 **fFunc;
63  TH1F **fHistos; //[fNDim] Histograms
64  TArrayF fPars[kNpar]; // parameters
65  Int_t iLangauFitOptionParameter;//0 Use Standard, 1 dont use Exp
66  ClassDef(AliTRDNDFast,3) //Fast TRD ND class
67 };
68 
69 #endif
AliRunLoader * Init()
const char * path
Double_t GetParam(Int_t dim, Int_t par)
Definition: AliTRDNDFast.h:44
Double_t langaufun(Double_t *x, Double_t *par)
Float_t range[5]
TObject * htemp
Definition: PlotSys.C:37
TString fTitle
Definition: AliTRDNDFast.h:61
Int_t iLangauFitOptionParameter
Definition: AliTRDNDFast.h:65
Int_t GetNDim()
Definition: AliTRDNDFast.h:43
TF1 ** fFunc
Definition: AliTRDNDFast.h:62
TH1F ** fHistos
functions, do not store
Definition: AliTRDNDFast.h:63