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.19 2003/02/24 16:46:11 morsch
19 New parameterisation for Psi and Upsilon (PbPb)
21 Revision 1.18 2002/11/07 09:13:42 morsch
22 Use "Vogt" to label new distributions.
24 Revision 1.17 2002/11/07 09:06:10 morsch
25 J/Psi and Upsilon pt and y distributions from R. Vogt 2002 added.
27 Revision 1.16 2002/10/14 14:55:35 hristov
28 Merging the VirtualMC branch to the main development branch (HEAD)
30 Revision 1.14.6.1 2002/06/10 14:57:41 hristov
33 Revision 1.15 2002/04/17 10:11:51 morsch
34 Coding Rule violations corrected.
36 Revision 1.14 2002/02/22 17:26:43 morsch
39 Revision 1.13 2001/03/27 11:01:04 morsch
40 Charm pt-distribution corrected. More realistic y-distribution for pi and K.
42 Revision 1.12 2001/03/09 13:01:41 morsch
43 - enum constants for paramterisation type (particle family) moved to AliGen*lib.h
44 - use AliGenGSIlib::kUpsilon, AliGenPHOSlib::kEtaPrime to access the constants
46 Revision 1.11 2000/11/30 07:12:50 alibrary
47 Introducing new Rndm and QA classes
49 Revision 1.10 2000/06/29 21:08:27 morsch
50 All paramatrisation libraries derive from the pure virtual base class AliGenLib.
51 This allows to pass a pointer to a library directly to AliGenParam and avoids the
52 use of function pointers in Config.C.
54 Revision 1.9 2000/06/14 15:20:56 morsch
57 Revision 1.8 2000/06/09 20:32:11 morsch
58 All coding rule violations except RS3 corrected
60 Revision 1.7 2000/05/02 08:12:13 morsch
61 Coding rule violations corrected.
63 Revision 1.6 1999/09/29 09:24:14 fca
64 Introduction of the Copyright and cvs Log
68 // Library class for particle pt and y distributions used for
69 // muon spectrometer simulations.
70 // To be used with AliGenParam.
71 // The following particle typed can be simulated:
72 // pi, K, phi, omega, eta, J/Psi, Upsilon, charm and beauty mesons.
74 // andreas.morsch@cern.ch
80 #include "AliGenMUONlib.h"
82 ClassImp(AliGenMUONlib)
85 Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t *dummy)
88 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
89 // POWER LAW FOR PT > 500 MEV
90 // MT SCALING BELOW (T=160 MEV)
92 const Double_t kp0 = 1.3;
93 const Double_t kxn = 8.28;
94 const Double_t kxlim=0.5;
95 const Double_t kt=0.160;
96 const Double_t kxmpi=0.139;
98 Double_t y, y1, xmpi2, ynorm, a;
101 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
103 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
106 y=a*TMath::Power(kp0/(kp0+x),kxn);
108 y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
114 Double_t AliGenMUONlib::YPion( Double_t *py, Double_t *dummy)
117 Double_t y=TMath::Abs(*py);
119 const Double_t ka = 7000.;
120 const Double_t kdy = 4.;
121 Double_t ex = y*y/(2*kdy*kdy);
122 return ka*TMath::Exp(-ex);
124 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
127 // particle composition
129 Int_t AliGenMUONlib::IpPion(TRandom *ran)
132 if (ran->Rndm() < 0.5) {
139 //____________________________________________________________
143 Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np)
145 // SCALING EN MASSE PAR RAPPORT A PTPI
146 // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
147 const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
148 // VALUE MESON/PI AT 5 GEV
149 const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
151 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
152 Double_t fmax2=f5/kfmax[np];
154 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
155 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
156 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
157 return fmtscal*ptpion;
163 //____________________________________________________________
164 Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t *dummy)
167 return PtScal(*px,2);
171 //____________________________________________________________
172 Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t *dummy)
175 Double_t y=TMath::Abs(*py);
177 const Double_t ka = 1000.;
178 const Double_t kdy = 4.;
180 Double_t ex = y*y/(2*kdy*kdy);
181 return ka*TMath::Exp(-ex);
184 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
187 // particle composition
189 Int_t AliGenMUONlib::IpKaon(TRandom *ran)
192 if (ran->Rndm() < 0.5) {
203 //____________________________________________________________
204 Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t *dummy)
207 const Double_t kpt0 = 4.;
208 const Double_t kxn = 3.6;
211 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
212 return x/TMath::Power(pass1,kxn);
215 Double_t AliGenMUONlib::PtJpsiPbPb( Double_t *px, Double_t *dummy)
222 // mc = 1.4 GeV, pt-kick 1 GeV
226 -2.13098e+00, 9.46552e+00, -5.06799e+00, 1.27260e+00,
227 -1.83806e-01, 1.55853e-02, -7.23241e-04, 1.42105e-05
234 while (j > 0) y = y * x +c[--j];
235 y = x * TMath::Exp(y);
243 //____________________________________________________________
244 Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t *dummy)
247 const Double_t ky0 = 4.;
248 const Double_t kb=1.;
250 Double_t y=TMath::Abs(*py);
255 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
260 Double_t AliGenMUONlib::YJpsiPbPb( Double_t *px, Double_t *dummy)
270 // mc = 1.4 GeV, pt-kick 1 GeV
272 Double_t c[5] = {-6.03425e+02, 4.98257e+02, -1.38794e+02, 1.62209e+01, -6.85955e-01};
273 Double_t x = TMath::Abs(px[0]);
281 while (j > 0) y = y * x + c[--j];
289 // particle composition
291 Int_t AliGenMUONlib::IpJpsi(TRandom *)
301 //____________________________________________________________
302 Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t *dummy )
305 const Double_t kpt0 = 5.3;
306 const Double_t kxn = 2.5;
309 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
310 return x/TMath::Power(pass1,kxn);
313 Double_t AliGenMUONlib::PtUpsilonPbPb( Double_t *px, Double_t *dummy)
323 // mc = 1.4 GeV, pt-kick 1 GeV
327 -1.03488e+01, 1.28065e+01, -6.60500e+00, 1.66140e+00,
328 -2.34293e-01, 1.86925e-02, -7.80708e-04, 1.30610e-05
334 while (j > 0) y = y * x +c[--j];
335 y = x * TMath::Exp(y);
345 //____________________________________________________________
346 Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t *dummy)
349 const Double_t ky0 = 3.;
350 const Double_t kb=1.;
352 Double_t y=TMath::Abs(*py);
357 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
362 Double_t AliGenMUONlib::YUpsilonPbPb( Double_t *px, Double_t *dummy)
372 // mc = 1.4 GeV, pt-kick 1 GeV
375 Double_t c[7] = {3.40036e-01, -3.98882e-07, -4.48398e-03, 8.46411e-08, -6.10854e-04,
376 -2.99753e-09, 1.28895e-05};
379 if (TMath::Abs(x) > 5.55) return 0.;
381 Double_t y = c[j = 6];
382 while (j > 0) y = y * x +c[--j];
386 // particle composition
388 Int_t AliGenMUONlib::IpUpsilon(TRandom *)
398 // pt-distribution (by scaling of pion distribution)
399 //____________________________________________________________
400 Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t *dummy)
403 return PtScal(*px,7);
406 Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t *dummy)
410 return YJpsi(px,dum);
412 // particle composition
414 Int_t AliGenMUONlib::IpPhi(TRandom *)
424 // pt-distribution (by scaling of pion distribution)
425 //____________________________________________________________
426 Double_t AliGenMUONlib::PtOmega( Double_t *px, Double_t *dummy)
429 return PtScal(*px,5);
432 Double_t AliGenMUONlib::YOmega( Double_t *px, Double_t *dummy)
436 return YJpsi(px,dum);
438 // particle composition
440 Int_t AliGenMUONlib::IpOmega(TRandom *)
451 // pt-distribution (by scaling of pion distribution)
452 //____________________________________________________________
453 Double_t AliGenMUONlib::PtEta( Double_t *px, Double_t *dummy)
456 return PtScal(*px,3);
459 Double_t AliGenMUONlib::YEta( Double_t *px, Double_t *dummy)
463 return YJpsi(px,dum);
465 // particle composition
467 Int_t AliGenMUONlib::IpEta(TRandom *)
478 //____________________________________________________________
479 Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t *dummy)
482 const Double_t kpt0 = 4.08;
483 const Double_t kxn = 9.40;
487 Double_t pass1 = 1.+(x/kpt0);
488 return x/TMath::Power(pass1,kxn);
491 Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t *dummy)
495 return YJpsi(px,dum);
498 Int_t AliGenMUONlib::IpCharm(TRandom *ran)
504 random = ran->Rndm();
507 } else if (random < 0.75) {
509 } else if (random < 0.90) {
514 if (ran->Rndm() < 0.5) {ip=-ip;}
525 //____________________________________________________________
526 Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t *dummy)
529 const Double_t kpt0 = 4.;
530 const Double_t kxn = 3.6;
533 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
534 return x/TMath::Power(pass1,kxn);
537 Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t *dummy)
541 return YJpsi(px,dum);
544 Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
546 // Beauty Composition
549 random = ran->Rndm();
552 } else if (random < 0.75) {
554 } else if (random < 0.90) {
559 if (ran->Rndm() < 0.5) {ip=-ip;}
564 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
565 GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
567 // Return pointer to pT parameterisation
568 TString sname = TString(tname);
582 if (sname == "Vogt") {
589 if (sname == "Vogt") {
609 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
614 GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
616 TString sname = TString(tname);
618 // Return pointer to y- parameterisation
632 if (sname == "Vogt") {
639 if (sname == "Vogt") {
659 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
663 typedef Int_t (*GenFuncIp) (TRandom *);
664 GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* tname) const
666 // Return pointer to particle type parameterisation
699 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
706 Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0,
711 // Neville's alorithm for interpolation
717 // n: number of data points
718 // no: order of polynom
720 Float_t* c = new Float_t[n];
721 Float_t* d = new Float_t[n];
723 for (i = 0; i < n; i++) {
728 Int_t ns = int((x - x0)/dx);
732 for (m = 0; m < no; m++) {
733 for (i = 0; i < n-m; i++) {
734 Float_t ho = x0 + Float_t(i) * dx - x;
735 Float_t hp = x0 + Float_t(i+m+1) * dx - x;
736 Float_t w = c[i+1] - d[i];
744 if (2*ns < (n-m-1)) {