1 #ifndef ALILANDAUGAUS_H
2 #define ALILANDAUGAUS_H
482 static Bool_t enabled =
true;
483 if (val >= 0) enabled = val == 1;
490 #ifndef NO_SIGMA_SHIFT
501 delta = i * (delta + xi * TMath::Log(i)) - dDelta;
509 if (xi <= 0)
return 0;
510 if (sigma <= 0)
return 0;
514 const Double_t q = p*u*TMath::Sqrt(u);
515 if (q > 100)
return 0;
516 return c * sigma / TMath::Power(1+1./i, q);
523 return TMath::Landau(x, deltaP, xi,
true);
530 if (xi <= 0)
return 0;
536 const Double_t sigma1 = sigmaN == 0 ? sigma : TMath::Sqrt(sigma2);
537 const Double_t xlow = x - nSigma * sigma1;
538 const Double_t xhigh = x + nSigma * sigma1;
539 const Double_t step = (xhigh - xlow) / nSteps;
542 for (
Int_t i = 0; i <= nSteps/2; i++) {
543 const Double_t x1 = xlow + (i - .5) * step;
544 const Double_t x2 = xhigh - (i - .5) * step;
545 sum +=
Fl(x1, deltaP, xi) * TMath::Gaus(x, x1, sigma1);
546 sum +=
Fl(x2, deltaP, xi) * TMath::Gaus(x, x2, sigma1);
548 return step * sum *
InvSq2Pi() / sigma1;
559 IPars(i, deltaI, xiI, sigmaI);
562 return Fl(x, deltaI, xiI);
564 return F(x, deltaI, xiI, sigmaI, sigmaN);
572 Double_t result =
Fi(x, delta, xi, sigma, sigmaN, 1);
573 for (
Int_t i = 2; i <= n; i++)
574 result += a[i-2] *
Fi(x,delta,xi,sigma,sigmaN,i);
586 if (dPar == 0)
return 0;
589 Double_t deltaI = i * (delta + xi * TMath::Log(i));
599 y1 =
Fi(x, deltaI+i*dp, xiI, sigmaI, sigmaN, i);
600 y2 =
Fi(x, deltaI+i*d2, xiI, sigmaI, sigmaN, i);
601 y3 =
Fi(x, deltaI-i*d2, xiI, sigmaI, sigmaN, i);
602 y4 =
Fi(x, deltaI-i*dp, xiI, sigmaI, sigmaN, i);
605 y1 =
Fi(x, deltaI, xiI+i*dp, sigmaI, sigmaN, i);
606 y2 =
Fi(x, deltaI, xiI+i*d2, sigmaI, sigmaN, i);
607 y3 =
Fi(x, deltaI, xiI-i*d2, sigmaI, sigmaN, i);
608 y4 =
Fi(x, deltaI, xiI-i*dp, sigmaI, sigmaN, i);
611 y1 =
Fi(x, deltaI, xiI, sigmaI+si*dp, sigmaN, i);
612 y2 =
Fi(x, deltaI, xiI, sigmaI+si*d2, sigmaN, i);
613 y3 =
Fi(x, deltaI, xiI, sigmaI-si*d2, sigmaN, i);
614 y4 =
Fi(x, deltaI, xiI, sigmaI-si*dp, sigmaN, i);
617 y1 =
Fi(x, deltaI, xiI, sigmaI, sigmaN+dp, i);
618 y2 =
Fi(x, deltaI, xiI, sigmaI, sigmaN+d2, i);
619 y3 =
Fi(x, deltaI, xiI, sigmaI, sigmaN-d2, i);
620 y4 =
Fi(x, deltaI, xiI, sigmaI, sigmaN-dp, i);
629 Double_t g = 1/(2*dp) * (4*d1 - d0) / 3;
639 const Int_t kColors[] = { kRed+1,
651 return kColors[((i-1) % 12)];
664 return constant *
F(x, delta, xi, sigma, sigmaN);
678 return constant *
Fi(x, delta, xi, sigma, sigmaN, i);
693 return constant *
Fn(x, delta, xi, sigma, sigmaN, n, a);
709 return (cP *
F(x,deltaP,xiP,sigmaP,0) +
710 cS *
F(x,deltaS,xiS,sigmaS,0));
724 f->SetParameters(c,delta,xi,sigma,sigmaN);
725 f->SetParNames(
"C",
"#Delta_{p}",
"#xi",
"#sigma",
"#sigma_{n}");
741 TF1* f =
new TF1(Form(
"nlandau%d", n), &
FnFunc,xmin,xmax,npar);
745 f->SetParNames(
"C",
"#Delta_{p}",
"#xi",
"#sigma",
"#sigma_{n}",
"N");
746 f->SetParameter(
kC, c);
747 f->SetParameter(
kDelta, delta);
748 f->SetParameter(
kXi, xi);
749 f->SetParameter(
kSigma, sigma);
750 f->SetParameter(
kSigmaN, sigmaN);
751 f->FixParameter(
kN, n);
753 f->SetParameter(
kA+i-2, a[i-2]);
754 f->SetParName(
kA+i-2, Form(
"a_{%d}", i));
766 TF1* f =
new TF1(Form(
"ilandau%d", i), &
FiFunc,xmin,xmax,npar);
770 f->SetParNames(
"C",
"#Delta_{p}",
"#xi",
"#sigma",
"#sigma_{n}",
"i");
771 f->SetParameter(
kC, c);
772 f->SetParameter(
kDelta, delta);
773 f->SetParameter(
kXi, xi);
774 f->SetParameter(
kSigma, sigma);
775 f->SetParameter(
kSigmaN, sigmaN);
776 f->FixParameter(
kN, i);
791 TF1* comp =
new TF1(
"composite", &
CompFunc, xmin, xmax,
kSigma+1+2);
792 comp->SetParNames(
"C",
"#Delta_{p}",
"#xi",
"#sigma",
793 "C#prime",
"#xi#prime");
794 comp->SetParameters(c1,
static Double_t SigmaShift(Int_t i, Double_t xi, Double_t sigma)
static Double_t SigmaShiftP()
static TF1 * MakeFn(Double_t c, Double_t delta, Double_t xi, Double_t sigma, Double_t sigma_n, Int_t n, const Double_t *a, Double_t xmin, Double_t xmax)
static Double_t SigmaShiftC()
static TF1 * MakeF1(Double_t c, Double_t delta, Double_t xi, Double_t sigma, Double_t sigma_n, Double_t xmin, Double_t xmax)
static Double_t Fn(Double_t x, Double_t delta, Double_t xi, Double_t sigma, Double_t sigma_n, Int_t n, const Double_t *a)
static Double_t DFidPar(Double_t x, UShort_t ipar, Double_t dp, Double_t delta, Double_t xi, Double_t sigma, Double_t sigma_n, Int_t i)
static TF1 * MakeComposite(Double_t c1, Double_t delta, Double_t xi1, Double_t sigma, Double_t c2, Double_t xi2, Double_t xmin, Double_t xmax)
static Double_t InvSq2Pi()
static TF1 * MakeFi(Double_t c, Double_t delta, Double_t xi, Double_t sigma, Double_t sigma_n, Int_t i, Double_t xmin, Double_t xmax)
static Double_t F1Func(Double_t *xp, Double_t *pp)
static Double_t FnFunc(Double_t *xp, Double_t *pp)
static Color_t GetIColor(Int_t i)
static Double_t FiFunc(Double_t *xp, Double_t *pp)
static Double_t MPShift()
static void IPars(Int_t i, Double_t &delta, Double_t &xi, Double_t &sigma)
static Double_t F(Double_t x, Double_t delta, Double_t xi, Double_t sigma, Double_t sigma_n)
static Double_t Fl(Double_t x, Double_t delta, Double_t xi)
static Bool_t EnableSigmaShift(Short_t val=-1)
static Double_t Fi(Double_t x, Double_t delta, Double_t xi, Double_t sigma, Double_t sigma_n, Int_t i)
static Double_t CompFunc(Double_t *xp, Double_t *pp)