]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenMUONlib.cxx
D and B distributions updated according to PPR.
[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
198bb1c7 165Double_t AliGenMUONlib::PtJpsiPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 166{
1af7144e 167// J/Psi pT spectrum
05932df6 168//
169// R. Vogt 2002
170// PbPb 5.5 TeV
171// MRST HO
172// mc = 1.4 GeV, pt-kick 1 GeV
173//
1af7144e 174 Float_t x = px[0];
175 Float_t c[8] = {
176 -2.13098e+00, 9.46552e+00, -5.06799e+00, 1.27260e+00,
177 -1.83806e-01, 1.55853e-02, -7.23241e-04, 1.42105e-05
05932df6 178 };
1af7144e 179
3d905dd7 180 Double_t y;
181 if (x < 10.) {
182 Int_t j;
183 y = c[j = 7];
184 while (j > 0) y = y * x +c[--j];
185 y = x * TMath::Exp(y);
186 } else {
187 y = 0.;
188 }
1af7144e 189 return y;
05932df6 190}
17d28ba5 191
192Double_t AliGenMUONlib::PtJpsiBPbPb( Double_t *px, Double_t */*dummy*/)
193{
194// J/Psi pT spectrum
195// B -> J/Psi X
196 Double_t x0 = 4.0384;
197 Double_t n = 3.0288;
198
199 Double_t x = px[0];
200 Double_t y = x / TMath::Power((1. + (x/x0)*(x/x0)), n);
201
202 return y;
203}
204
205
198bb1c7 206Double_t AliGenMUONlib::PtJpsiPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 207{
208// J/Psi pT spectrum
209//
210// R. Vogt 2002
211// pp 14 TeV
212// MRST HO
213// mc = 1.4 GeV, pt-kick 1 GeV
214//
215 Float_t x = px[0];
216 Float_t c[4] = {8.47471e+00, -1.93567e+00, 1.50271e-01, -5.51212e-03};
217
218 Double_t y;
219 if (x < 10.) {
220 Int_t j;
221 y = c[j = 3];
222 while (j > 0) y = y * x +c[--j];
223 y = x * TMath::Exp(y);
224 } else {
225 y = 0.;
226 }
227 return y;
228}
229
fe4da5cc 230//
231// y-distribution
232//____________________________________________________________
198bb1c7 233Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t */*dummy*/)
fe4da5cc 234{
d90f80fd 235// J/psi y
236 const Double_t ky0 = 4.;
237 const Double_t kb=1.;
fe4da5cc 238 Double_t yj;
239 Double_t y=TMath::Abs(*py);
240 //
d90f80fd 241 if (y < ky0)
242 yj=kb;
fe4da5cc 243 else
d90f80fd 244 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
fe4da5cc 245 return yj;
246}
05932df6 247
248
198bb1c7 249Double_t AliGenMUONlib::YJpsiPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 250{
251
252//
253// J/Psi y
254//
255//
256// R. Vogt 2002
257// PbPb 5.5 TeV
258// MRST HO
259// mc = 1.4 GeV, pt-kick 1 GeV
260//
1af7144e 261 Double_t c[5] = {-6.03425e+02, 4.98257e+02, -1.38794e+02, 1.62209e+01, -6.85955e-01};
262 Double_t x = TMath::Abs(px[0]);
263 Double_t y;
264
265 if (x < 4.) {
266 y = 31.754;
267 } else if (x < 6) {
268 Int_t j;
269 y = c[j = 4];
270 while (j > 0) y = y * x + c[--j];
271 } else {
272 y =0.;
273 }
274
275 return y;
05932df6 276}
277
198bb1c7 278Double_t AliGenMUONlib::YJpsiPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 279{
280
281//
282// J/Psi y
283//
284//
285// R. Vogt 2002
286// pp 14 TeV
287// MRST HO
288// mc = 1.4 GeV, pt-kick 1 GeV
289//
290
291 Double_t c[5] = {1.38532e+00, 1.00596e+02, -3.46378e+01, 3.94172e+00, -1.48319e-01};
292 Double_t x = TMath::Abs(px[0]);
293 Double_t y;
294
295 if (x < 2.5) {
296 y = 96.455 - 0.8483 * x * x;
297 } else if (x < 7.9) {
298 Int_t j;
299 y = c[j = 4];
300 while (j > 0) y = y * x + c[--j];
301 } else {
302 y =0.;
303 }
304
305 return y;
306}
307
17d28ba5 308Double_t AliGenMUONlib::YJpsiBPbPb( Double_t *px, Double_t */*dummy*/)
309{
310
311//
312// J/Psi from B->J/Psi X
313//
314//
315
316
317 Double_t c[7] = {7.37025e-02, 0., -2.94487e-03, 0., 6.07953e-06, 0., 5.39219e-07};
318
319 Double_t x = TMath::Abs(px[0]);
320 Double_t y;
321
322 if (x > 6.) {
323 y = 0.;
324 } else {
325 Int_t j;
326 y = c[j = 6];
327 while (j > 0) y = y * x + c[--j];
328 }
329
330 return y;
331}
332
333
334
fe4da5cc 335// particle composition
336//
65fb704d 337Int_t AliGenMUONlib::IpJpsi(TRandom *)
fe4da5cc 338{
d90f80fd 339// J/Psi composition
88cb7938 340 return 443;
fe4da5cc 341}
88e5db43 342Int_t AliGenMUONlib::IpPsiP(TRandom *)
343{
344// Psi prime composition
345 return 100443;
346}
0ad09590 347Int_t AliGenMUONlib::IpJpsiFamily(TRandom *)
348{
349// J/Psi composition
350 Int_t ip;
351 Float_t r = gRandom->Rndm();
352 if (r < 0.98) {
353 ip = 443;
354 } else {
355 ip = 100443;
356 }
357 return ip;
358}
359
fe4da5cc 360
88e5db43 361
fe4da5cc 362// Upsilon
363//
364//
365// pt-distribution
366//____________________________________________________________
198bb1c7 367Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t */*dummy*/ )
fe4da5cc 368{
d90f80fd 369// Upsilon pT
370 const Double_t kpt0 = 5.3;
371 const Double_t kxn = 2.5;
fe4da5cc 372 Double_t x=*px;
373 //
d90f80fd 374 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
375 return x/TMath::Power(pass1,kxn);
fe4da5cc 376}
05932df6 377
198bb1c7 378Double_t AliGenMUONlib::PtUpsilonPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 379{
380
381//
382// Upsilon pT
383//
384//
385// R. Vogt 2002
386// PbPb 5.5 TeV
387// MRST HO
388// mc = 1.4 GeV, pt-kick 1 GeV
389//
1af7144e 390 Float_t x = px[0];
391 Double_t c[8] = {
392 -1.03488e+01, 1.28065e+01, -6.60500e+00, 1.66140e+00,
393 -2.34293e-01, 1.86925e-02, -7.80708e-04, 1.30610e-05
394 };
3d905dd7 395 Double_t y;
396 if (x < 10.) {
397 Int_t j;
398 y = c[j = 7];
399 while (j > 0) y = y * x +c[--j];
400 y = x * TMath::Exp(y);
401 } else {
402 y = 0.;
403 }
1af7144e 404 return y;
05932df6 405}
406
198bb1c7 407Double_t AliGenMUONlib::PtUpsilonPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 408{
409
410//
411// Upsilon pT
412//
413//
414// R. Vogt 2002
415// pp 14 TeV
416// MRST HO
417// mc = 1.4 GeV, pt-kick 1 GeV
418//
419 Float_t x = px[0];
420 Double_t c[8] = {-7.93955e+00, 1.06306e+01, -5.21392e+00, 1.19703e+00,
421 -1.45718e-01, 8.95151e-03, -2.04806e-04, -1.13053e-06};
422
423 Double_t y;
424 if (x < 10.) {
425 Int_t j;
426 y = c[j = 7];
427 while (j > 0) y = y * x +c[--j];
428 y = x * TMath::Exp(y);
429 } else {
430 y = 0.;
431 }
432 return y;
433}
434
fe4da5cc 435//
436// y-distribution
437//
438//____________________________________________________________
198bb1c7 439Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t */*dummy*/)
fe4da5cc 440{
d90f80fd 441// Upsilon y
442 const Double_t ky0 = 3.;
443 const Double_t kb=1.;
fe4da5cc 444 Double_t yu;
445 Double_t y=TMath::Abs(*py);
446 //
d90f80fd 447 if (y < ky0)
448 yu=kb;
fe4da5cc 449 else
d90f80fd 450 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
fe4da5cc 451 return yu;
452}
05932df6 453
454
198bb1c7 455Double_t AliGenMUONlib::YUpsilonPbPb( Double_t *px, Double_t */*dummy*/)
05932df6 456{
457
458//
459// Upsilon y
460//
461//
462// R. Vogt 2002
463// PbPb 5.5 TeV
464// MRST HO
465// mc = 1.4 GeV, pt-kick 1 GeV
466//
467
1af7144e 468 Double_t c[7] = {3.40036e-01, -3.98882e-07, -4.48398e-03, 8.46411e-08, -6.10854e-04,
469 -2.99753e-09, 1.28895e-05};
470
471 Double_t x = px[0];
472 if (TMath::Abs(x) > 5.55) return 0.;
473 Int_t j;
474 Double_t y = c[j = 6];
475 while (j > 0) y = y * x +c[--j];
476 return y;
05932df6 477}
478
198bb1c7 479Double_t AliGenMUONlib::YUpsilonPP( Double_t *px, Double_t */*dummy*/)
bb6e81ac 480{
481
482//
483// Upsilon y
484//
485//
486// R. Vogt 2002
487// p p 14. TeV
488// MRST HO
489// mc = 1.4 GeV, pt-kick 1 GeV
490//
491 Double_t c[7] = {8.91936e-01, -6.46645e-07, -1.52774e-02, 4.28677e-08, -7.01517e-04,
492 -6.20539e-10, 1.29943e-05};
493
494 Double_t x = px[0];
495 if (TMath::Abs(x) > 6.2) return 0.;
496 Int_t j;
497 Double_t y = c[j = 6];
498 while (j > 0) y = y * x +c[--j];
499 return y;
500}
501
fe4da5cc 502// particle composition
503//
65fb704d 504Int_t AliGenMUONlib::IpUpsilon(TRandom *)
fe4da5cc 505{
d90f80fd 506// y composition
88cb7938 507 return 553;
fe4da5cc 508}
88e5db43 509Int_t AliGenMUONlib::IpUpsilonP(TRandom *)
510{
511// y composition
512 return 100553;
513}
514Int_t AliGenMUONlib::IpUpsilonPP(TRandom *)
515{
516// y composition
517 return 200553;
518}
0ad09590 519Int_t AliGenMUONlib::IpUpsilonFamily(TRandom *)
520{
521// y composition
522 Int_t ip;
523 Float_t r = gRandom->Rndm();
524
525 if (r < 0.712) {
526 ip = 553;
527 } else if (r < 0.896) {
528 ip = 100553;
529 } else {
530 ip = 200553;
531 }
532 return ip;
533}
fe4da5cc 534
88e5db43 535
fe4da5cc 536//
537// Phi
538//
539//
540// pt-distribution (by scaling of pion distribution)
541//____________________________________________________________
198bb1c7 542Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t */*dummy*/)
fe4da5cc 543{
d90f80fd 544// Phi pT
fe4da5cc 545 return PtScal(*px,7);
546}
547// y-distribution
198bb1c7 548Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t */*dummy*/)
fe4da5cc 549{
d90f80fd 550// Phi y
551 Double_t *dum=0;
552 return YJpsi(px,dum);
fe4da5cc 553}
554// particle composition
555//
65fb704d 556Int_t AliGenMUONlib::IpPhi(TRandom *)
fe4da5cc 557{
d90f80fd 558// Phi composition
89512a3b 559 return 333;
560}
561
562//
563// omega
564//
565//
566// pt-distribution (by scaling of pion distribution)
567//____________________________________________________________
198bb1c7 568Double_t AliGenMUONlib::PtOmega( Double_t *px, Double_t */*dummy*/)
89512a3b 569{
570// Omega pT
571 return PtScal(*px,5);
572}
573// y-distribution
198bb1c7 574Double_t AliGenMUONlib::YOmega( Double_t *px, Double_t */*dummy*/)
89512a3b 575{
576// Omega y
577 Double_t *dum=0;
578 return YJpsi(px,dum);
579}
580// particle composition
581//
582Int_t AliGenMUONlib::IpOmega(TRandom *)
583{
584// Omega composition
585 return 223;
586}
587
588
589//
590// Eta
591//
592//
593// pt-distribution (by scaling of pion distribution)
594//____________________________________________________________
198bb1c7 595Double_t AliGenMUONlib::PtEta( Double_t *px, Double_t */*dummy*/)
89512a3b 596{
597// Eta pT
598 return PtScal(*px,3);
599}
600// y-distribution
198bb1c7 601Double_t AliGenMUONlib::YEta( Double_t *px, Double_t */*dummy*/)
89512a3b 602{
603// Eta y
604 Double_t *dum=0;
605 return YJpsi(px,dum);
606}
607// particle composition
608//
609Int_t AliGenMUONlib::IpEta(TRandom *)
610{
611// Eta composition
612 return 221;
fe4da5cc 613}
614
615//
616// Charm
617//
618//
619// pt-distribution
620//____________________________________________________________
198bb1c7 621Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t */*dummy*/)
fe4da5cc 622{
d90f80fd 623// Charm pT
bd0276a8 624 const Double_t kpt0 = 2.25;
625 const Double_t kxn = 3.17;
2280e6af 626
fe4da5cc 627 Double_t x=*px;
628 //
bd0276a8 629 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
630 return x/TMath::Power(pass1,kxn);
631}
632
633Double_t AliGenMUONlib::PtCharmCentral( Double_t *px, Double_t */*dummy*/)
634{
635// Charm pT
636 const Double_t kpt0 = 2.12;
637 const Double_t kxn = 2.78;
638
639 Double_t x=*px;
640 //
641 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
d90f80fd 642 return x/TMath::Power(pass1,kxn);
fe4da5cc 643}
644// y-distribution
198bb1c7 645Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t */*dummy*/)
fe4da5cc 646{
d90f80fd 647// Charm y
648 Double_t *dum=0;
649 return YJpsi(px,dum);
fe4da5cc 650}
651
65fb704d 652Int_t AliGenMUONlib::IpCharm(TRandom *ran)
fe4da5cc 653{
d90f80fd 654// Charm composition
65fb704d 655 Float_t random;
fe4da5cc 656 Int_t ip;
657// 411,421,431,4122
65fb704d 658 random = ran->Rndm();
659 if (random < 0.5) {
fe4da5cc 660 ip=411;
65fb704d 661 } else if (random < 0.75) {
fe4da5cc 662 ip=421;
65fb704d 663 } else if (random < 0.90) {
fe4da5cc 664 ip=431;
665 } else {
666 ip=4122;
667 }
65fb704d 668 if (ran->Rndm() < 0.5) {ip=-ip;}
fe4da5cc 669
670 return ip;
671}
672
673
674//
675// Beauty
676//
677//
678// pt-distribution
679//____________________________________________________________
198bb1c7 680Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 681{
d90f80fd 682// Beauty pT
bd0276a8 683 const Double_t kpt0 = 6.53;
684 const Double_t kxn = 3.59;
685 Double_t x=*px;
686 //
687 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
688 return x/TMath::Power(pass1,kxn);
689}
690
691Double_t AliGenMUONlib::PtBeautyCentral( Double_t *px, Double_t */*dummy*/)
692{
693// Beauty pT
694 const Double_t kpt0 = 6.14;
695 const Double_t kxn = 2.93;
fe4da5cc 696 Double_t x=*px;
697 //
d90f80fd 698 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
699 return x/TMath::Power(pass1,kxn);
fe4da5cc 700}
701// y-distribution
198bb1c7 702Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 703{
d90f80fd 704// Beauty y
705 Double_t *dum=0;
706 return YJpsi(px,dum);
fe4da5cc 707}
708
65fb704d 709Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
fe4da5cc 710{
d90f80fd 711// Beauty Composition
65fb704d 712 Float_t random;
fe4da5cc 713 Int_t ip;
65fb704d 714 random = ran->Rndm();
715 if (random < 0.5) {
fe4da5cc 716 ip=511;
65fb704d 717 } else if (random < 0.75) {
fe4da5cc 718 ip=521;
65fb704d 719 } else if (random < 0.90) {
fe4da5cc 720 ip=531;
721 } else {
722 ip=5122;
723 }
65fb704d 724 if (ran->Rndm() < 0.5) {ip=-ip;}
fe4da5cc 725
726 return ip;
727}
728
729typedef Double_t (*GenFunc) (Double_t*, Double_t*);
53904666 730GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
fe4da5cc 731{
d90f80fd 732// Return pointer to pT parameterisation
05932df6 733 TString sname = TString(tname);
fe4da5cc 734 GenFunc func;
753690b0 735 switch (param)
fe4da5cc 736 {
34f60c01 737 case kPhi:
fe4da5cc 738 func=PtPhi;
739 break;
89512a3b 740 case kOmega:
741 func=PtOmega;
742 break;
743 case kEta:
744 func=PtEta;
745 break;
0ad09590 746 case kJpsiFamily:
88e5db43 747 case kPsiP:
34f60c01 748 case kJpsi:
bb6e81ac 749 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 750 func=PtJpsiPbPb;
bb6e81ac 751 } else if (sname == "Vogt pp") {
752 func=PtJpsiPP;
05932df6 753 } else {
754 func=PtJpsi;
755 }
fe4da5cc 756 break;
17d28ba5 757 case kJpsiFromB:
758 func = PtJpsiBPbPb;
759 break;
0ad09590 760 case kUpsilonFamily:
88e5db43 761 case kUpsilonP:
762 case kUpsilonPP:
34f60c01 763 case kUpsilon:
bb6e81ac 764 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 765 func=PtUpsilonPbPb;
bb6e81ac 766 } else if (sname == "Vogt pp") {
767 func=PtUpsilonPP;
05932df6 768 } else {
769 func=PtUpsilon;
770 }
0ad09590 771 break;
34f60c01 772 case kCharm:
bd0276a8 773 if (sname == "central") {
774 func=PtCharmCentral;
775 } else {
776 func=PtCharm;
777 }
fe4da5cc 778 break;
34f60c01 779 case kBeauty:
bd0276a8 780 if (sname == "central") {
781 func=PtBeautyCentral;
782 } else {
783 func=PtBeauty;
784 }
fe4da5cc 785 break;
34f60c01 786 case kPion:
753690b0 787 func=PtPion;
788 break;
34f60c01 789 case kKaon:
753690b0 790 func=PtKaon;
791 break;
119b35c7 792 default:
793 func=0;
794 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
fe4da5cc 795 }
796 return func;
797}
798
53904666 799GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
fe4da5cc 800{
ac3faee4 801 //
802 // Return pointer to y- parameterisation
803 //
05932df6 804 TString sname = TString(tname);
fe4da5cc 805 GenFunc func;
753690b0 806 switch (param)
fe4da5cc 807 {
34f60c01 808 case kPhi:
fe4da5cc 809 func=YPhi;
810 break;
89512a3b 811 case kEta:
812 func=YEta;
813 break;
814 case kOmega:
815 func=YOmega;
816 break;
0ad09590 817 case kJpsiFamily:
88e5db43 818 case kPsiP:
34f60c01 819 case kJpsi:
bb6e81ac 820 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 821 func=YJpsiPbPb;
bb6e81ac 822 } else if (sname == "Vogt pp"){
823 func=YJpsiPP;
05932df6 824 } else {
825 func=YJpsi;
826 }
17d28ba5 827 break;
828 case kJpsiFromB:
829 func = YJpsiBPbPb;
fe4da5cc 830 break;
0ad09590 831 case kUpsilonFamily:
88e5db43 832 case kUpsilonP:
833 case kUpsilonPP:
34f60c01 834 case kUpsilon:
bb6e81ac 835 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 836 func=YUpsilonPbPb;
bb6e81ac 837 } else if (sname == "Vogt pp") {
838 func = YUpsilonPP;
05932df6 839 } else {
840 func=YUpsilon;
841 }
fe4da5cc 842 break;
34f60c01 843 case kCharm:
fe4da5cc 844 func=YCharm;
845 break;
34f60c01 846 case kBeauty:
fe4da5cc 847 func=YBeauty;
848 break;
34f60c01 849 case kPion:
753690b0 850 func=YPion;
851 break;
34f60c01 852 case kKaon:
753690b0 853 func=YKaon;
854 break;
119b35c7 855 default:
856 func=0;
857 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
fe4da5cc 858 }
859 return func;
860}
65fb704d 861typedef Int_t (*GenFuncIp) (TRandom *);
198bb1c7 862GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* /*tname*/) const
fe4da5cc 863{
d90f80fd 864// Return pointer to particle type parameterisation
fe4da5cc 865 GenFuncIp func;
753690b0 866 switch (param)
fe4da5cc 867 {
34f60c01 868 case kPhi:
fe4da5cc 869 func=IpPhi;
870 break;
89512a3b 871 case kEta:
872 func=IpEta;
873 break;
874 case kOmega:
875 func=IpOmega;
876 break;
0ad09590 877 case kJpsiFamily:
878 func=IpJpsiFamily;
879 break;
88e5db43 880 case kPsiP:
881 func=IpPsiP;
882 break;
34f60c01 883 case kJpsi:
17d28ba5 884 case kJpsiFromB:
fe4da5cc 885 func=IpJpsi;
886 break;
34f60c01 887 case kUpsilon:
fe4da5cc 888 func=IpUpsilon;
889 break;
0ad09590 890 case kUpsilonFamily:
891 func=IpUpsilonFamily;
892 break;
88e5db43 893 case kUpsilonP:
894 func=IpUpsilonP;
895 break;
896 case kUpsilonPP:
897 func=IpUpsilonPP;
898 break;
34f60c01 899 case kCharm:
fe4da5cc 900 func=IpCharm;
901 break;
34f60c01 902 case kBeauty:
fe4da5cc 903 func=IpBeauty;
904 break;
34f60c01 905 case kPion:
753690b0 906 func=IpPion;
907 break;
34f60c01 908 case kKaon:
753690b0 909 func=IpKaon;
910 break;
119b35c7 911 default:
912 func=0;
913 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
fe4da5cc 914 }
915 return func;
916}
917
918
753690b0 919
05932df6 920Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0,
921 Float_t dx,
922 Int_t n, Int_t no)
923{
924//
925// Neville's alorithm for interpolation
926//
927// x: x-value
928// y: Input array
929// x0: minimum x
930// dx: step size
931// n: number of data points
932// no: order of polynom
933//
934 Float_t* c = new Float_t[n];
935 Float_t* d = new Float_t[n];
936 Int_t m, i;
937 for (i = 0; i < n; i++) {
938 c[i] = y[i];
939 d[i] = y[i];
940 }
941
942 Int_t ns = int((x - x0)/dx);
943
944 Float_t y1 = y[ns];
945 ns--;
946 for (m = 0; m < no; m++) {
947 for (i = 0; i < n-m; i++) {
948 Float_t ho = x0 + Float_t(i) * dx - x;
949 Float_t hp = x0 + Float_t(i+m+1) * dx - x;
950 Float_t w = c[i+1] - d[i];
951 Float_t den = ho-hp;
952 den = w/den;
953 d[i] = hp * den;
954 c[i] = ho * den;
955 }
956 Float_t dy;
957
958 if (2*ns < (n-m-1)) {
959 dy = c[ns+1];
960 } else {
961 dy = d[ns--];
962 }
963 y1 += dy;}
964 delete[] c;
965 delete[] d;
966
967 return y1;
968}
969
753690b0 970