1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // Library class for particle pt and y distributions used for
19 // muon spectrometer simulations.
20 // To be used with AliGenParam.
21 // The following particle typed can be simulated:
22 // pi, K, phi, omega, eta, J/Psi, Upsilon, charm and beauty mesons.
24 // andreas.morsch@cern.ch
30 #include "AliGenMUONlib.h"
32 ClassImp(AliGenMUONlib)
35 Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t* /*dummy*/)
38 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
39 // POWER LAW FOR PT > 500 MEV
40 // MT SCALING BELOW (T=160 MEV)
42 const Double_t kp0 = 1.3;
43 const Double_t kxn = 8.28;
44 const Double_t kxlim=0.5;
45 const Double_t kt=0.160;
46 const Double_t kxmpi=0.139;
48 Double_t y, y1, xmpi2, ynorm, a;
51 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
53 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
56 y=a*TMath::Power(kp0/(kp0+x),kxn);
58 y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
64 Double_t AliGenMUONlib::YPion( Double_t *py, Double_t */*dummy*/)
67 Double_t y=TMath::Abs(*py);
69 const Double_t ka = 7000.;
70 const Double_t kdy = 4.;
71 Double_t ex = y*y/(2*kdy*kdy);
72 return ka*TMath::Exp(-ex);
74 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
77 // particle composition
79 Int_t AliGenMUONlib::IpPion(TRandom *ran)
82 if (ran->Rndm() < 0.5) {
89 //____________________________________________________________
93 Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np)
95 // SCALING EN MASSE PAR RAPPORT A PTPI
96 // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
97 const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
98 // VALUE MESON/PI AT 5 GEV
99 const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
101 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
102 Double_t fmax2=f5/kfmax[np];
104 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
105 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
106 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
107 return fmtscal*ptpion;
113 //____________________________________________________________
114 Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t */*dummy*/)
117 return PtScal(*px,2);
121 //____________________________________________________________
122 Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t */*dummy*/)
125 Double_t y=TMath::Abs(*py);
127 const Double_t ka = 1000.;
128 const Double_t kdy = 4.;
130 Double_t ex = y*y/(2*kdy*kdy);
131 return ka*TMath::Exp(-ex);
134 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
137 // particle composition
139 Int_t AliGenMUONlib::IpKaon(TRandom *ran)
142 if (ran->Rndm() < 0.5) {
153 //____________________________________________________________
154 Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t */*dummy*/)
157 const Double_t kpt0 = 4.;
158 const Double_t kxn = 3.6;
161 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
162 return x/TMath::Power(pass1,kxn);
165 Double_t AliGenMUONlib::PtJpsiCDFscaled( Double_t *px, Double_t */*dummy*/)
168 const Double_t kpt0 = 4.703;
169 const Double_t kxn = 3.826;
172 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
173 return x/TMath::Power(pass1,kxn);
176 Double_t AliGenMUONlib::PtJpsiFlat( Double_t */*px*/, Double_t */*dummy*/ )
181 Double_t AliGenMUONlib::PtJpsiPbPb( Double_t *px, Double_t */*dummy*/)
188 // mc = 1.4 GeV, pt-kick 1 GeV
192 -2.13098e+00, 9.46552e+00, -5.06799e+00, 1.27260e+00,
193 -1.83806e-01, 1.55853e-02, -7.23241e-04, 1.42105e-05
200 while (j > 0) y = y * x +c[--j];
201 y = x * TMath::Exp(y);
208 Double_t AliGenMUONlib::PtJpsiBPbPb( Double_t *px, Double_t */*dummy*/)
212 Double_t x0 = 4.0384;
216 Double_t y = x / TMath::Power((1. + (x/x0)*(x/x0)), n);
222 Double_t AliGenMUONlib::PtJpsiPP( Double_t *px, Double_t */*dummy*/)
229 // mc = 1.4 GeV, pt-kick 1 GeV
232 Float_t c[4] = {8.47471e+00, -1.93567e+00, 1.50271e-01, -5.51212e-03};
238 while (j > 0) y = y * x +c[--j];
239 y = x * TMath::Exp(y);
248 //____________________________________________________________
249 Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t */*dummy*/)
252 const Double_t ky0 = 4.;
253 const Double_t kb=1.;
255 Double_t y=TMath::Abs(*py);
260 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
264 Double_t AliGenMUONlib::YJpsiFlat( Double_t */*py*/, Double_t */*dummy*/ )
270 Double_t AliGenMUONlib::YJpsiPbPb( Double_t *px, Double_t */*dummy*/)
280 // mc = 1.4 GeV, pt-kick 1 GeV
282 Double_t c[5] = {-6.03425e+02, 4.98257e+02, -1.38794e+02, 1.62209e+01, -6.85955e-01};
283 Double_t x = TMath::Abs(px[0]);
291 while (j > 0) y = y * x + c[--j];
299 Double_t AliGenMUONlib::YJpsiCDFscaled( Double_t *px, Double_t* dummy)
302 return AliGenMUONlib::YJpsiPbPb(px, dummy);
306 Double_t AliGenMUONlib::YJpsiPP( Double_t *px, Double_t */*dummy*/)
316 // mc = 1.4 GeV, pt-kick 1 GeV
319 Double_t c[5] = {1.38532e+00, 1.00596e+02, -3.46378e+01, 3.94172e+00, -1.48319e-01};
320 Double_t x = TMath::Abs(px[0]);
324 y = 96.455 - 0.8483 * x * x;
325 } else if (x < 7.9) {
328 while (j > 0) y = y * x + c[--j];
336 Double_t AliGenMUONlib::YJpsiBPbPb( Double_t *px, Double_t */*dummy*/)
340 // J/Psi from B->J/Psi X
345 Double_t c[7] = {7.37025e-02, 0., -2.94487e-03, 0., 6.07953e-06, 0., 5.39219e-07};
347 Double_t x = TMath::Abs(px[0]);
355 while (j > 0) y = y * x + c[--j];
363 // particle composition
365 Int_t AliGenMUONlib::IpJpsi(TRandom *)
370 Int_t AliGenMUONlib::IpPsiP(TRandom *)
372 // Psi prime composition
375 Int_t AliGenMUONlib::IpJpsiFamily(TRandom *)
379 Float_t r = gRandom->Rndm();
394 //____________________________________________________________
395 Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t */*dummy*/ )
398 const Double_t kpt0 = 5.3;
399 const Double_t kxn = 2.5;
402 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
403 return x/TMath::Power(pass1,kxn);
406 Double_t AliGenMUONlib::PtUpsilonCDFscaled( Double_t *px, Double_t */*dummy*/ )
409 const Double_t kpt0 = 7.753;
410 const Double_t kxn = 3.042;
413 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
414 return x/TMath::Power(pass1,kxn);
417 Double_t AliGenMUONlib::PtUpsilonFlat( Double_t */*px*/, Double_t */*dummy*/ )
422 Double_t AliGenMUONlib::PtUpsilonPbPb( Double_t *px, Double_t */*dummy*/)
432 // mc = 1.4 GeV, pt-kick 1 GeV
436 -1.03488e+01, 1.28065e+01, -6.60500e+00, 1.66140e+00,
437 -2.34293e-01, 1.86925e-02, -7.80708e-04, 1.30610e-05
443 while (j > 0) y = y * x +c[--j];
444 y = x * TMath::Exp(y);
451 Double_t AliGenMUONlib::PtUpsilonPP( Double_t *px, Double_t */*dummy*/)
461 // mc = 1.4 GeV, pt-kick 1 GeV
464 Double_t c[8] = {-7.93955e+00, 1.06306e+01, -5.21392e+00, 1.19703e+00,
465 -1.45718e-01, 8.95151e-03, -2.04806e-04, -1.13053e-06};
471 while (j > 0) y = y * x +c[--j];
472 y = x * TMath::Exp(y);
482 //____________________________________________________________
483 Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t */*dummy*/)
486 const Double_t ky0 = 3.;
487 const Double_t kb=1.;
489 Double_t y=TMath::Abs(*py);
494 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
499 Double_t AliGenMUONlib::YUpsilonPbPb( Double_t *px, Double_t */*dummy*/)
509 // mc = 1.4 GeV, pt-kick 1 GeV
512 Double_t c[7] = {3.40036e-01, -3.98882e-07, -4.48398e-03, 8.46411e-08, -6.10854e-04,
513 -2.99753e-09, 1.28895e-05};
516 if (TMath::Abs(x) > 5.55) return 0.;
518 Double_t y = c[j = 6];
519 while (j > 0) y = y * x +c[--j];
523 Double_t AliGenMUONlib::YUpsilonCDFscaled( Double_t *px, Double_t *dummy)
526 return AliGenMUONlib::YUpsilonPbPb(px, dummy);
529 Double_t AliGenMUONlib::YUpsilonFlat( Double_t */*px*/, Double_t */*dummy*/)
536 Double_t AliGenMUONlib::YUpsilonPP( Double_t *px, Double_t */*dummy*/)
546 // mc = 1.4 GeV, pt-kick 1 GeV
548 Double_t c[7] = {8.91936e-01, -6.46645e-07, -1.52774e-02, 4.28677e-08, -7.01517e-04,
549 -6.20539e-10, 1.29943e-05};
552 if (TMath::Abs(x) > 6.2) return 0.;
554 Double_t y = c[j = 6];
555 while (j > 0) y = y * x +c[--j];
559 // particle composition
561 Int_t AliGenMUONlib::IpUpsilon(TRandom *)
566 Int_t AliGenMUONlib::IpUpsilonP(TRandom *)
571 Int_t AliGenMUONlib::IpUpsilonPP(TRandom *)
576 Int_t AliGenMUONlib::IpUpsilonFamily(TRandom *)
580 Float_t r = gRandom->Rndm();
584 } else if (r < 0.896) {
597 // pt-distribution (by scaling of pion distribution)
598 //____________________________________________________________
599 Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t */*dummy*/)
602 return PtScal(*px,7);
605 Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t */*dummy*/)
609 return YJpsi(px,dum);
611 // particle composition
613 Int_t AliGenMUONlib::IpPhi(TRandom *)
623 // pt-distribution (by scaling of pion distribution)
624 //____________________________________________________________
625 Double_t AliGenMUONlib::PtOmega( Double_t *px, Double_t */*dummy*/)
628 return PtScal(*px,5);
631 Double_t AliGenMUONlib::YOmega( Double_t *px, Double_t */*dummy*/)
635 return YJpsi(px,dum);
637 // particle composition
639 Int_t AliGenMUONlib::IpOmega(TRandom *)
650 // pt-distribution (by scaling of pion distribution)
651 //____________________________________________________________
652 Double_t AliGenMUONlib::PtEta( Double_t *px, Double_t */*dummy*/)
655 return PtScal(*px,3);
658 Double_t AliGenMUONlib::YEta( Double_t *px, Double_t */*dummy*/)
662 return YJpsi(px,dum);
664 // particle composition
666 Int_t AliGenMUONlib::IpEta(TRandom *)
677 //____________________________________________________________
678 Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t */*dummy*/)
681 const Double_t kpt0 = 2.25;
682 const Double_t kxn = 3.17;
686 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
687 return x/TMath::Power(pass1,kxn);
690 Double_t AliGenMUONlib::PtCharmCentral( Double_t *px, Double_t */*dummy*/)
693 const Double_t kpt0 = 2.12;
694 const Double_t kxn = 2.78;
698 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
699 return x/TMath::Power(pass1,kxn);
702 Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t */*dummy*/)
704 // Charm y :: Carrer & Dainese : ALICE-INT-2003-019 v.3 (hep-ph/0311225)
705 // Pythia tuned to reproduce the distribution given by the HVQMNR program based on NLO calculations (pQCD)
706 // shadowing + kt broadening
709 Double_t c[2]={-2.42985e-03,-2.31001e-04};
710 Double_t y=1+(c[0]*TMath::Power(x,2))+(c[1]*TMath::Power(x,4));
713 if (TMath::Abs(x)>8) {
717 ycharm=TMath::Power(y,3);
724 Int_t AliGenMUONlib::IpCharm(TRandom *ran)
730 random = ran->Rndm();
731 // Taux de production Carrer & Dainese : ALICE-INT-2003-019 v.3
732 // >>>>> cf. tab 4 p 11
736 } else if (random < 0.60) {
738 } else if (random < 0.70) {
740 } else if (random < 0.80) {
742 } else if (random < 0.86) {
744 } else if (random < 0.92) {
746 } else if (random < 0.96) {
760 //____________________________________________________________
761 Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t */*dummy*/)
764 const Double_t kpt0 = 6.53;
765 const Double_t kxn = 3.59;
768 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
769 return x/TMath::Power(pass1,kxn);
772 Double_t AliGenMUONlib::PtBeautyCentral( Double_t *px, Double_t */*dummy*/)
775 const Double_t kpt0 = 6.14;
776 const Double_t kxn = 2.93;
779 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
780 return x/TMath::Power(pass1,kxn);
783 Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t */*dummy*/)
785 // Beauty y :: Carrer & Dainese : ALICE-INT-2003-019 v.3 (hep-ph/0311225)
786 // Pythia tuned to reproduce the distribution given by the HVQMNR program based on NLO calculations (pQCD)
787 // shadowing + kt broadening
790 Double_t c[2]={-1.27590e-02,-2.42731e-04};
791 Double_t y=1+c[0]*TMath::Power(x,2)+c[1]*TMath::Power(x,4);
794 if (TMath::Abs(x)>6) {
798 ybeauty=TMath::Power(y,3);
805 Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
807 // Beauty Composition
810 random = ran->Rndm();
812 // Taux de production Carrer & Dainese : ALICE-INT-2003-019 v.3
813 // >>>>> cf. tab 4 p 11
817 } else if (random < 0.40) {
819 } else if (random < 0.605) {
821 } else if (random < 0.81) {
823 } else if (random < 0.87) {
825 } else if (random < 0.93) {
827 } else if (random < 0.965) {
837 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
838 GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
840 // Return pointer to pT parameterisation
841 TString sname = TString(tname);
857 if (sname == "Vogt" || sname == "Vogt PbPb") {
859 } else if (sname == "Vogt pp") {
861 } else if (sname == "CDF scaled") {
862 func=PtJpsiCDFscaled;
863 } else if (sname == "Flat") {
876 if (sname == "Vogt" || sname == "Vogt PbPb") {
878 } else if (sname == "Vogt pp") {
880 } else if (sname == "CDF scaled") {
881 func=PtUpsilonCDFscaled;
882 } else if (sname == "Flat") {
889 if (sname == "central") {
896 if (sname == "central") {
897 func=PtBeautyCentral;
910 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
915 GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
918 // Return pointer to y- parameterisation
920 TString sname = TString(tname);
936 if (sname == "Vogt" || sname == "Vogt PbPb") {
938 } else if (sname == "Vogt pp"){
940 } else if (sname == "CDF scaled") {
942 } else if (sname == "Flat") {
955 if (sname == "Vogt" || sname == "Vogt PbPb") {
957 } else if (sname == "Vogt pp") {
959 } else if (sname == "CDF scaled") {
960 func=YUpsilonCDFscaled;
961 } else if (sname == "Flat") {
981 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
985 typedef Int_t (*GenFuncIp) (TRandom *);
986 GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* /*tname*/) const
988 // Return pointer to particle type parameterisation
1014 case kUpsilonFamily:
1015 func=IpUpsilonFamily;
1037 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
1044 Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0,
1049 // Neville's alorithm for interpolation
1055 // n: number of data points
1056 // no: order of polynom
1058 Float_t* c = new Float_t[n];
1059 Float_t* d = new Float_t[n];
1061 for (i = 0; i < n; i++) {
1066 Int_t ns = int((x - x0)/dx);
1070 for (m = 0; m < no; m++) {
1071 for (i = 0; i < n-m; i++) {
1072 Float_t ho = x0 + Float_t(i) * dx - x;
1073 Float_t hp = x0 + Float_t(i+m+1) * dx - x;
1074 Float_t w = c[i+1] - d[i];
1075 Float_t den = ho-hp;
1082 if (2*ns < (n-m-1)) {