]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FLOW/blastwave/AliBlastwaveFit.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / FLOW / blastwave / AliBlastwaveFit.h
1 #ifndef ALIBLASTWAVEFIT_H
2 #define ALIBLASTWAVEFIT_H
3
4
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /* $Id: AliBlastwaveFit.h 49869 2012-05-17 04:49:51Z fnoferin $ */
9
10 /////////////////////////////////////////////////
11 //                                             //
12 //         Blastwave base Fit Class            //
13 //           noferini@bo.infn.it               //
14 /////////////////////////////////////////////////
15
16 #include "TF1.h"
17 #include "TF2.h"
18 #include "TH1.h"
19 #include "TGraphErrors.h"
20 #include "TMinuit.h"
21
22 class AliBlastwaveFit : public TNamed
23 {
24 public:
25     AliBlastwaveFit(const char *name,Double_t mass);
26     AliBlastwaveFit();
27     ~AliBlastwaveFit();
28     
29 // virtual method to be filled
30     virtual void Initialize() = 0; // should be filled with the initialization of the TF1
31     virtual Int_t SetParameter(Int_t ipar,Double_t val) = 0;
32     virtual Int_t SetNormalization() = 0;
33     virtual Int_t GetNpar() = 0;
34     virtual Float_t GetParStart(Int_t ipar) = 0;
35     virtual Float_t GetParStep(Int_t ipar) = 0;
36     virtual Float_t GetParMin(Int_t ipar) = 0;
37     virtual Float_t GetParMax(Int_t ipar) = 0;
38     
39     virtual void SetMass(Double_t mass) {fMass=mass;};
40     virtual const char *GetParName(Int_t i) {if(i>=0) return "parNoName"; else return "";};
41     virtual void SwitchOffFlow(TMinuit *) const {};
42     
43
44     virtual Float_t GetMeanBeta() = 0;
45     virtual Float_t GetMeanBeta(Double_t par[]) = 0;
46
47     Double_t GetMass() const {return fMass;};
48     
49     TF1 *GetSpectraFit() const {return fFunctionYield;};
50     TF1 *GetV2Fit() const {return fFunctionV2;};
51     
52     Double_t EvalYield(Double_t pt){if(fFunctionYield) return fFunctionYield->Eval(pt); else return 0;};
53     Double_t EvalV2(Double_t pt){if(fFunctionV2) return fFunctionV2->Eval(pt); else return 0;};
54     
55     void SetSpectrumObj(TObject *obj);
56     void SetV2Obj(TObject *obj){fV2Obj = obj;};
57    
58     TObject *GetSpectrumObj(){return fSpectraObj;};
59     TObject *GetV2Obj(){return fV2Obj;};
60     TH1 *GetSpectrumObjCopy(){return fSpectraObjCopy;};
61
62     void SetMinPt(Float_t pt){fXmin = pt;};
63     void SetMaxPt(Float_t pt){fXmax = pt;};
64
65     Float_t GetMinPt() const {return fXmin;};
66     Float_t GetMaxPt() const {return fXmax;};
67
68     void Terminate(){if(fFunctionYield) fFunctionYield->SetRange(fXmin,fXmax); if(fFunctionV2) fFunctionV2->SetRange(fXmin,fXmax);};
69
70
71 protected:
72     Double_t fMass; // mass value
73     
74     TF1 *fFunctionYield;  //! function to describe the yield behaviuor for a fixed fMass
75     TF1 *fFunctionV2;     //! function to describe the v2 behaviuor for a fixed fMass
76     
77     TObject *fSpectraObj; // object to be fitted for yield
78     TObject *fV2Obj; // object to be fitted for v2
79
80     TH1 *fSpectraObjCopy; //! object to be fitted for yield as histo
81
82     Float_t fXmin; // mininimum pt for the fit
83     Float_t fXmax; // maximum pt for the fit 
84
85  private:
86     AliBlastwaveFit(const AliBlastwaveFit & old); 
87     AliBlastwaveFit& operator=(const AliBlastwaveFit & source); // ass. op. 
88     
89     ClassDef(AliBlastwaveFit,1)  // blastwave base class
90 };
91 #endif
92
93