Fixing coding conventions.
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / Fit / AliBWFunc.h
CommitLineData
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"
4c0d7bc7 23
24class TF1;
25class TH1;
26
27#endif
28
29
30
31class AliBWFunc : public TObject {
32
33
34public:
35 // define the variables used for the function
36 typedef enum {kdNdpt,kOneOverPtdNdpt,kOneOverMtdNdmt} VarType_t;
37
38 AliBWFunc();
39 ~AliBWFunc();
40
41 // Boltzmann-Gibbs blast wave
42 TF1 * GetBGBW(Double_t mass, Double_t beta, Double_t T,
43 Double_t norm, const char * name = "fBGBW");
44
45 // Boltzmann
46 TF1 * GetBoltzmann(Double_t mass, Double_t T, Double_t norm, const char * name ="fBoltzmann");
47
48 // Tsallis blast wave
49 TF1 * GetTsallisBW(Double_t mass, Double_t beta, Double_t T, Double_t q,
50 Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBW");
51
52 // Simple exponential in 1/mt*dNdmt
53 TF1 * GetMTExp(Double_t mass, Double_t T, Double_t norm, const char * name ="fExp");
54
55 // Simple exponential in 1/pt*dNdpt
56 TF1 * GetPTExp(Double_t T, Double_t norm, const char * name ="fExp");
57
58 // Tsallis (no BW, a la CMS)
59 TF1 * GetTsallis(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallis")
60 {return GetLevi (mass,T,1/(q-1),norm,name);}
61
62 // Levi function (aka Tsallis)
63 TF1 * GetLevi(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi");
64
65 // UA1 function
66 TF1 * GetUA1(Double_t mass, Double_t p0star, Double_t pt0, Double_t n, Double_t T, Double_t norm, const char * name="fUA1");
67
68 // Function derived from a histo
69 TF1 * GetHistoFunc(TH1 * h, const char * name = "fHisto");
70
71 // Power law
72 TF1 * GetPowerLaw(Double_t pt0, Double_t n, Double_t norm, const char * name="fPowerLaw");
73
74
75 void SetVarType(VarType_t tp) {fVarType=tp;}
76
77protected:
78
79 // dNdpt here means 1/pt dN/dpt
80
81 // Boltzmann-Gibbs Blast Wave
82 TF1 * GetBGBWdNdpt(Double_t mass, Double_t beta, Double_t T,
83 Double_t norm, const char * name = "fBGBW");
84
85 // Tsallis blast wave
86 TF1 * GetTsallisBWdNdpt(Double_t mass, Double_t beta, Double_t T, Double_t q,
87 Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBW");
88
89 // Simple exponential in 1/mt*MT
90 TF1 * GetMTExpdNdpt(Double_t mass, Double_t T, Double_t norm, const char * name ="fExp");
91
92 // Tsallis (no BW, a la CMS)
93 TF1 * GetTsallisdNdpt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallis");
94
95 // Levi function
96 TF1 * GetLevidNdpt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi");
97
98 // Power Law function
99 TF1 * GetPowerLawdNdpt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
100
101 // UA1 function
102 TF1 * GetUA1dNdpt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
103
104 // TimesPt means dNdpt
105
106 // Boltzmann-Gibbs Blast Wave
107 TF1 * GetBGBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t T,
108 Double_t norm, const char * name = "fBGBWTimesPt");
109
110 // Tsallis blast wave
111 TF1 * GetTsallisBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t T, Double_t q,
112 Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBWTimesPt");
113 // Levi function
114 TF1 * GetLevidNdptTimesPt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi");
115
116 // UA1 function
117 TF1 * GetUA1dNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
118
119 // PowerLaw function
120 TF1 * GetPowerLawdNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
121
122 // Simple exponential in 1/mt*dNdmT
123 TF1 * GetMTExpdNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name ="fMtExpTimesPt");
124
125 // Simple exponential in 1/mp*dNdpT
126 TF1 * GetPTExpdNdptTimesPt(Double_t T, Double_t norm, const char * name ="fPtExpTimesPt");
127
128 // Boltzmann (exp in 1/mt*dNdmT times mt)
129 TF1 * GetBoltzmanndNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name ="fBoltzmannTimesPt");
130
131 // Tsallis (no BW, a la CMS)
132 TF1 * GetTsallisdNdptTimesPt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallisTimesPt");
133
134 // 1/mt dNdmt
135
136 // Levi
137 TF1 * GetLevidNdmt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name = "fLeviMt");
138
139
140 // gereral setters
141 void SetLineWidth(Width_t width) { fLineWidth = width;}
142
143 TF1 * GetTestFunc(Double_t mass, Double_t T, Double_t norm, Double_t ymax, const char * name ="fTest") ;
144
145 // static functions for TF1
146 // Boltzmann-Gibbs Blast Wave
8ffc8c1c 147 static Double_t StaticBGdNdPt(const double * x, const double* p);
148 static Double_t StaticBGdNdPtTimesPt(const double * x, const double* p);
4c0d7bc7 149 // Tsallis blast wave
8ffc8c1c 150 static Double_t StaticTsallisdNdPt(const double * x, const double* p);
151 static Double_t StaticTsallisdNdPtTimesPt(const double * x, const double* p);
4c0d7bc7 152 // Helper funcs for numeric integration
8ffc8c1c 153 static Double_t IntegrandBG(const double * x, const double* p);
154 static Double_t IntegrandTsallis(const double * x, const double* p);
4c0d7bc7 155
156 // Test func
8ffc8c1c 157 static Double_t StaticTest(const double * x, const double* p);
158 static Double_t IntegrandTest(const double * x, const double* p);
4c0d7bc7 159
160 // histo func
8ffc8c1c 161 static Double_t StaticHistoFunc(const double * x, const double* p);
4c0d7bc7 162
163 // UA1 parametrization
8ffc8c1c 164 static Double_t StaticUA1Func(const double * x, const double* p);
4c0d7bc7 165
166
167private:
168
169
8ffc8c1c 170 TF1 * fLastFunc; // Last function returned
171 Width_t fLineWidth; // Line width
172 VarType_t fVarType; // Variable types (e.g. dNdpt vs pt, 1/mt dNdmt vs mt...)
4c0d7bc7 173
174 AliBWFunc(const AliBWFunc&); // not implemented
175 AliBWFunc& operator=(const AliBWFunc&); // not implemented
176
177
178 ClassDef(AliBWFunc, 1)
179
180
181};
182
183#endif