]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenMUONlib.cxx
22-jun-2005 NvE Specific job folder recursively removed from the generic AliJob folde...
[u/mrichter/AliRoot.git] / EVGEN / AliGenMUONlib.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
88cb7938 16/* $Id$ */
4c039060 17
53904666 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.
23//
24// andreas.morsch@cern.ch
25//
26
65fb704d 27#include "TMath.h"
28#include "TRandom.h"
29
fe4da5cc 30#include "AliGenMUONlib.h"
5c3fd7ea 31
fe4da5cc 32ClassImp(AliGenMUONlib)
33//
34// Pions
198bb1c7 35Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t* /*dummy*/)
fe4da5cc 36{
37//
38// PT-PARAMETERIZATION CDF, PRL 61(88) 1819
39// POWER LAW FOR PT > 500 MEV
40// MT SCALING BELOW (T=160 MEV)
41//
d90f80fd 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;
47 const Double_t kb=1.;
fe4da5cc 48 Double_t y, y1, xmpi2, ynorm, a;
49 Double_t x=*px;
50 //
d90f80fd 51 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
52 xmpi2=kxmpi*kxmpi;
53 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
fe4da5cc 54 a=ynorm/y1;
d90f80fd 55 if (x > kxlim)
56 y=a*TMath::Power(kp0/(kp0+x),kxn);
fe4da5cc 57 else
d90f80fd 58 y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
fe4da5cc 59 return y*x;
60}
753690b0 61//
62// y-distribution
63//
198bb1c7 64Double_t AliGenMUONlib::YPion( Double_t *py, Double_t */*dummy*/)
753690b0 65{
d90f80fd 66// Pion y
2280e6af 67 Double_t y=TMath::Abs(*py);
68/*
d90f80fd 69 const Double_t ka = 7000.;
70 const Double_t kdy = 4.;
d90f80fd 71 Double_t ex = y*y/(2*kdy*kdy);
72 return ka*TMath::Exp(-ex);
2280e6af 73*/
74 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
75
753690b0 76}
77// particle composition
78//
65fb704d 79Int_t AliGenMUONlib::IpPion(TRandom *ran)
753690b0 80{
d90f80fd 81// Pion composition
65fb704d 82 if (ran->Rndm() < 0.5) {
753690b0 83 return 211;
84 } else {
85 return -211;
86 }
87}
fe4da5cc 88
89//____________________________________________________________
90//
91// Mt-scaling
92
93Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np)
94{
95 // SCALING EN MASSE PAR RAPPORT A PTPI
96 // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
d90f80fd 97 const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
fe4da5cc 98 // VALUE MESON/PI AT 5 GEV
d90f80fd 99 const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
fe4da5cc 100 np--;
d90f80fd 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];
fe4da5cc 103 // PIONS
104 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
105 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
d90f80fd 106 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
fe4da5cc 107 return fmtscal*ptpion;
108}
109//
753690b0 110// kaon
111//
112// pt-distribution
113//____________________________________________________________
198bb1c7 114Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t */*dummy*/)
753690b0 115{
d90f80fd 116// Kaon pT
753690b0 117 return PtScal(*px,2);
118}
119
120// y-distribution
fe4da5cc 121//____________________________________________________________
198bb1c7 122Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t */*dummy*/)
fe4da5cc 123{
d90f80fd 124// Kaon y
2280e6af 125 Double_t y=TMath::Abs(*py);
126/*
d90f80fd 127 const Double_t ka = 1000.;
128 const Double_t kdy = 4.;
fe4da5cc 129 //
d90f80fd 130 Double_t ex = y*y/(2*kdy*kdy);
131 return ka*TMath::Exp(-ex);
2280e6af 132*/
133
134 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
753690b0 135}
136
137// particle composition
138//
65fb704d 139Int_t AliGenMUONlib::IpKaon(TRandom *ran)
753690b0 140{
d90f80fd 141// Kaon composition
65fb704d 142 if (ran->Rndm() < 0.5) {
753690b0 143 return 321;
144 } else {
145 return -321;
146 }
fe4da5cc 147}
753690b0 148
fe4da5cc 149// J/Psi
150//
151//
152// pt-distribution
153//____________________________________________________________
198bb1c7 154Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t */*dummy*/)
fe4da5cc 155{
d90f80fd 156// J/Psi pT
157 const Double_t kpt0 = 4.;
158 const Double_t kxn = 3.6;
fe4da5cc 159 Double_t x=*px;
160 //
d90f80fd 161 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
162 return x/TMath::Power(pass1,kxn);
fe4da5cc 163}
05932df6 164
0e137c25 165Double_t AliGenMUONlib::PtJpsiCDFscaled( Double_t *px, Double_t */*dummy*/)
166{
167// J/Psi pT
48416d65 168 const Double_t kpt0 = 4.703;
169 const Double_t kxn = 3.826;
0e137c25 170 Double_t x=*px;
171 //
172 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
173 return x/TMath::Power(pass1,kxn);
174}
175
198bb1c7 176Double_t AliGenMUONlib::PtJpsiPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 177{
1af7144e 178// J/Psi pT spectrum
05932df6 179//
180// R. Vogt 2002
181// PbPb 5.5 TeV
182// MRST HO
183// mc = 1.4 GeV, pt-kick 1 GeV
184//
1af7144e 185 Float_t x = px[0];
186 Float_t c[8] = {
187 -2.13098e+00, 9.46552e+00, -5.06799e+00, 1.27260e+00,
188 -1.83806e-01, 1.55853e-02, -7.23241e-04, 1.42105e-05
05932df6 189 };
1af7144e 190
3d905dd7 191 Double_t y;
0e137c25 192 if (x < 15.) {
3d905dd7 193 Int_t j;
194 y = c[j = 7];
195 while (j > 0) y = y * x +c[--j];
196 y = x * TMath::Exp(y);
197 } else {
198 y = 0.;
199 }
1af7144e 200 return y;
05932df6 201}
17d28ba5 202
203Double_t AliGenMUONlib::PtJpsiBPbPb( Double_t *px, Double_t */*dummy*/)
204{
205// J/Psi pT spectrum
206// B -> J/Psi X
207 Double_t x0 = 4.0384;
208 Double_t n = 3.0288;
209
210 Double_t x = px[0];
211 Double_t y = x / TMath::Power((1. + (x/x0)*(x/x0)), n);
212
213 return y;
214}
215
216
198bb1c7 217Double_t AliGenMUONlib::PtJpsiPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 218{
219// J/Psi pT spectrum
220//
221// R. Vogt 2002
222// pp 14 TeV
223// MRST HO
224// mc = 1.4 GeV, pt-kick 1 GeV
225//
226 Float_t x = px[0];
227 Float_t c[4] = {8.47471e+00, -1.93567e+00, 1.50271e-01, -5.51212e-03};
228
229 Double_t y;
230 if (x < 10.) {
231 Int_t j;
232 y = c[j = 3];
233 while (j > 0) y = y * x +c[--j];
234 y = x * TMath::Exp(y);
235 } else {
236 y = 0.;
237 }
238 return y;
239}
240
fe4da5cc 241//
242// y-distribution
243//____________________________________________________________
198bb1c7 244Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t */*dummy*/)
fe4da5cc 245{
d90f80fd 246// J/psi y
247 const Double_t ky0 = 4.;
248 const Double_t kb=1.;
fe4da5cc 249 Double_t yj;
250 Double_t y=TMath::Abs(*py);
251 //
d90f80fd 252 if (y < ky0)
253 yj=kb;
fe4da5cc 254 else
d90f80fd 255 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
fe4da5cc 256 return yj;
257}
05932df6 258
259
198bb1c7 260Double_t AliGenMUONlib::YJpsiPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 261{
262
263//
264// J/Psi y
265//
266//
267// R. Vogt 2002
268// PbPb 5.5 TeV
269// MRST HO
270// mc = 1.4 GeV, pt-kick 1 GeV
271//
1af7144e 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]);
274 Double_t y;
275
276 if (x < 4.) {
277 y = 31.754;
278 } else if (x < 6) {
279 Int_t j;
280 y = c[j = 4];
281 while (j > 0) y = y * x + c[--j];
282 } else {
283 y =0.;
284 }
285
286 return y;
05932df6 287}
288
0e137c25 289Double_t AliGenMUONlib::YJpsiCDFscaled( Double_t *px, Double_t* dummy)
290{
291 // J/Psi y
292 return AliGenMUONlib::YJpsiPbPb(px, dummy);
293}
294
295
198bb1c7 296Double_t AliGenMUONlib::YJpsiPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 297{
298
299//
300// J/Psi y
301//
302//
303// R. Vogt 2002
304// pp 14 TeV
305// MRST HO
306// mc = 1.4 GeV, pt-kick 1 GeV
307//
308
309 Double_t c[5] = {1.38532e+00, 1.00596e+02, -3.46378e+01, 3.94172e+00, -1.48319e-01};
310 Double_t x = TMath::Abs(px[0]);
311 Double_t y;
312
313 if (x < 2.5) {
314 y = 96.455 - 0.8483 * x * x;
315 } else if (x < 7.9) {
316 Int_t j;
317 y = c[j = 4];
318 while (j > 0) y = y * x + c[--j];
319 } else {
320 y =0.;
321 }
322
323 return y;
324}
325
17d28ba5 326Double_t AliGenMUONlib::YJpsiBPbPb( Double_t *px, Double_t */*dummy*/)
327{
328
329//
330// J/Psi from B->J/Psi X
331//
332//
333
334
335 Double_t c[7] = {7.37025e-02, 0., -2.94487e-03, 0., 6.07953e-06, 0., 5.39219e-07};
336
337 Double_t x = TMath::Abs(px[0]);
338 Double_t y;
339
340 if (x > 6.) {
341 y = 0.;
342 } else {
343 Int_t j;
344 y = c[j = 6];
345 while (j > 0) y = y * x + c[--j];
346 }
347
348 return y;
349}
350
351
352
fe4da5cc 353// particle composition
354//
65fb704d 355Int_t AliGenMUONlib::IpJpsi(TRandom *)
fe4da5cc 356{
d90f80fd 357// J/Psi composition
88cb7938 358 return 443;
fe4da5cc 359}
88e5db43 360Int_t AliGenMUONlib::IpPsiP(TRandom *)
361{
362// Psi prime composition
363 return 100443;
364}
0ad09590 365Int_t AliGenMUONlib::IpJpsiFamily(TRandom *)
366{
367// J/Psi composition
368 Int_t ip;
369 Float_t r = gRandom->Rndm();
370 if (r < 0.98) {
371 ip = 443;
372 } else {
373 ip = 100443;
374 }
375 return ip;
376}
377
fe4da5cc 378
88e5db43 379
fe4da5cc 380// Upsilon
381//
382//
383// pt-distribution
384//____________________________________________________________
198bb1c7 385Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t */*dummy*/ )
fe4da5cc 386{
d90f80fd 387// Upsilon pT
388 const Double_t kpt0 = 5.3;
389 const Double_t kxn = 2.5;
fe4da5cc 390 Double_t x=*px;
391 //
d90f80fd 392 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
393 return x/TMath::Power(pass1,kxn);
fe4da5cc 394}
05932df6 395
0e137c25 396Double_t AliGenMUONlib::PtUpsilonCDFscaled( Double_t *px, Double_t */*dummy*/ )
397{
398// Upsilon pT
48416d65 399 const Double_t kpt0 = 7.753;
400 const Double_t kxn = 3.042;
0e137c25 401 Double_t x=*px;
402 //
403 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
404 return x/TMath::Power(pass1,kxn);
405}
406
198bb1c7 407Double_t AliGenMUONlib::PtUpsilonPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 408{
409
410//
411// Upsilon pT
412//
413//
414// R. Vogt 2002
415// PbPb 5.5 TeV
416// MRST HO
417// mc = 1.4 GeV, pt-kick 1 GeV
418//
1af7144e 419 Float_t x = px[0];
420 Double_t c[8] = {
421 -1.03488e+01, 1.28065e+01, -6.60500e+00, 1.66140e+00,
422 -2.34293e-01, 1.86925e-02, -7.80708e-04, 1.30610e-05
423 };
3d905dd7 424 Double_t y;
425 if (x < 10.) {
426 Int_t j;
427 y = c[j = 7];
428 while (j > 0) y = y * x +c[--j];
429 y = x * TMath::Exp(y);
430 } else {
431 y = 0.;
432 }
1af7144e 433 return y;
05932df6 434}
435
198bb1c7 436Double_t AliGenMUONlib::PtUpsilonPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 437{
438
439//
440// Upsilon pT
441//
442//
443// R. Vogt 2002
444// pp 14 TeV
445// MRST HO
446// mc = 1.4 GeV, pt-kick 1 GeV
447//
448 Float_t x = px[0];
449 Double_t c[8] = {-7.93955e+00, 1.06306e+01, -5.21392e+00, 1.19703e+00,
450 -1.45718e-01, 8.95151e-03, -2.04806e-04, -1.13053e-06};
451
452 Double_t y;
453 if (x < 10.) {
454 Int_t j;
455 y = c[j = 7];
456 while (j > 0) y = y * x +c[--j];
457 y = x * TMath::Exp(y);
458 } else {
459 y = 0.;
460 }
461 return y;
462}
463
fe4da5cc 464//
465// y-distribution
466//
467//____________________________________________________________
198bb1c7 468Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t */*dummy*/)
fe4da5cc 469{
d90f80fd 470// Upsilon y
471 const Double_t ky0 = 3.;
472 const Double_t kb=1.;
fe4da5cc 473 Double_t yu;
474 Double_t y=TMath::Abs(*py);
475 //
d90f80fd 476 if (y < ky0)
477 yu=kb;
fe4da5cc 478 else
d90f80fd 479 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
fe4da5cc 480 return yu;
481}
05932df6 482
483
198bb1c7 484Double_t AliGenMUONlib::YUpsilonPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 485{
486
487//
488// Upsilon y
489//
490//
491// R. Vogt 2002
492// PbPb 5.5 TeV
493// MRST HO
494// mc = 1.4 GeV, pt-kick 1 GeV
495//
496
1af7144e 497 Double_t c[7] = {3.40036e-01, -3.98882e-07, -4.48398e-03, 8.46411e-08, -6.10854e-04,
498 -2.99753e-09, 1.28895e-05};
499
500 Double_t x = px[0];
501 if (TMath::Abs(x) > 5.55) return 0.;
502 Int_t j;
503 Double_t y = c[j = 6];
504 while (j > 0) y = y * x +c[--j];
505 return y;
05932df6 506}
507
0e137c25 508Double_t AliGenMUONlib::YUpsilonCDFscaled( Double_t *px, Double_t *dummy)
509{
510 // Upsilon y
511 return AliGenMUONlib::YUpsilonPbPb(px, dummy);
512
513}
514
198bb1c7 515Double_t AliGenMUONlib::YUpsilonPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 516{
517
518//
519// Upsilon y
520//
521//
522// R. Vogt 2002
523// p p 14. TeV
524// MRST HO
525// mc = 1.4 GeV, pt-kick 1 GeV
526//
527 Double_t c[7] = {8.91936e-01, -6.46645e-07, -1.52774e-02, 4.28677e-08, -7.01517e-04,
528 -6.20539e-10, 1.29943e-05};
529
530 Double_t x = px[0];
531 if (TMath::Abs(x) > 6.2) return 0.;
532 Int_t j;
533 Double_t y = c[j = 6];
534 while (j > 0) y = y * x +c[--j];
535 return y;
536}
537
fe4da5cc 538// particle composition
539//
65fb704d 540Int_t AliGenMUONlib::IpUpsilon(TRandom *)
fe4da5cc 541{
d90f80fd 542// y composition
88cb7938 543 return 553;
fe4da5cc 544}
88e5db43 545Int_t AliGenMUONlib::IpUpsilonP(TRandom *)
546{
547// y composition
548 return 100553;
549}
550Int_t AliGenMUONlib::IpUpsilonPP(TRandom *)
551{
552// y composition
553 return 200553;
554}
0ad09590 555Int_t AliGenMUONlib::IpUpsilonFamily(TRandom *)
556{
557// y composition
558 Int_t ip;
559 Float_t r = gRandom->Rndm();
560
561 if (r < 0.712) {
562 ip = 553;
563 } else if (r < 0.896) {
564 ip = 100553;
565 } else {
566 ip = 200553;
567 }
568 return ip;
569}
fe4da5cc 570
88e5db43 571
fe4da5cc 572//
573// Phi
574//
575//
576// pt-distribution (by scaling of pion distribution)
577//____________________________________________________________
198bb1c7 578Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t */*dummy*/)
fe4da5cc 579{
d90f80fd 580// Phi pT
fe4da5cc 581 return PtScal(*px,7);
582}
583// y-distribution
198bb1c7 584Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t */*dummy*/)
fe4da5cc 585{
d90f80fd 586// Phi y
587 Double_t *dum=0;
588 return YJpsi(px,dum);
fe4da5cc 589}
590// particle composition
591//
65fb704d 592Int_t AliGenMUONlib::IpPhi(TRandom *)
fe4da5cc 593{
d90f80fd 594// Phi composition
89512a3b 595 return 333;
596}
597
598//
599// omega
600//
601//
602// pt-distribution (by scaling of pion distribution)
603//____________________________________________________________
198bb1c7 604Double_t AliGenMUONlib::PtOmega( Double_t *px, Double_t */*dummy*/)
89512a3b 605{
606// Omega pT
607 return PtScal(*px,5);
608}
609// y-distribution
198bb1c7 610Double_t AliGenMUONlib::YOmega( Double_t *px, Double_t */*dummy*/)
89512a3b 611{
612// Omega y
613 Double_t *dum=0;
614 return YJpsi(px,dum);
615}
616// particle composition
617//
618Int_t AliGenMUONlib::IpOmega(TRandom *)
619{
620// Omega composition
621 return 223;
622}
623
624
625//
626// Eta
627//
628//
629// pt-distribution (by scaling of pion distribution)
630//____________________________________________________________
198bb1c7 631Double_t AliGenMUONlib::PtEta( Double_t *px, Double_t */*dummy*/)
89512a3b 632{
633// Eta pT
634 return PtScal(*px,3);
635}
636// y-distribution
198bb1c7 637Double_t AliGenMUONlib::YEta( Double_t *px, Double_t */*dummy*/)
89512a3b 638{
639// Eta y
640 Double_t *dum=0;
641 return YJpsi(px,dum);
642}
643// particle composition
644//
645Int_t AliGenMUONlib::IpEta(TRandom *)
646{
647// Eta composition
648 return 221;
fe4da5cc 649}
650
651//
652// Charm
653//
654//
655// pt-distribution
656//____________________________________________________________
198bb1c7 657Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t */*dummy*/)
fe4da5cc 658{
d90f80fd 659// Charm pT
bd0276a8 660 const Double_t kpt0 = 2.25;
661 const Double_t kxn = 3.17;
2280e6af 662
fe4da5cc 663 Double_t x=*px;
664 //
bd0276a8 665 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
666 return x/TMath::Power(pass1,kxn);
667}
668
669Double_t AliGenMUONlib::PtCharmCentral( Double_t *px, Double_t */*dummy*/)
670{
671// Charm pT
672 const Double_t kpt0 = 2.12;
673 const Double_t kxn = 2.78;
674
675 Double_t x=*px;
676 //
677 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
d90f80fd 678 return x/TMath::Power(pass1,kxn);
fe4da5cc 679}
680// y-distribution
198bb1c7 681Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t */*dummy*/)
fe4da5cc 682{
ec772ba2 683// Charm y :: Carrer & Dainese : ALICE-INT-2003-019 v.3 (hep-ph/0311225)
684// Pythia tuned to reproduce the distribution given by the HVQMNR program based on NLO calculations (pQCD)
685// shadowing + kt broadening
686
687 Double_t x=px[0];
688 Double_t c[2]={-2.42985e-03,-2.31001e-04};
689 Double_t y=1+(c[0]*TMath::Power(x,2))+(c[1]*TMath::Power(x,4));
690 Double_t ycharm;
691
692 if (TMath::Abs(x)>8) {
693 ycharm=0.;
694 }
695 else {
696 ycharm=TMath::Power(y,3);
697 }
698
699 return ycharm;
fe4da5cc 700}
701
ec772ba2 702
65fb704d 703Int_t AliGenMUONlib::IpCharm(TRandom *ran)
fe4da5cc 704{
d90f80fd 705// Charm composition
65fb704d 706 Float_t random;
fe4da5cc 707 Int_t ip;
708// 411,421,431,4122
65fb704d 709 random = ran->Rndm();
ec772ba2 710// Taux de production Carrer & Dainese : ALICE-INT-2003-019 v.3
711// >>>>> cf. tab 4 p 11
712
713 if (random < 0.30) {
714 ip=421;
715 } else if (random < 0.60) {
716 ip=-421;
717 } else if (random < 0.70) {
718 ip=411;
719 } else if (random < 0.80) {
720 ip=-411;
721 } else if (random < 0.86) {
722 ip=431;
723 } else if (random < 0.92) {
724 ip=-431;
725 } else if (random < 0.96) {
726 ip=4122;
fe4da5cc 727 } else {
ec772ba2 728 ip=-4122;
fe4da5cc 729 }
fe4da5cc 730
731 return ip;
732}
733
fe4da5cc 734//
735// Beauty
736//
737//
738// pt-distribution
739//____________________________________________________________
198bb1c7 740Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 741{
d90f80fd 742// Beauty pT
bd0276a8 743 const Double_t kpt0 = 6.53;
744 const Double_t kxn = 3.59;
745 Double_t x=*px;
746 //
747 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
748 return x/TMath::Power(pass1,kxn);
749}
750
751Double_t AliGenMUONlib::PtBeautyCentral( Double_t *px, Double_t */*dummy*/)
752{
753// Beauty pT
754 const Double_t kpt0 = 6.14;
755 const Double_t kxn = 2.93;
fe4da5cc 756 Double_t x=*px;
757 //
d90f80fd 758 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
759 return x/TMath::Power(pass1,kxn);
fe4da5cc 760}
761// y-distribution
198bb1c7 762Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 763{
ec772ba2 764// Beauty y :: Carrer & Dainese : ALICE-INT-2003-019 v.3 (hep-ph/0311225)
765// Pythia tuned to reproduce the distribution given by the HVQMNR program based on NLO calculations (pQCD)
766// shadowing + kt broadening
767
768 Double_t x=px[0];
769 Double_t c[2]={-1.27590e-02,-2.42731e-04};
770 Double_t y=1+c[0]*TMath::Power(x,2)+c[1]*TMath::Power(x,4);
771 Double_t ybeauty;
772
773 if (TMath::Abs(x)>6) {
774 ybeauty=0.;
775 }
776 else {
777 ybeauty=TMath::Power(y,3);
778 }
779
780 return ybeauty;
fe4da5cc 781}
782
ec772ba2 783
65fb704d 784Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
fe4da5cc 785{
d90f80fd 786// Beauty Composition
65fb704d 787 Float_t random;
fe4da5cc 788 Int_t ip;
ec772ba2 789 random = ran->Rndm();
790
791// Taux de production Carrer & Dainese : ALICE-INT-2003-019 v.3
792// >>>>> cf. tab 4 p 11
793
794 if (random < 0.20) {
795 ip=511;
796 } else if (random < 0.40) {
797 ip=-511;
798 } else if (random < 0.605) {
799 ip=521;
800 } else if (random < 0.81) {
801 ip=-521;
802 } else if (random < 0.87) {
803 ip=531;
804 } else if (random < 0.93) {
805 ip=-531;
806 } else if (random < 0.965) {
807 ip=5122;
fe4da5cc 808 } else {
ec772ba2 809 ip=-5122;
fe4da5cc 810 }
fe4da5cc 811
ec772ba2 812 return ip;
fe4da5cc 813}
814
ec772ba2 815
fe4da5cc 816typedef Double_t (*GenFunc) (Double_t*, Double_t*);
53904666 817GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
fe4da5cc 818{
d90f80fd 819// Return pointer to pT parameterisation
05932df6 820 TString sname = TString(tname);
fe4da5cc 821 GenFunc func;
753690b0 822 switch (param)
fe4da5cc 823 {
34f60c01 824 case kPhi:
fe4da5cc 825 func=PtPhi;
826 break;
89512a3b 827 case kOmega:
828 func=PtOmega;
829 break;
830 case kEta:
831 func=PtEta;
832 break;
0ad09590 833 case kJpsiFamily:
88e5db43 834 case kPsiP:
34f60c01 835 case kJpsi:
bb6e81ac 836 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 837 func=PtJpsiPbPb;
bb6e81ac 838 } else if (sname == "Vogt pp") {
839 func=PtJpsiPP;
0e137c25 840 } else if (sname == "CDF scaled") {
841 func=PtJpsiCDFscaled;
05932df6 842 } else {
843 func=PtJpsi;
844 }
fe4da5cc 845 break;
17d28ba5 846 case kJpsiFromB:
847 func = PtJpsiBPbPb;
848 break;
0ad09590 849 case kUpsilonFamily:
88e5db43 850 case kUpsilonP:
851 case kUpsilonPP:
34f60c01 852 case kUpsilon:
bb6e81ac 853 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 854 func=PtUpsilonPbPb;
bb6e81ac 855 } else if (sname == "Vogt pp") {
856 func=PtUpsilonPP;
0e137c25 857 } else if (sname == "CDF scaled") {
858 func=PtUpsilonCDFscaled;
05932df6 859 } else {
860 func=PtUpsilon;
861 }
0ad09590 862 break;
34f60c01 863 case kCharm:
bd0276a8 864 if (sname == "central") {
865 func=PtCharmCentral;
866 } else {
867 func=PtCharm;
868 }
fe4da5cc 869 break;
34f60c01 870 case kBeauty:
bd0276a8 871 if (sname == "central") {
872 func=PtBeautyCentral;
873 } else {
874 func=PtBeauty;
875 }
fe4da5cc 876 break;
34f60c01 877 case kPion:
753690b0 878 func=PtPion;
879 break;
34f60c01 880 case kKaon:
753690b0 881 func=PtKaon;
882 break;
119b35c7 883 default:
884 func=0;
885 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
fe4da5cc 886 }
887 return func;
888}
889
53904666 890GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
fe4da5cc 891{
ac3faee4 892 //
893 // Return pointer to y- parameterisation
894 //
05932df6 895 TString sname = TString(tname);
fe4da5cc 896 GenFunc func;
753690b0 897 switch (param)
fe4da5cc 898 {
34f60c01 899 case kPhi:
fe4da5cc 900 func=YPhi;
901 break;
89512a3b 902 case kEta:
903 func=YEta;
904 break;
905 case kOmega:
906 func=YOmega;
907 break;
0ad09590 908 case kJpsiFamily:
88e5db43 909 case kPsiP:
34f60c01 910 case kJpsi:
bb6e81ac 911 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 912 func=YJpsiPbPb;
bb6e81ac 913 } else if (sname == "Vogt pp"){
914 func=YJpsiPP;
0e137c25 915 } else if (sname == "CDF scaled") {
916 func=YJpsiCDFscaled;
05932df6 917 } else {
918 func=YJpsi;
919 }
17d28ba5 920 break;
921 case kJpsiFromB:
922 func = YJpsiBPbPb;
fe4da5cc 923 break;
0ad09590 924 case kUpsilonFamily:
88e5db43 925 case kUpsilonP:
926 case kUpsilonPP:
34f60c01 927 case kUpsilon:
bb6e81ac 928 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 929 func=YUpsilonPbPb;
bb6e81ac 930 } else if (sname == "Vogt pp") {
931 func = YUpsilonPP;
0e137c25 932 } else if (sname == "CDF scaled") {
933 func=YUpsilonCDFscaled;
05932df6 934 } else {
935 func=YUpsilon;
936 }
fe4da5cc 937 break;
34f60c01 938 case kCharm:
fe4da5cc 939 func=YCharm;
940 break;
34f60c01 941 case kBeauty:
fe4da5cc 942 func=YBeauty;
943 break;
34f60c01 944 case kPion:
753690b0 945 func=YPion;
946 break;
34f60c01 947 case kKaon:
753690b0 948 func=YKaon;
949 break;
119b35c7 950 default:
951 func=0;
952 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
fe4da5cc 953 }
954 return func;
955}
65fb704d 956typedef Int_t (*GenFuncIp) (TRandom *);
198bb1c7 957GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* /*tname*/) const
fe4da5cc 958{
d90f80fd 959// Return pointer to particle type parameterisation
fe4da5cc 960 GenFuncIp func;
753690b0 961 switch (param)
fe4da5cc 962 {
34f60c01 963 case kPhi:
fe4da5cc 964 func=IpPhi;
965 break;
89512a3b 966 case kEta:
967 func=IpEta;
968 break;
969 case kOmega:
970 func=IpOmega;
971 break;
0ad09590 972 case kJpsiFamily:
973 func=IpJpsiFamily;
974 break;
88e5db43 975 case kPsiP:
976 func=IpPsiP;
977 break;
34f60c01 978 case kJpsi:
17d28ba5 979 case kJpsiFromB:
fe4da5cc 980 func=IpJpsi;
981 break;
34f60c01 982 case kUpsilon:
fe4da5cc 983 func=IpUpsilon;
984 break;
0ad09590 985 case kUpsilonFamily:
986 func=IpUpsilonFamily;
987 break;
88e5db43 988 case kUpsilonP:
989 func=IpUpsilonP;
990 break;
991 case kUpsilonPP:
992 func=IpUpsilonPP;
993 break;
34f60c01 994 case kCharm:
fe4da5cc 995 func=IpCharm;
996 break;
34f60c01 997 case kBeauty:
fe4da5cc 998 func=IpBeauty;
999 break;
34f60c01 1000 case kPion:
753690b0 1001 func=IpPion;
1002 break;
34f60c01 1003 case kKaon:
753690b0 1004 func=IpKaon;
1005 break;
119b35c7 1006 default:
1007 func=0;
1008 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
fe4da5cc 1009 }
1010 return func;
1011}
1012
1013
753690b0 1014
05932df6 1015Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0,
1016 Float_t dx,
1017 Int_t n, Int_t no)
1018{
1019//
1020// Neville's alorithm for interpolation
1021//
1022// x: x-value
1023// y: Input array
1024// x0: minimum x
1025// dx: step size
1026// n: number of data points
1027// no: order of polynom
1028//
1029 Float_t* c = new Float_t[n];
1030 Float_t* d = new Float_t[n];
1031 Int_t m, i;
1032 for (i = 0; i < n; i++) {
1033 c[i] = y[i];
1034 d[i] = y[i];
1035 }
1036
1037 Int_t ns = int((x - x0)/dx);
1038
1039 Float_t y1 = y[ns];
1040 ns--;
1041 for (m = 0; m < no; m++) {
1042 for (i = 0; i < n-m; i++) {
1043 Float_t ho = x0 + Float_t(i) * dx - x;
1044 Float_t hp = x0 + Float_t(i+m+1) * dx - x;
1045 Float_t w = c[i+1] - d[i];
1046 Float_t den = ho-hp;
1047 den = w/den;
1048 d[i] = hp * den;
1049 c[i] = ho * den;
1050 }
1051 Float_t dy;
1052
1053 if (2*ns < (n-m-1)) {
1054 dy = c[ns+1];
1055 } else {
1056 dy = d[ns--];
1057 }
1058 y1 += dy;}
1059 delete[] c;
1060 delete[] d;
1061
1062 return y1;
1063}
1064
753690b0 1065