AliPhysics  fceccc5 (fceccc5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliPWGFunc.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------
2 // AliPWGFunc
3 //
4 // This class implements several function useful to fit pt spectra,
5 // including but not limited to blast wave models.
6 //
7 //
8 // Author: M. Floris, CERN
9 //----------------------------------------------------------------------
10 
11 #ifndef ALIBWFUNC_H
12 #define ALIBWFUNC_H
13 
14 #if !defined(__CINT__) || defined(__MAKECINT__)
15 
16 #include "TObject.h"
17 
18 class TF1;
19 class TH1;
20 class TGraph;
21 #endif
22 
23 
24 
25 class AliPWGFunc : public TObject {
26 
27 
28 public:
29  // define the variables used for the function
31 
32  AliPWGFunc();
33  ~AliPWGFunc();
34 
35  // Boltzmann-Gibbs Blast Wave
37  Double_t norm, const char * name = "fBGBW");
38 
39 
40  // Boltzmann
41  TF1 * GetBoltzmann(Double_t mass, Double_t T, Double_t norm, const char * name ="fBoltzmann");
42 
43  // Tsallis blast wave
45  Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBW");
46 
47  // Simple exponential in 1/mt*dNdmt
48  TF1 * GetMTExp(Double_t mass, Double_t T, Double_t norm, const char * name ="fMtExp");
49 
50  // Simple exponential in 1/pt*dNdpt
51  TF1 * GetPTExp(Double_t T, Double_t norm, const char * name ="fPtExp");
52 
53  // Tsallis (no BW, a la CMS)
54  TF1 * GetTsallis(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallis")
55  {return GetLevi (mass,T,1/(q-1),norm,name);}
56 
57  // Levi function (aka Tsallis)
58  TF1 * GetLevi(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi");
59 
60  // UA1 function
61  TF1 * GetUA1(Double_t mass, Double_t p0star, Double_t pt0, Double_t n, Double_t T, Double_t norm, const char * name="fUA1");
62 
63  // Function derived from a histo
64  TF1 * GetHistoFunc(TH1 * h, const char * name = "fHisto");
65 
66  // Function derived from a graph
67  TF1 * GetGraphFunc(TGraph * h, const char * name = "fHisto");
68 
69  // Power law
70  TF1 * GetPowerLaw(Double_t pt0, Double_t n, Double_t norm, const char * name="fPowerLaw");
71 
72 
73  // Bose-Einstein
74  TF1 * GetBoseEinstein(Double_t mass, Double_t T, Double_t norm, const char * name="fBoseEinstein");
75 
76  // Fermi-Dirac
77  TF1 * GetFermiDirac(Double_t mass, Double_t T, Double_t norm, const char * name="fFermiDirac");
78 
79 
80  void SetVarType(VarType_t tp) {fVarType=tp;}
81 
82 protected:
83 
84  // dNdpt here means 1/pt dN/dpt
85 
86 
87  // Boltzmann-Gibbs blast wave
88  TF1 * GetBGBWdNdpt(Double_t mass, Double_t beta, Double_t temp,
89  Double_t n, Double_t norm, const char * name= "fBGBW");
90 
91  // Tsallis blast wave
93  Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBW");
94 
95  // Simple exponential in 1/mt*MT
96  TF1 * GetMTExpdNdpt(Double_t mass, Double_t T, Double_t norm, const char * name ="fExp");
97 
98  // Bose-Einstein
99  TF1 * GetBoseEinsteindNdpt(Double_t mass, Double_t T, Double_t norm, const char * name="fBoseEinstein");
100 
101  // Fermi-Dirac
102  TF1 * GetFermiDiracdNdpt(Double_t mass, Double_t T, Double_t norm, const char * name="fFermiDirac");
103 
104 
105  // Tsallis (no BW, a la CMS)
106  TF1 * GetTsallisdNdpt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallis");
107 
108  // Levi function
109  TF1 * GetLevidNdpt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi");
110 
111  // Power Law function
112  TF1 * GetPowerLawdNdpt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
113 
114  // UA1 function
115  TF1 * GetUA1dNdpt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
116 
117  // TimesPt means dNdpt
118 
119  // Boltzmann-Gibbs Blast Wave
121  Double_t norm, const char * name = "fBGBWTimesPt");
122 
124  Double_t norm, const char * name = "fBGBWTimesMt");
125 
126 
127  // Tsallis blast wave
129  Double_t norm, Double_t ymax = 0.5, const char * name = "fTsallisBWTimesPt");
130  // Levi function
131  TF1 * GetLevidNdptTimesPt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name="fLevi");
132 
133  // UA1 function
134  TF1 * GetUA1dNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
135 
136  // PowerLaw function
137  TF1 * GetPowerLawdNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char * name="fLevi");
138 
139  // Simple exponential in 1/mt*dNdmT
140  TF1 * GetMTExpdNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name ="fMtExpTimesPt");
141 
142  // Bose-Einstein
143  TF1 * GetBoseEinsteindNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name="fBoseEinstein");
144 
145  // Fermi-Dirac
146  TF1 * GetFermiDiracdNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name="fFermiDirac");
147 
148 
149  // Simple exponential in 1/mp*dNdpT
150  TF1 * GetPTExpdNdptTimesPt(Double_t T, Double_t norm, const char * name ="fPtExpTimesPt");
151 
152  // Boltzmann (exp in 1/mt*dNdmT times mt)
153  TF1 * GetBoltzmanndNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char * name ="fBoltzmannTimesPt");
154 
155  // Tsallis (no BW, a la CMS)
156  TF1 * GetTsallisdNdptTimesPt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name="fTsallisTimesPt");
157 
158  // 1/mt dNdmt
159 
160  // Levi
161  TF1 * GetLevidNdmt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name = "fLeviMt", VarType_t var = kOneOverMtdNdmt);
162 
163  // mt exp
164  TF1 * GetMTExpdNdmt(Double_t mass, Double_t temp, Double_t norm, const char * name, VarType_t var);
165 
166 
167  // gereral setters
168  void SetLineWidth(Width_t width) { fLineWidth = width;}
169 
170  TF1 * GetTestFunc(Double_t mass, Double_t T, Double_t norm, Double_t ymax, const char * name ="fTest") ;
171 
172  // static functions for TF1
173  // Boltzmann-Gibbs Blast Wave
174  static Double_t StaticBGdNdPt(const double * x, const double* p);
175  static Double_t StaticBGdNdPtTimesPt(const double * x, const double* p);
176  static Double_t StaticBGdNdMtTimesMt(const double * x, const double* p);
177  // Tsallis blast wave
178  static Double_t StaticTsallisdNdPt(const double * x, const double* p);
179  static Double_t StaticTsallisdNdPtTimesPt(const double * x, const double* p);
180  // Helper funcs for numeric integration
181  static Double_t IntegrandBG(const double * x, const double* p);
182  static Double_t IntegrandTsallis(const double * x, const double* p);
183 
184  // Test func
185  static Double_t StaticTest(const double * x, const double* p);
186  static Double_t IntegrandTest(const double * x, const double* p);
187 
188  // histo func
189  static Double_t StaticHistoFunc(const double * x, const double* p);
190 
191  // UA1 parametrization
192  static Double_t StaticUA1Func(const double * x, const double* p);
193  static Double_t StaticUA1FuncOneOverPt(const double * x, const double* p) ;
194 
195 
196 private:
197 
198 
199  TF1 * fLastFunc; // Last function returned
200  Width_t fLineWidth; // Line width
201  VarType_t fVarType; // Variable types (e.g. dNdpt vs pt, 1/mt dNdmt vs mt...)
202 
203  AliPWGFunc(const AliPWGFunc&); // not implemented
204  AliPWGFunc& operator=(const AliPWGFunc&); // not implemented
205 
206 
207  ClassDef(AliPWGFunc, 1)
208 
209 
210 };
211 
212 #endif
TF1 * GetBGBWdNdpt(Double_t mass, Double_t beta, Double_t temp, Double_t n, Double_t norm, const char *name="fBGBW")
Definition: AliPWGFunc.cxx:534
static Double_t IntegrandTsallis(const double *x, const double *p)
Definition: AliPWGFunc.cxx:552
TF1 * GetMTExp(Double_t mass, Double_t T, Double_t norm, const char *name="fMtExp")
Definition: AliPWGFunc.cxx:144
TF1 * GetBoseEinsteindNdpt(Double_t mass, Double_t T, Double_t norm, const char *name="fBoseEinstein")
Definition: AliPWGFunc.cxx:979
const Double_t ymax
Definition: AddTaskCFDStar.C:7
double Double_t
Definition: External.C:58
static Double_t StaticUA1FuncOneOverPt(const double *x, const double *p)
Definition: AliPWGFunc.cxx:422
TF1 * GetTsallisdNdptTimesPt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char *name="fTsallisTimesPt")
TF1 * GetPowerLawdNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char *name="fLevi")
Definition: AliPWGFunc.cxx:804
TF1 * GetMTExpdNdmt(Double_t mass, Double_t temp, Double_t norm, const char *name, VarType_t var)
Definition: AliPWGFunc.cxx:954
TF1 * GetBoseEinstein(Double_t mass, Double_t T, Double_t norm, const char *name="fBoseEinstein")
Definition: AliPWGFunc.cxx:173
TF1 * GetPTExpdNdptTimesPt(Double_t T, Double_t norm, const char *name="fPtExpTimesPt")
Definition: AliPWGFunc.cxx:737
static Double_t StaticUA1Func(const double *x, const double *p)
Definition: AliPWGFunc.cxx:386
Double_t mass
VarType_t fVarType
Definition: AliPWGFunc.h:201
TF1 * GetTsallisBW(Double_t mass, Double_t beta, Double_t T, Double_t q, Double_t norm, Double_t ymax=0.5, const char *name="fTsallisBW")
Definition: AliPWGFunc.cxx:121
TF1 * GetFermiDiracdNdpt(Double_t mass, Double_t T, Double_t norm, const char *name="fFermiDirac")
Definition: AliPWGFunc.cxx:991
TF1 * GetBoseEinsteindNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char *name="fBoseEinstein")
Definition: AliPWGFunc.cxx:705
TF1 * GetGraphFunc(TGraph *h, const char *name="fHisto")
Definition: AliPWGFunc.cxx:60
TF1 * GetLevidNdptTimesPt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char *name="fLevi")
Definition: AliPWGFunc.cxx:786
TF1 * GetUA1dNdpt(Double_t pt0, Double_t n, Double_t norm, const char *name="fLevi")
static Double_t StaticTsallisdNdPtTimesPt(const double *x, const double *p)
Definition: AliPWGFunc.cxx:617
TF1 * GetTsallisBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t T, Double_t q, Double_t norm, Double_t ymax=0.5, const char *name="fTsallisBWTimesPt")
Definition: AliPWGFunc.cxx:674
void SetVarType(VarType_t tp)
Definition: AliPWGFunc.h:80
TF1 * GetBGBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t T, Double_t n, Double_t norm, const char *name="fBGBWTimesPt")
Definition: AliPWGFunc.cxx:643
UShort_t T(UShort_t m, UShort_t t)
Definition: RingBits.C:60
static Double_t StaticBGdNdMtTimesMt(const double *x, const double *p)
Definition: AliPWGFunc.cxx:526
TF1 * GetHistoFunc(TH1 *h, const char *name="fHisto")
Definition: AliPWGFunc.cxx:44
static Double_t IntegrandTest(const double *x, const double *p)
Definition: AliPWGFunc.cxx:883
TF1 * GetPowerLaw(Double_t pt0, Double_t n, Double_t norm, const char *name="fPowerLaw")
Definition: AliPWGFunc.cxx:268
TF1 * GetBGBW(Double_t mass, Double_t beta, Double_t T, Double_t n, Double_t norm, const char *name="fBGBW")
Definition: AliPWGFunc.cxx:77
TF1 * GetLevidNdmt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char *name="fLeviMt", VarType_t var=kOneOverMtdNdmt)
Definition: AliPWGFunc.cxx:855
static Double_t StaticBGdNdPt(const double *x, const double *p)
Definition: AliPWGFunc.cxx:497
Width_t fLineWidth
Definition: AliPWGFunc.h:200
TF1 * GetBGBWdNdptTimesMt(Double_t mass, Double_t beta, Double_t T, Double_t n, Double_t norm, const char *name="fBGBWTimesMt")
Definition: AliPWGFunc.cxx:659
AliPWGFunc & operator=(const AliPWGFunc &)
TF1 * GetMTExpdNdpt(Double_t mass, Double_t T, Double_t norm, const char *name="fExp")
Definition: AliPWGFunc.cxx:940
TF1 * GetUA1(Double_t mass, Double_t p0star, Double_t pt0, Double_t n, Double_t T, Double_t norm, const char *name="fUA1")
Definition: AliPWGFunc.cxx:292
TF1 * GetFermiDiracdNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char *name="fFermiDirac")
Definition: AliPWGFunc.cxx:720
TF1 * GetPTExp(Double_t T, Double_t norm, const char *name="fPtExp")
Definition: AliPWGFunc.cxx:218
void SetLineWidth(Width_t width)
Definition: AliPWGFunc.h:168
TF1 * GetMTExpdNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char *name="fMtExpTimesPt")
Definition: AliPWGFunc.cxx:690
static Double_t StaticTsallisdNdPt(const double *x, const double *p)
Definition: AliPWGFunc.cxx:586
TF1 * fLastFunc
Definition: AliPWGFunc.h:199
TF1 * GetTsallisdNdpt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char *name="fTsallis")
TF1 * GetTsallisBWdNdpt(Double_t mass, Double_t beta, Double_t T, Double_t q, Double_t norm, Double_t ymax=0.5, const char *name="fTsallisBW")
Definition: AliPWGFunc.cxx:624
TF1 * GetLevi(Double_t mass, Double_t T, Double_t n, Double_t norm, const char *name="fLevi")
Definition: AliPWGFunc.cxx:241
TF1 * GetPowerLawdNdpt(Double_t pt0, Double_t n, Double_t norm, const char *name="fLevi")
Definition: AliPWGFunc.cxx:821
TF1 * GetFermiDirac(Double_t mass, Double_t T, Double_t norm, const char *name="fFermiDirac")
Definition: AliPWGFunc.cxx:195
TF1 * GetTestFunc(Double_t mass, Double_t T, Double_t norm, Double_t ymax, const char *name="fTest")
Definition: AliPWGFunc.cxx:924
TF1 * GetUA1dNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char *name="fLevi")
TF1 * GetBoltzmanndNdptTimesPt(Double_t mass, Double_t T, Double_t norm, const char *name="fBoltzmannTimesPt")
Definition: AliPWGFunc.cxx:753
static Double_t StaticHistoFunc(const double *x, const double *p)
Definition: AliPWGFunc.cxx:351
static Double_t StaticBGdNdPtTimesPt(const double *x, const double *p)
Definition: AliPWGFunc.cxx:521
static Double_t IntegrandBG(const double *x, const double *p)
Definition: AliPWGFunc.cxx:460
TF1 * GetBoltzmann(Double_t mass, Double_t T, Double_t norm, const char *name="fBoltzmann")
Definition: AliPWGFunc.cxx:101
TF1 * GetLevidNdpt(Double_t mass, Double_t T, Double_t n, Double_t norm, const char *name="fLevi")
Definition: AliPWGFunc.cxx:838
static Double_t StaticTest(const double *x, const double *p)
Definition: AliPWGFunc.cxx:899
TF1 * GetTsallis(Double_t mass, Double_t T, Double_t q, Double_t norm, const char *name="fTsallis")
Definition: AliPWGFunc.h:54
Definition: External.C:196