1 //----------------------------------------------------------------------
4 // This class implements several function useful to fit pt spectra,
5 // including but not limited to blast wave models.
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.
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.
14 // Warning: not all variables are implemented for all the functions.
16 // Author: M. Floris, CERN
17 //----------------------------------------------------------------------
19 #include "AliBWFunc.h"
29 AliBWFunc::AliBWFunc () : fLastFunc(0), fLineWidth(1), fVarType(kdNdpt) {
34 AliBWFunc::~AliBWFunc(){
37 if (fLastFunc) delete fLastFunc;
42 TF1 * AliBWFunc::GetHistoFunc(TH1 * h, const char * name) {
44 // Regardless of the variable type, this returns a function made
45 // from the histo * a multiplicative normalization.
46 // This uses a bad hack...
48 fLastFunc = new TF1 (name, StaticHistoFunc, 0.0, 10, 2);
49 fLastFunc->SetParameter(0,1);
50 fLastFunc->FixParameter(1,Double_t(Long64_t(h)));
51 fLastFunc->SetParNames("norm", "pointer to histo");
52 fLastFunc->SetLineWidth(fLineWidth);
58 TF1 * AliBWFunc::GetGraphFunc(TGraph * g, const char * name) {
60 // Regardless of the variable type, this returns a function made
61 // from the graph * a multiplicative normalization.
62 // This uses a bad hack...
64 fLastFunc = new TF1 (name, StaticHistoFunc, 0.0, 10, 2);
65 fLastFunc->SetParameter(0,1);
66 fLastFunc->FixParameter(1,Double_t(Long64_t(g)));
67 fLastFunc->SetParNames("norm", "pointer to histo");
68 fLastFunc->SetLineWidth(fLineWidth);
75 TF1 * AliBWFunc::GetBGBW(Double_t mass, Double_t beta, Double_t T,
76 Double_t n, Double_t norm, const char * name){
78 // Boltzmann-Gibbs blast wave
82 return GetBGBWdNdptTimesPt(mass,beta,T,n,norm,name);
85 return GetBGBWdNdpt(mass,beta,T,n,norm,name);
88 AliFatal("Not implemented");
91 AliFatal("Not implemented");
99 TF1 * AliBWFunc::GetBoltzmann(Double_t mass, Double_t T, Double_t norm, const char * name){
103 return GetBoltzmanndNdptTimesPt(mass, T, norm, name);
104 case kOneOverPtdNdpt:
105 AliFatal("Not implemented");
107 case kOneOverMtdNdmt:
108 AliFatal("Not implemented");
111 AliFatal("Not implemented");
119 TF1 * AliBWFunc::GetTsallisBW(Double_t mass, Double_t beta, Double_t T, Double_t q,
120 Double_t norm, Double_t ymax, const char * name){
122 // Tsallis blast wave
125 return GetTsallisBWdNdptTimesPt(mass,beta,T,q,norm,ymax,name);
127 case kOneOverPtdNdpt:
128 return GetTsallisBWdNdpt(mass,beta,T,q,norm,ymax,name);
130 case kOneOverMtdNdmt:
131 AliFatal("Not implemented");
134 AliFatal("Not implemented");
142 TF1 * AliBWFunc::GetMTExp(Double_t mass, Double_t T, Double_t norm, const char * name){
144 // Simple exponential in 1/mt*MT
147 return GetMTExpdNdptTimesPt(mass,T,norm,name);
149 case kOneOverPtdNdpt:
150 return GetMTExpdNdpt(mass,T,norm,name);
152 case kOneOverMtdNdmt:
153 AliFatal("Not implemented");
156 AliFatal("Not implemented");
165 TF1 * AliBWFunc::GetBoseEinstein(Double_t mass, Double_t T, Double_t norm, const char * name){
170 return GetBoseEinsteindNdptTimesPt(mass,T,norm,name);
172 case kOneOverPtdNdpt:
173 return GetBoseEinsteindNdpt(mass,T,norm,name);
175 case kOneOverMtdNdmt:
176 AliFatal("Not implemented");
179 AliFatal("Not implemented");
187 TF1 * AliBWFunc::GetFermiDirac(Double_t mass, Double_t T, Double_t norm, const char * name){
189 // Simple exponential in 1/mt*MT
192 return GetFermiDiracdNdptTimesPt(mass,T,norm,name);
194 case kOneOverPtdNdpt:
195 return GetFermiDiracdNdpt(mass,T,norm,name);
197 case kOneOverMtdNdmt:
198 AliFatal("Not implemented");
201 AliFatal("Not implemented");
210 TF1 * AliBWFunc::GetPTExp(Double_t T, Double_t norm, const char * name){
212 // Simple exponential in 1/mt*MT
215 return GetPTExpdNdptTimesPt(T,norm,name);
217 case kOneOverPtdNdpt:
218 AliFatal("Not implemented");
220 case kOneOverMtdNdmt:
221 AliFatal("Not implemented");
224 AliFatal("Not implemented");
233 TF1 * AliBWFunc::GetLevi(Double_t mass, Double_t T, Double_t n, Double_t norm, const char * name){
234 // Levi function (aka Tsallis)
237 return GetLevidNdptTimesPt(mass,T,n,norm,name);
239 case kOneOverPtdNdpt:
240 return GetLevidNdpt(mass,T,n,norm,name);
242 case kOneOverMtdNdmt:
243 return GetLevidNdmt(mass,T,n,norm,name,kOneOverMtdNdmt);
246 return GetLevidNdmt(mass,T,n,norm,name,kdNdmt);
248 case kOneOverMtdNdmtMinusM:
249 return GetLevidNdmt(mass,T,n,norm,name,kOneOverMtdNdmtMinusM);
252 AliFatal("Not implemented");
260 TF1 * AliBWFunc::GetPowerLaw(Double_t pt0, Double_t n, Double_t norm, const char * name){
261 // power law Nuclear Physics B, Vol. 335, No. 2. (7 May 1990), pp. 261-287.
262 // This is sometimes also called Hagedorn or modified Hagedorn
266 return GetPowerLawdNdptTimesPt(pt0,n,norm,name);
268 case kOneOverPtdNdpt:
269 return GetPowerLawdNdpt(pt0,n,norm,name);
271 case kOneOverMtdNdmt:
272 AliFatal("Not Implemented");
273 // return GetUA1dNdmt(mass,T,n,norm,name);
276 AliFatal("Not implemented");
284 TF1 * AliBWFunc::GetUA1(Double_t mass, Double_t p0star, Double_t pt0, Double_t n, Double_t T, Double_t norm, const char * name) {
285 // UA1 parametrization Nuclear Physics B, Vol. 335, No. 2. (7 May 1990), pp. 261-287.
290 fLastFunc = new TF1 (name, StaticUA1Func, 0.0, 10, 6);
291 fLastFunc->FixParameter(0,mass);
292 fLastFunc->SetParameter(1,p0star);
293 fLastFunc->SetParameter(2,pt0);
294 fLastFunc->SetParameter(3,n);
295 fLastFunc->SetParameter(4,T);
296 fLastFunc->SetParameter(5,norm);
297 fLastFunc->SetParLimits(1,0.01,1);
298 fLastFunc->SetParLimits(2,0.01,100);
299 fLastFunc->SetParLimits(3,0.01,100);
300 fLastFunc->SetParLimits(4,0.01,100);
301 fLastFunc->SetParNames("mass","p0star","pt0","n","T","norm");
302 fLastFunc->SetNpx(5000);
303 fLastFunc->SetLineWidth(fLineWidth);
307 case kOneOverPtdNdpt:
308 AliFatal("Not Implemented");
310 case kOneOverMtdNdmt:
311 AliFatal("Not Implemented");
312 // return GetUA1dNdmt(mass,T,n,norm,name);
315 AliFatal("Not implemented");
324 // ________________________________________________________________________
326 // Backend (private functions and support functions for numerical integration)
328 Double_t AliBWFunc::StaticHistoFunc(const double * x, const double* p){
330 // provides a function interpolating a histo with a spline;
331 // using double to store a pointer... This is a bad hack. To be replaced
335 TObject * h = (TObject*) Long64_t(p[1]);
337 // Int_t bin = h->FindBin(x[0]);
338 // double value = h->GetBinContent(bin);
341 // static TH1 * oldptr = 0;
342 // static TSpline3 * spl = 0;
344 // FIXME: recheck static pointers
346 if(h->InheritsFrom("TH1")) {
347 if ( ((TH1*)h)->FindBin(x[0]) > ((TH1*)h)->GetNbinsX()) return 0;
348 spl= new TSpline3((TH1*)h);
350 else if(h->InheritsFrom("TGraph")) spl= new TSpline3("fGraph",(TGraph*)h);
352 Printf("AliBWFunc::StaticHistoFunc: Unsupported type");
356 double value = spl->Eval(x[0]);
363 Double_t AliBWFunc::StaticUA1Func(const double * x, const double* p) {
366 // "mass","p0star","pt0","n","T","norm"
367 Double_t mass = p[0];
368 Double_t p0star = p[1];
371 Double_t temp = p[4];
372 Double_t norm = p[5];
376 static AliBWFunc * self = new AliBWFunc;
377 static TF1 * fPLaw = self->GetPowerLawdNdptTimesPt(pt0, n, norm, "fLocalPLawUA1");
378 static TF1 * fPMTExp = self->GetMTExpdNdptTimesPt (mass, temp, norm, "fLocalMTexpUA1");
380 fPLaw->SetParameters(norm,pt0,n);
381 fPMTExp->SetParameters(1,temp);
384 Double_t normMT =fPMTExp->Eval(p0star) >0 ? fPLaw->Eval(p0star) / fPMTExp->Eval(p0star) * fPMTExp->GetParameter(0) : 1;
385 fPMTExp->SetParameter(0,normMT);
388 if (TMath::Abs(fPMTExp->Eval(p0star) - fPLaw->Eval(p0star)) > 0.0001 ) {
389 Printf("AliBWFunc::StaticUA1Func - Wrong norm") ;
390 Printf(" p0* %f NMT: %f N: %f PL: %f MT: %f", p0star, normMT, norm, fPLaw->Eval(p0star), fPMTExp->Eval(p0star));
393 if (xx > p0star) return fPLaw->Eval(xx);
394 return fPMTExp->Eval(xx);
401 Double_t AliBWFunc::IntegrandBG(const double * x, const double* p){
402 // integrand for boltzman-gibbs blast wave
403 // x[0] -> r (radius)
405 // p[1] -> pT (transverse momentum)
406 // p[2] -> beta_max (surface velocity)
407 // p[3] -> T (freezout temperature)
408 // p[4] -> n (velocity profile)
415 double beta_max = p[2];
419 // Keep beta within reasonable limits
420 Double_t beta = beta_max * TMath::Power(x0, n);
421 if (beta > 0.9999999999999999) beta = 0.9999999999999999;
423 double mT = TMath::Sqrt(mass*mass+pT*pT);
425 double rho0 = TMath::ATanH(beta);
426 double arg00 = pT*TMath::SinH(rho0)/temp;
427 if (arg00 > 700.) arg00 = 700.; // avoid FPE
428 double arg01 = mT*TMath::CosH(rho0)/temp;
429 double f0 = x0*mT*TMath::BesselI0(arg00)*TMath::BesselK1(arg01);
431 // printf("r=%f, pt=%f, beta_max=%f, temp=%f, n=%f, mt=%f, beta=%f, rho=%f, argI0=%f, argK1=%f\n", x0, pT, beta_max, temp, n, mT, beta, rho0, arg00, arg01);
438 Double_t AliBWFunc::StaticBGdNdPt(const double * x, const double* p) {
440 // implementation of BGBW (1/pt dNdpt)
451 static TF1 * fIntBG = 0;
453 fIntBG = new TF1 ("fIntBG", IntegrandBG, 0, 1, 5);
455 fIntBG->SetParameters(mass, pT, beta, temp,n);
456 double result = fIntBG->Integral(0,1);
457 // printf ("[%4.4f], Int :%f\n", pT, result);
458 return result*norm;//*1e30;;
462 Double_t AliBWFunc::StaticBGdNdPtTimesPt(const double * x, const double* p) {
463 // BGBW dNdpt implementation
464 return x[0]*StaticBGdNdPt(x,p);
468 TF1 * AliBWFunc::GetBGBWdNdpt(Double_t mass, Double_t beta, Double_t temp,
469 Double_t n, Double_t norm, const char * name){
473 fLastFunc = new TF1 (name, StaticBGdNdPt, 0.0, 10, 5);
474 fLastFunc->SetParameters(mass,beta,temp,n,norm);
475 fLastFunc->FixParameter(0,mass);
476 fLastFunc->SetParNames("mass", "#beta", "T", "n", "norm");
477 fLastFunc->SetLineWidth(fLineWidth);
483 //_____________________________________________________________________
486 Double_t AliBWFunc::IntegrandTsallis(const double * x, const double* p){
488 // integrand for numerical integration (tsallis)
494 Double_t mass = p[0];
496 Double_t beta = p[2];
497 Double_t temp = p[3];
500 Double_t mt = TMath::Sqrt(mass*mass+pt*pt);
502 Double_t rho = TMath::ATanH(beta*r); // TODO: implement different velocity profiles
505 r*TMath::CosH(y) *TMath::Power( (
507 mt*TMath::CosH(y)*TMath::CosH(rho) -
508 pt*TMath::SinH(rho)*TMath::Cos(phi)
520 Double_t AliBWFunc::StaticTsallisdNdPt(const double * x, const double* p) {
522 // tsallis BW implementation 1/pt dNdpt
532 Double_t ymax = p[5];
535 static TF3 * fInt = 0;
537 fInt = new TF3 ("fIntTsa", IntegrandTsallis, 0, 1, -TMath::Pi(), TMath::Pi(), -ymax, ymax, 5);
538 // fInt->SetNpx(10000);
539 // fInt->SetNpy(10000);
540 // fInt->SetNpz(10000);
543 fInt->SetParameters(mass, pT, beta, temp, q);
544 double result = fInt->Integral(0,1, -TMath::Pi(), TMath::Pi(), -ymax, ymax);
545 // double result = fInt->Integral(0,1, -2, 2, -ymax, ymax);
547 return result*p[4];//*1e30;;
551 Double_t AliBWFunc::StaticTsallisdNdPtTimesPt(const double * x, const double* p) {
553 // tsallis BW , implementatio of dNdpt
554 return x[0]*StaticTsallisdNdPt(x,p);
558 TF1 * AliBWFunc::GetTsallisBWdNdpt(Double_t mass, Double_t beta, Double_t temp, Double_t q,
559 Double_t norm, Double_t ymax,const char * name){
562 // tsallis BW, 1/pt dNdpt
564 fLastFunc = new TF1 (name, StaticTsallisdNdPt, 0.0, 10, 6);
565 fLastFunc->SetParameters(mass,beta,temp,q,norm,ymax);
566 fLastFunc->SetParLimits(1,0.0,0.99);
567 fLastFunc->SetParLimits(2,0.01,0.99);
568 fLastFunc->SetParLimits(3,1.0001,1.9);
569 fLastFunc->SetParNames("mass", "#beta", "temp", "q", "norm", "ymax");
570 fLastFunc->SetLineWidth(fLineWidth);
576 // Boltzmann-Gibbs Blast Wave
577 TF1 * AliBWFunc::GetBGBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t temp, Double_t n,
578 Double_t norm, const char * name){
582 fLastFunc = new TF1 (name, StaticBGdNdPtTimesPt, 0.0, 10, 5);
583 fLastFunc->SetParameters(mass,beta,temp,n,norm);
584 fLastFunc->FixParameter(0,mass);
585 fLastFunc->SetParNames("mass", "#beta", "temp", "n", "norm");
586 fLastFunc->SetLineWidth(fLineWidth);
594 TF1 * AliBWFunc::GetTsallisBWdNdptTimesPt(Double_t mass, Double_t beta, Double_t temp, Double_t q,
595 Double_t norm, Double_t ymax, const char * name){
597 // Tsallis blast wave, dNdpt
599 fLastFunc = new TF1 (name, StaticTsallisdNdPtTimesPt, 0.0, 10, 6);
600 fLastFunc->SetParameters(mass,beta,temp,q,norm,ymax);
601 fLastFunc->SetParNames("mass", "#beta", "temp", "q", "norm", "ymax");
602 fLastFunc->SetLineWidth(fLineWidth);
610 TF1 * AliBWFunc::GetMTExpdNdptTimesPt(Double_t mass, Double_t temp, Double_t norm, const char * name){
612 // Simple exponential in 1/mt*MT, as a function of dNdpt
614 snprintf(formula,500,"[0]*x*exp(-sqrt(x**2+%f**2)/[1])", mass);
615 fLastFunc=new TF1(name,formula,0,10);
616 fLastFunc->SetParameters(norm, temp);
617 fLastFunc->SetParLimits(1, 0.01, 10);
618 fLastFunc->SetParNames("norm", "T");
619 fLastFunc->SetLineWidth(fLineWidth);
625 TF1 * AliBWFunc::GetBoseEinsteindNdptTimesPt(Double_t mass, Double_t temp, Double_t norm, const char * name){
627 // Bose einstein distribution as a function of dNdpt
629 snprintf(formula,500,"[0]*x*1./(exp(sqrt(x**2+%f**2)/[1])-1)", mass);
630 fLastFunc=new TF1(name,formula,0,10);
631 fLastFunc->SetParameters(norm, temp);
632 fLastFunc->SetParLimits(1, 0.01, 10);
633 fLastFunc->SetParNames("norm", "T");
634 fLastFunc->SetLineWidth(fLineWidth);
640 TF1 * AliBWFunc::GetFermiDiracdNdptTimesPt(Double_t mass, Double_t temp, Double_t norm, const char * name){
642 // Bose einstein distribution as a function of dNdpt
644 snprintf(formula,500,"[0]*x*1./(exp(sqrt(x**2+%f**2)/[1])+1)", mass);
645 fLastFunc=new TF1(name,formula,0,10);
646 fLastFunc->SetParameters(norm, temp);
647 fLastFunc->SetParLimits(1, 0.01, 10);
648 fLastFunc->SetParNames("norm", "T");
649 fLastFunc->SetLineWidth(fLineWidth);
657 TF1 * AliBWFunc::GetPTExpdNdptTimesPt(Double_t temp, Double_t norm, const char * name){
659 // Simple exponential in 1/pt*dNdpT, as a function of dNdpt
661 snprintf(formula,500,"[0]*x*exp(-x/[1])");
662 fLastFunc=new TF1(name,formula,0,10);
663 fLastFunc->SetParameters(norm, temp);
664 fLastFunc->SetParLimits(1, 0.01, 10);
665 fLastFunc->SetParNames("norm", "T");
666 fLastFunc->SetLineWidth(fLineWidth);
673 TF1 * AliBWFunc::GetBoltzmanndNdptTimesPt(Double_t mass, Double_t temp, Double_t norm, const char * name){
674 // Boltzmann (exp in 1/mt*dNdmT times mt) as a function of dNdpt
676 snprintf(formula,500,"[0]*x*sqrt(x**2+%f**2)*exp(-sqrt(x**2+%f**2)/[1])", mass,mass);
677 fLastFunc=new TF1(name,formula,0,10);
678 fLastFunc->SetParameters(norm, temp);
679 fLastFunc->SetParLimits(1, 0.01, 10);
680 fLastFunc->SetParNames("norm", "T");
681 fLastFunc->SetLineWidth(fLineWidth);
688 // Tsallis (no BW, a la CMS)
689 // TF1 * AliBWFunc::GetTsallisdNdptTimesPt(Double_t mass, Double_t T, Double_t q, Double_t norm, const char * name){
691 // char formula[500];
692 // // sprintf(formula,"[0]*x*pow((1+(([2]-1)/[1])*(sqrt(x**2+%f**2)-%f)),(-1/([2]-1)))", mass, mass); //CMS
693 // sprintf(formula,"[0]*x*pow((1+(([2]-1)/[1])*(sqrt(x**2+%f**2))),(-1/([2]-1)))", mass); // STAR
694 // //sprintf(formula,"[0]*x*sqrt(x**2+%f**2)*pow((1+(([2]-1)/[1])*(sqrt(x**2+%f**2))),(-1/([2]-1)))", mass,mass); // STAR * mt
695 // fLastFunc=new TF1(name,formula,0,10);
696 // fLastFunc->SetParameters(norm, T, q);
697 // fLastFunc->SetParLimits(1, 0.001, 10);
698 // fLastFunc->SetParNames("norm", "T", "q");
699 // fLastFunc->SetLineWidth(fLineWidth);
706 TF1 * AliBWFunc::GetLevidNdptTimesPt(Double_t mass, Double_t temp, Double_t n, Double_t norm, const char * name){
708 // Levi function, dNdpt
711 snprintf(formula,500,"( x*[0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * ( 1 + (sqrt([3]*[3]+x*x) -[3])/([1]*[2]) )^(-[1])");
712 // sprintf(formula,"( x*[0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * ( 1 + (sqrt([3]*[3]+x*x))/([1]*[2]) )^(-[1])");
713 fLastFunc=new TF1(name,formula,0,10);
714 fLastFunc->SetParameters(norm, n, temp,mass);
715 fLastFunc->SetParLimits(2, 0.01, 10);
716 fLastFunc->SetParNames("norm (dN/dy)", "n", "T", "mass");
717 fLastFunc->FixParameter(3,mass);
718 fLastFunc->SetLineWidth(fLineWidth);
724 TF1 * AliBWFunc::GetPowerLawdNdptTimesPt(Double_t pt0, Double_t n, Double_t norm, const char * name){
726 // PowerLaw function, dNdpt
729 snprintf(formula,500,"x*[0]*( 1 + x/[1] )^(-[2])");
730 fLastFunc=new TF1(name,formula,0,10);
731 fLastFunc->SetParameters(norm, pt0, n);
732 fLastFunc->SetParLimits(1, 0.01, 10);
733 //fLastFunc->SetParLimits(2, 0.01, 50);
734 fLastFunc->SetParNames("norm", "pt0", "n");
735 fLastFunc->SetLineWidth(fLineWidth);
741 TF1 * AliBWFunc::GetPowerLawdNdpt(Double_t pt0, Double_t n, Double_t norm, const char * name){
743 // PowerLaw function, 1/pt dNdpt
746 snprintf(formula,500," [0]*( 1 + x/[1] )^(-[2])");
747 fLastFunc=new TF1(name,formula,0,10);
748 fLastFunc->SetParameters(norm, pt0, n);
749 // fLastFunc->SetParLimits(2, 0.01, 10);
750 fLastFunc->SetParNames("norm", "pt0", "n");
751 fLastFunc->SetLineWidth(fLineWidth);
758 TF1 * AliBWFunc::GetLevidNdpt(Double_t mass, Double_t temp, Double_t n, Double_t norm, const char * name){
760 // Levi function, dNdpt
763 snprintf(formula,500,"( [0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * ( 1 + (sqrt([3]*[3]+x*x) -[3])/([1]*[2]) )^(-[1])");
764 fLastFunc=new TF1(name,formula,0,10);
765 fLastFunc->SetParameters(norm, n, temp,mass);
766 fLastFunc->SetParLimits(2, 0.01, 10);
767 fLastFunc->SetParNames("norm (dN/dy)", "n", "T", "mass");
768 fLastFunc->FixParameter(3,mass);
769 fLastFunc->SetLineWidth(fLineWidth);
775 TF1 * AliBWFunc::GetLevidNdmt(Double_t mass, Double_t temp, Double_t n, Double_t norm, const char * name, VarType_t var){
777 // Levi function, 1/mt dNdmt
779 if (var == kOneOverMtdNdmt)
780 snprintf(formula,500,"( [0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * ( 1 + (x -[3])/([1]*[2]) )^(-[1])");
781 else if (var == kdNdmt)
782 snprintf(formula,500,"( x*[0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * ( 1 + (x-[3])/([1]*[2]) )^(-[1])");
783 if (var == kOneOverMtdNdmtMinusM)
784 snprintf(formula,500,"( [0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * ( 1 + (x)/([1]*[2]) )^(-[1])");
786 //sprintf(formula,"( [0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * ( 1 + x/([1]*[2]) )^(-[1])");
787 // sprintf(formula,"[0] * ( 1 + x/([1]*[2]) )^(-[1])");
788 fLastFunc=new TF1(name,formula,0,10);
789 fLastFunc->SetParameters(norm, n, temp,mass);
790 fLastFunc->SetParLimits(2, 0.01, 10);
791 fLastFunc->SetParNames("norm", "n", "T", "mass");
792 fLastFunc->FixParameter(3,mass);
793 fLastFunc->SetLineWidth(fLineWidth);
803 Double_t AliBWFunc::IntegrandTest(const double * x, const double* p){
809 Double_t mass = p[0];
811 Double_t temp = p[2];
813 Double_t mt = TMath::Sqrt(mass*mass+pt*pt);
815 return mt*TMath::CosH(y)*TMath::Exp(-mt*TMath::CosH(y)/temp);
819 Double_t AliBWFunc::StaticTest(const double * x, const double* p) {
828 Double_t ymax = p[3];
831 static TF3 * fIntTest = 0;
833 fIntTest = new TF3 ("fIntTest", IntegrandTest, 0, 1, -TMath::Pi(), TMath::Pi(), -ymax, ymax, 5);
834 // fInt->SetNpx(10000);
837 fIntTest->SetParameters(mass, pT, temp);
838 double result = fIntTest->Integral(-ymax, ymax);
840 return result*p[2];//*1e30;;
844 TF1 * AliBWFunc::GetTestFunc(Double_t mass, Double_t temp, Double_t norm, Double_t ymax, const char * name){
848 fLastFunc = new TF1 (name, StaticTest, 0.0, 10, 4);
849 fLastFunc->SetParameters(mass,temp,norm,ymax);
850 fLastFunc->SetParNames("mass", "#beta", "T", "q", "norm", "ymax");
851 fLastFunc->SetLineWidth(fLineWidth);
857 //___________________________________________________________
860 TF1 * AliBWFunc::GetMTExpdNdpt(Double_t mass, Double_t temp, Double_t norm, const char * name){
861 // Simple exp in 1/mt dNdmt, as a function of dNdpt
864 snprintf(formula,500,"[0]*exp(-sqrt(x**2+%f**2)/[1])", mass);
865 fLastFunc=new TF1(name,formula,0,10);
866 fLastFunc->SetParameters(norm, temp);
867 fLastFunc->SetParLimits(1, 0.01, 10);
868 fLastFunc->SetParNames("norm", "T");
869 fLastFunc->SetLineWidth(fLineWidth);
873 TF1 * AliBWFunc::GetBoseEinsteindNdpt(Double_t mass, Double_t temp, Double_t norm, const char * name){
876 snprintf(formula,500,"[0]*1./(exp(sqrt(x**2+%f**2)/[1])-1)", mass);
877 fLastFunc=new TF1(name,formula,0,10);
878 fLastFunc->SetParameters(norm, temp);
879 fLastFunc->SetParLimits(1, 0.01, 10);
880 fLastFunc->SetParNames("norm", "T");
881 fLastFunc->SetLineWidth(fLineWidth);
885 TF1 * AliBWFunc::GetFermiDiracdNdpt(Double_t mass, Double_t temp, Double_t norm, const char * name){
888 snprintf(formula,500,"[0]*1./(exp(sqrt(x**2+%f**2)/[1])+1)", mass);
889 fLastFunc=new TF1(name,formula,0,10);
890 fLastFunc->SetParameters(norm, temp);
891 fLastFunc->SetParLimits(1, 0.01, 10);
892 fLastFunc->SetParNames("norm", "T");
893 fLastFunc->SetLineWidth(fLineWidth);
898 // // Simple tsallis (a la CMS)
899 // TF1 * AliBWFunc::GetTsallisdNdpt(Double_t mass, Double_t temp, Double_t q, Double_t norm, const char * name){
901 // char formula[500];
902 // sprintf(formula,"[0]*sqrt(x**2+%f**2)*pow((1+(([2]-1)/[1])*(sqrt(x**2+%f**2))),(-1/([2]-1)))", mass,mass);
903 // fLastFunc=new TF1(name,formula,0,10);
904 // fLastFunc->SetParameters(norm, temp, q);
905 // fLastFunc->SetParLimits(1, 0.01, 10);
906 // fLastFunc->SetParNames("norm", "T", "q");
907 // fLastFunc->SetLineWidth(fLineWidth);