4c0d7bc7 |
1 | //---------------------------------------------------------------------- |
2 | // AliBWFunc |
3 | // |
4 | // This class implements several function useful to fit pt spectra, |
5 | // including but not limited to blast wave models. |
6 | // |
7 | // It can return the same functional for as a function of different |
8 | // variables: dNdpt vs pt, 1/pt dNdpt vs pt, 1/mt dNdmt vs mt. |
9 | // |
10 | // Before getting the function you need, you have to chose the |
11 | // variable you want to use calling AliBWFunc::SetVarType with one of |
12 | // the elements of the VarType_t enum. |
13 | // |
14 | // Author: M. Floris, CERN |
15 | //---------------------------------------------------------------------- |
16 | |
17 | #ifndef ALIBWFUNC_H |
18 | #define ALIBWFUNC_H |
19 | |
20 | #if !defined(__CINT__) || defined(__MAKECINT__) |
21 | |
22 | #include "TObject.h" |
23 | #include "AliLog.h" |
24 | |
25 | class TF1; |
26 | class TH1; |
27 | |
28 | #endif |
29 | |
30 | |
31 | |
32 | class AliBWFunc : public TObject { |
33 | |
34 | |
35 | public: |
36 | // define the variables used for the function |
37 | typedef enum {kdNdpt,kOneOverPtdNdpt,kOneOverMtdNdmt} VarType_t; |
38 | |
39 | AliBWFunc(); |
40 | ~AliBWFunc(); |
41 | |
42 | // Boltzmann-Gibbs blast wave |
43 | TF1 * GetBGBW(Double_t mass, Double_t beta, Double_t T, |
44 | Double_t norm, const char * name = "fBGBW"); |
45 | |
46 | // Boltzmann |
47 | TF1 * GetBoltzmann(Double_t mass, Double_t T, Double_t norm, const char * name ="fBoltzmann"); |
48 | |
49 | // Tsallis blast wave |
50 | TF1 * GetTsallisBW(Double_t mass, Double_t beta, Double_t T, Double_t q, |
51 | Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBW"); |
52 | |
53 | // Simple exponential in 1/mt*dNdmt |
54 | TF1 * GetMTExp(Double_t mass, Double_t T, Double_t norm, const char * name ="fExp"); |
55 | |
56 | // Simple exponential in 1/pt*dNdpt |
57 | TF1 * GetPTExp(Double_t T, Double_t norm, const char * name ="fExp"); |
58 | |
59 | // Tsallis (no BW, a la CMS) |
60 | TF1 * GetTsallis(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallis") |
61 | {return GetLevi (mass,T,1/(q-1),norm,name);} |
62 | |
63 | // Levi function (aka Tsallis) |
64 | TF1 * GetLevi(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi"); |
65 | |
66 | // UA1 function |
67 | TF1 * GetUA1(Double_t mass, Double_t p0star, Double_t pt0, Double_t n, Double_t T, Double_t norm, const char * name="fUA1"); |
68 | |
69 | // Function derived from a histo |
70 | TF1 * GetHistoFunc(TH1 * h, const char * name = "fHisto"); |
71 | |
72 | // Power law |
73 | TF1 * GetPowerLaw(Double_t pt0, Double_t n, Double_t norm, const char * name="fPowerLaw"); |
74 | |
75 | |
76 | void SetVarType(VarType_t tp) {fVarType=tp;} |
77 | |
78 | protected: |
79 | |
80 | // dNdpt here means 1/pt dN/dpt |
81 | |
82 | // Boltzmann-Gibbs Blast Wave |
83 | TF1 * GetBGBWdNdpt(Double_t mass, Double_t beta, Double_t T, |
84 | Double_t norm, const char * name = "fBGBW"); |
85 | |
86 | // Tsallis blast wave |
87 | TF1 * GetTsallisBWdNdpt(Double_t mass, Double_t beta, Double_t T, Double_t q, |
88 | Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBW"); |
89 | |
90 | // Simple exponential in 1/mt*MT |
91 | TF1 * GetMTExpdNdpt(Double_t mass, Double_t T, Double_t norm, const char * name ="fExp"); |
92 | |
93 | // Tsallis (no BW, a la CMS) |
94 | TF1 * GetTsallisdNdpt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallis"); |
95 | |
96 | // Levi function |
97 | TF1 * GetLevidNdpt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi"); |
98 | |
99 | // Power Law function |
100 | TF1 * GetPowerLawdNdpt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi"); |
101 | |
102 | // UA1 function |
103 | TF1 * GetUA1dNdpt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi"); |
104 | |
105 | // TimesPt means dNdpt |
106 | |
107 | // Boltzmann-Gibbs Blast Wave |
108 | TF1 * GetBGBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t T, |
109 | Double_t norm, const char * name = "fBGBWTimesPt"); |
110 | |
111 | // Tsallis blast wave |
112 | TF1 * GetTsallisBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t T, Double_t q, |
113 | Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBWTimesPt"); |
114 | // Levi function |
115 | TF1 * GetLevidNdptTimesPt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi"); |
116 | |
117 | // UA1 function |
118 | TF1 * GetUA1dNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi"); |
119 | |
120 | // PowerLaw function |
121 | TF1 * GetPowerLawdNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi"); |
122 | |
123 | // Simple exponential in 1/mt*dNdmT |
124 | TF1 * GetMTExpdNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name ="fMtExpTimesPt"); |
125 | |
126 | // Simple exponential in 1/mp*dNdpT |
127 | TF1 * GetPTExpdNdptTimesPt(Double_t T, Double_t norm, const char * name ="fPtExpTimesPt"); |
128 | |
129 | // Boltzmann (exp in 1/mt*dNdmT times mt) |
130 | TF1 * GetBoltzmanndNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name ="fBoltzmannTimesPt"); |
131 | |
132 | // Tsallis (no BW, a la CMS) |
133 | TF1 * GetTsallisdNdptTimesPt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallisTimesPt"); |
134 | |
135 | // 1/mt dNdmt |
136 | |
137 | // Levi |
138 | TF1 * GetLevidNdmt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name = "fLeviMt"); |
139 | |
140 | |
141 | // gereral setters |
142 | void SetLineWidth(Width_t width) { fLineWidth = width;} |
143 | |
144 | TF1 * GetTestFunc(Double_t mass, Double_t T, Double_t norm, Double_t ymax, const char * name ="fTest") ; |
145 | |
146 | // static functions for TF1 |
147 | // Boltzmann-Gibbs Blast Wave |
148 | static Double_t StaticBGdNdPt(double * x, double* p); |
149 | static Double_t StaticBGdNdPtTimesPt(double * x, double* p); |
150 | // Tsallis blast wave |
151 | static Double_t StaticTsallisdNdPt(double * x, double* p); |
152 | static Double_t StaticTsallisdNdPtTimesPt(double * x, double* p); |
153 | // Helper funcs for numeric integration |
154 | static Double_t IntegrandBG(double * x, double* p); |
155 | static Double_t IntegrandTsallis(double * x, double* p); |
156 | |
157 | // Test func |
158 | static Double_t StaticTest(double * x, double* p); |
159 | static Double_t IntegrandTest(double * x, double* p); |
160 | |
161 | // histo func |
162 | static Double_t StaticHistoFunc(double * x, double* p); |
163 | |
164 | // UA1 parametrization |
165 | static Double_t StaticUA1Func(double * x, double* p); |
166 | |
167 | |
168 | private: |
169 | |
170 | |
171 | TF1 * fLastFunc; |
172 | Width_t fLineWidth; |
173 | VarType_t fVarType; |
174 | |
175 | AliBWFunc(const AliBWFunc&); // not implemented |
176 | AliBWFunc& operator=(const AliBWFunc&); // not implemented |
177 | |
178 | |
179 | ClassDef(AliBWFunc, 1) |
180 | |
181 | |
182 | }; |
183 | |
184 | #endif |