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 Revision 1.20 2003/03/13 11:54:39 morsch
19 Limited pT range for parameterized Upsilon and J/Psi pT distributions.
21 Revision 1.19 2003/02/24 16:46:11 morsch
22 New parameterisation for Psi and Upsilon (PbPb)
24 Revision 1.18 2002/11/07 09:13:42 morsch
25 Use "Vogt" to label new distributions.
27 Revision 1.17 2002/11/07 09:06:10 morsch
28 J/Psi and Upsilon pt and y distributions from R. Vogt 2002 added.
30 Revision 1.16 2002/10/14 14:55:35 hristov
31 Merging the VirtualMC branch to the main development branch (HEAD)
33 Revision 1.14.6.1 2002/06/10 14:57:41 hristov
36 Revision 1.15 2002/04/17 10:11:51 morsch
37 Coding Rule violations corrected.
39 Revision 1.14 2002/02/22 17:26:43 morsch
42 Revision 1.13 2001/03/27 11:01:04 morsch
43 Charm pt-distribution corrected. More realistic y-distribution for pi and K.
45 Revision 1.12 2001/03/09 13:01:41 morsch
46 - enum constants for paramterisation type (particle family) moved to AliGen*lib.h
47 - use AliGenGSIlib::kUpsilon, AliGenPHOSlib::kEtaPrime to access the constants
49 Revision 1.11 2000/11/30 07:12:50 alibrary
50 Introducing new Rndm and QA classes
52 Revision 1.10 2000/06/29 21:08:27 morsch
53 All paramatrisation libraries derive from the pure virtual base class AliGenLib.
54 This allows to pass a pointer to a library directly to AliGenParam and avoids the
55 use of function pointers in Config.C.
57 Revision 1.9 2000/06/14 15:20:56 morsch
60 Revision 1.8 2000/06/09 20:32:11 morsch
61 All coding rule violations except RS3 corrected
63 Revision 1.7 2000/05/02 08:12:13 morsch
64 Coding rule violations corrected.
66 Revision 1.6 1999/09/29 09:24:14 fca
67 Introduction of the Copyright and cvs Log
71 // Library class for particle pt and y distributions used for
72 // muon spectrometer simulations.
73 // To be used with AliGenParam.
74 // The following particle typed can be simulated:
75 // pi, K, phi, omega, eta, J/Psi, Upsilon, charm and beauty mesons.
77 // andreas.morsch@cern.ch
83 #include "AliGenMUONlib.h"
85 ClassImp(AliGenMUONlib)
88 Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t *dummy)
91 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
92 // POWER LAW FOR PT > 500 MEV
93 // MT SCALING BELOW (T=160 MEV)
95 const Double_t kp0 = 1.3;
96 const Double_t kxn = 8.28;
97 const Double_t kxlim=0.5;
98 const Double_t kt=0.160;
99 const Double_t kxmpi=0.139;
100 const Double_t kb=1.;
101 Double_t y, y1, xmpi2, ynorm, a;
104 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
106 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
109 y=a*TMath::Power(kp0/(kp0+x),kxn);
111 y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
117 Double_t AliGenMUONlib::YPion( Double_t *py, Double_t *dummy)
120 Double_t y=TMath::Abs(*py);
122 const Double_t ka = 7000.;
123 const Double_t kdy = 4.;
124 Double_t ex = y*y/(2*kdy*kdy);
125 return ka*TMath::Exp(-ex);
127 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
130 // particle composition
132 Int_t AliGenMUONlib::IpPion(TRandom *ran)
135 if (ran->Rndm() < 0.5) {
142 //____________________________________________________________
146 Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np)
148 // SCALING EN MASSE PAR RAPPORT A PTPI
149 // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
150 const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
151 // VALUE MESON/PI AT 5 GEV
152 const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
154 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
155 Double_t fmax2=f5/kfmax[np];
157 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
158 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
159 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
160 return fmtscal*ptpion;
166 //____________________________________________________________
167 Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t *dummy)
170 return PtScal(*px,2);
174 //____________________________________________________________
175 Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t *dummy)
178 Double_t y=TMath::Abs(*py);
180 const Double_t ka = 1000.;
181 const Double_t kdy = 4.;
183 Double_t ex = y*y/(2*kdy*kdy);
184 return ka*TMath::Exp(-ex);
187 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
190 // particle composition
192 Int_t AliGenMUONlib::IpKaon(TRandom *ran)
195 if (ran->Rndm() < 0.5) {
206 //____________________________________________________________
207 Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t *dummy)
210 const Double_t kpt0 = 4.;
211 const Double_t kxn = 3.6;
214 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
215 return x/TMath::Power(pass1,kxn);
218 Double_t AliGenMUONlib::PtJpsiPbPb( Double_t *px, Double_t *dummy)
225 // mc = 1.4 GeV, pt-kick 1 GeV
229 -2.13098e+00, 9.46552e+00, -5.06799e+00, 1.27260e+00,
230 -1.83806e-01, 1.55853e-02, -7.23241e-04, 1.42105e-05
237 while (j > 0) y = y * x +c[--j];
238 y = x * TMath::Exp(y);
244 Double_t AliGenMUONlib::PtJpsiPP( Double_t *px, Double_t *dummy)
251 // mc = 1.4 GeV, pt-kick 1 GeV
254 Float_t c[4] = {8.47471e+00, -1.93567e+00, 1.50271e-01, -5.51212e-03};
260 while (j > 0) y = y * x +c[--j];
261 y = x * TMath::Exp(y);
270 //____________________________________________________________
271 Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t *dummy)
274 const Double_t ky0 = 4.;
275 const Double_t kb=1.;
277 Double_t y=TMath::Abs(*py);
282 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
287 Double_t AliGenMUONlib::YJpsiPbPb( Double_t *px, Double_t *dummy)
297 // mc = 1.4 GeV, pt-kick 1 GeV
299 Double_t c[5] = {-6.03425e+02, 4.98257e+02, -1.38794e+02, 1.62209e+01, -6.85955e-01};
300 Double_t x = TMath::Abs(px[0]);
308 while (j > 0) y = y * x + c[--j];
316 Double_t AliGenMUONlib::YJpsiPP( Double_t *px, Double_t *dummy)
326 // mc = 1.4 GeV, pt-kick 1 GeV
329 Double_t c[5] = {1.38532e+00, 1.00596e+02, -3.46378e+01, 3.94172e+00, -1.48319e-01};
330 Double_t x = TMath::Abs(px[0]);
334 y = 96.455 - 0.8483 * x * x;
335 } else if (x < 7.9) {
338 while (j > 0) y = y * x + c[--j];
346 // particle composition
348 Int_t AliGenMUONlib::IpJpsi(TRandom *)
358 //____________________________________________________________
359 Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t *dummy )
362 const Double_t kpt0 = 5.3;
363 const Double_t kxn = 2.5;
366 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
367 return x/TMath::Power(pass1,kxn);
370 Double_t AliGenMUONlib::PtUpsilonPbPb( Double_t *px, Double_t *dummy)
380 // mc = 1.4 GeV, pt-kick 1 GeV
384 -1.03488e+01, 1.28065e+01, -6.60500e+00, 1.66140e+00,
385 -2.34293e-01, 1.86925e-02, -7.80708e-04, 1.30610e-05
391 while (j > 0) y = y * x +c[--j];
392 y = x * TMath::Exp(y);
399 Double_t AliGenMUONlib::PtUpsilonPP( Double_t *px, Double_t *dummy)
409 // mc = 1.4 GeV, pt-kick 1 GeV
412 Double_t c[8] = {-7.93955e+00, 1.06306e+01, -5.21392e+00, 1.19703e+00,
413 -1.45718e-01, 8.95151e-03, -2.04806e-04, -1.13053e-06};
419 while (j > 0) y = y * x +c[--j];
420 y = x * TMath::Exp(y);
430 //____________________________________________________________
431 Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t *dummy)
434 const Double_t ky0 = 3.;
435 const Double_t kb=1.;
437 Double_t y=TMath::Abs(*py);
442 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
447 Double_t AliGenMUONlib::YUpsilonPbPb( Double_t *px, Double_t *dummy)
457 // mc = 1.4 GeV, pt-kick 1 GeV
460 Double_t c[7] = {3.40036e-01, -3.98882e-07, -4.48398e-03, 8.46411e-08, -6.10854e-04,
461 -2.99753e-09, 1.28895e-05};
464 if (TMath::Abs(x) > 5.55) return 0.;
466 Double_t y = c[j = 6];
467 while (j > 0) y = y * x +c[--j];
471 Double_t AliGenMUONlib::YUpsilonPP( Double_t *px, Double_t *dummy)
481 // mc = 1.4 GeV, pt-kick 1 GeV
483 Double_t c[7] = {8.91936e-01, -6.46645e-07, -1.52774e-02, 4.28677e-08, -7.01517e-04,
484 -6.20539e-10, 1.29943e-05};
487 if (TMath::Abs(x) > 6.2) return 0.;
489 Double_t y = c[j = 6];
490 while (j > 0) y = y * x +c[--j];
494 // particle composition
496 Int_t AliGenMUONlib::IpUpsilon(TRandom *)
506 // pt-distribution (by scaling of pion distribution)
507 //____________________________________________________________
508 Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t *dummy)
511 return PtScal(*px,7);
514 Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t *dummy)
518 return YJpsi(px,dum);
520 // particle composition
522 Int_t AliGenMUONlib::IpPhi(TRandom *)
532 // pt-distribution (by scaling of pion distribution)
533 //____________________________________________________________
534 Double_t AliGenMUONlib::PtOmega( Double_t *px, Double_t *dummy)
537 return PtScal(*px,5);
540 Double_t AliGenMUONlib::YOmega( Double_t *px, Double_t *dummy)
544 return YJpsi(px,dum);
546 // particle composition
548 Int_t AliGenMUONlib::IpOmega(TRandom *)
559 // pt-distribution (by scaling of pion distribution)
560 //____________________________________________________________
561 Double_t AliGenMUONlib::PtEta( Double_t *px, Double_t *dummy)
564 return PtScal(*px,3);
567 Double_t AliGenMUONlib::YEta( Double_t *px, Double_t *dummy)
571 return YJpsi(px,dum);
573 // particle composition
575 Int_t AliGenMUONlib::IpEta(TRandom *)
586 //____________________________________________________________
587 Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t *dummy)
590 const Double_t kpt0 = 4.08;
591 const Double_t kxn = 9.40;
595 Double_t pass1 = 1.+(x/kpt0);
596 return x/TMath::Power(pass1,kxn);
599 Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t *dummy)
603 return YJpsi(px,dum);
606 Int_t AliGenMUONlib::IpCharm(TRandom *ran)
612 random = ran->Rndm();
615 } else if (random < 0.75) {
617 } else if (random < 0.90) {
622 if (ran->Rndm() < 0.5) {ip=-ip;}
633 //____________________________________________________________
634 Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t *dummy)
637 const Double_t kpt0 = 4.;
638 const Double_t kxn = 3.6;
641 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
642 return x/TMath::Power(pass1,kxn);
645 Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t *dummy)
649 return YJpsi(px,dum);
652 Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
654 // Beauty Composition
657 random = ran->Rndm();
660 } else if (random < 0.75) {
662 } else if (random < 0.90) {
667 if (ran->Rndm() < 0.5) {ip=-ip;}
672 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
673 GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
675 // Return pointer to pT parameterisation
676 TString sname = TString(tname);
690 if (sname == "Vogt" || sname == "Vogt PbPb") {
692 } else if (sname == "Vogt pp") {
699 if (sname == "Vogt" || sname == "Vogt PbPb") {
701 } else if (sname == "Vogt pp") {
721 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
726 GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
728 TString sname = TString(tname);
730 // Return pointer to y- parameterisation
744 if (sname == "Vogt" || sname == "Vogt PbPb") {
746 } else if (sname == "Vogt pp"){
754 if (sname == "Vogt" || sname == "Vogt PbPb") {
756 } else if (sname == "Vogt pp") {
776 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
780 typedef Int_t (*GenFuncIp) (TRandom *);
781 GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* tname) const
783 // Return pointer to particle type parameterisation
816 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
823 Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0,
828 // Neville's alorithm for interpolation
834 // n: number of data points
835 // no: order of polynom
837 Float_t* c = new Float_t[n];
838 Float_t* d = new Float_t[n];
840 for (i = 0; i < n; i++) {
845 Int_t ns = int((x - x0)/dx);
849 for (m = 0; m < no; m++) {
850 for (i = 0; i < n-m; i++) {
851 Float_t ho = x0 + Float_t(i) * dx - x;
852 Float_t hp = x0 + Float_t(i+m+1) * dx - x;
853 Float_t w = c[i+1] - d[i];
861 if (2*ns < (n-m-1)) {