]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenMUONlib.cxx
Removing extra semicolon (FC3)
[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{
d90f80fd 683// Charm y
684 Double_t *dum=0;
685 return YJpsi(px,dum);
fe4da5cc 686}
687
65fb704d 688Int_t AliGenMUONlib::IpCharm(TRandom *ran)
fe4da5cc 689{
d90f80fd 690// Charm composition
65fb704d 691 Float_t random;
fe4da5cc 692 Int_t ip;
693// 411,421,431,4122
65fb704d 694 random = ran->Rndm();
695 if (random < 0.5) {
fe4da5cc 696 ip=411;
65fb704d 697 } else if (random < 0.75) {
fe4da5cc 698 ip=421;
65fb704d 699 } else if (random < 0.90) {
fe4da5cc 700 ip=431;
701 } else {
702 ip=4122;
703 }
65fb704d 704 if (ran->Rndm() < 0.5) {ip=-ip;}
fe4da5cc 705
706 return ip;
707}
708
709
710//
711// Beauty
712//
713//
714// pt-distribution
715//____________________________________________________________
198bb1c7 716Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 717{
d90f80fd 718// Beauty pT
bd0276a8 719 const Double_t kpt0 = 6.53;
720 const Double_t kxn = 3.59;
721 Double_t x=*px;
722 //
723 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
724 return x/TMath::Power(pass1,kxn);
725}
726
727Double_t AliGenMUONlib::PtBeautyCentral( Double_t *px, Double_t */*dummy*/)
728{
729// Beauty pT
730 const Double_t kpt0 = 6.14;
731 const Double_t kxn = 2.93;
fe4da5cc 732 Double_t x=*px;
733 //
d90f80fd 734 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
735 return x/TMath::Power(pass1,kxn);
fe4da5cc 736}
737// y-distribution
198bb1c7 738Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 739{
d90f80fd 740// Beauty y
741 Double_t *dum=0;
742 return YJpsi(px,dum);
fe4da5cc 743}
744
65fb704d 745Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
fe4da5cc 746{
d90f80fd 747// Beauty Composition
65fb704d 748 Float_t random;
fe4da5cc 749 Int_t ip;
65fb704d 750 random = ran->Rndm();
751 if (random < 0.5) {
fe4da5cc 752 ip=511;
65fb704d 753 } else if (random < 0.75) {
fe4da5cc 754 ip=521;
65fb704d 755 } else if (random < 0.90) {
fe4da5cc 756 ip=531;
757 } else {
758 ip=5122;
759 }
65fb704d 760 if (ran->Rndm() < 0.5) {ip=-ip;}
fe4da5cc 761
762 return ip;
763}
764
765typedef Double_t (*GenFunc) (Double_t*, Double_t*);
53904666 766GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
fe4da5cc 767{
d90f80fd 768// Return pointer to pT parameterisation
05932df6 769 TString sname = TString(tname);
fe4da5cc 770 GenFunc func;
753690b0 771 switch (param)
fe4da5cc 772 {
34f60c01 773 case kPhi:
fe4da5cc 774 func=PtPhi;
775 break;
89512a3b 776 case kOmega:
777 func=PtOmega;
778 break;
779 case kEta:
780 func=PtEta;
781 break;
0ad09590 782 case kJpsiFamily:
88e5db43 783 case kPsiP:
34f60c01 784 case kJpsi:
bb6e81ac 785 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 786 func=PtJpsiPbPb;
bb6e81ac 787 } else if (sname == "Vogt pp") {
788 func=PtJpsiPP;
0e137c25 789 } else if (sname == "CDF scaled") {
790 func=PtJpsiCDFscaled;
05932df6 791 } else {
792 func=PtJpsi;
793 }
fe4da5cc 794 break;
17d28ba5 795 case kJpsiFromB:
796 func = PtJpsiBPbPb;
797 break;
0ad09590 798 case kUpsilonFamily:
88e5db43 799 case kUpsilonP:
800 case kUpsilonPP:
34f60c01 801 case kUpsilon:
bb6e81ac 802 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 803 func=PtUpsilonPbPb;
bb6e81ac 804 } else if (sname == "Vogt pp") {
805 func=PtUpsilonPP;
0e137c25 806 } else if (sname == "CDF scaled") {
807 func=PtUpsilonCDFscaled;
05932df6 808 } else {
809 func=PtUpsilon;
810 }
0ad09590 811 break;
34f60c01 812 case kCharm:
bd0276a8 813 if (sname == "central") {
814 func=PtCharmCentral;
815 } else {
816 func=PtCharm;
817 }
fe4da5cc 818 break;
34f60c01 819 case kBeauty:
bd0276a8 820 if (sname == "central") {
821 func=PtBeautyCentral;
822 } else {
823 func=PtBeauty;
824 }
fe4da5cc 825 break;
34f60c01 826 case kPion:
753690b0 827 func=PtPion;
828 break;
34f60c01 829 case kKaon:
753690b0 830 func=PtKaon;
831 break;
119b35c7 832 default:
833 func=0;
834 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
fe4da5cc 835 }
836 return func;
837}
838
53904666 839GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
fe4da5cc 840{
ac3faee4 841 //
842 // Return pointer to y- parameterisation
843 //
05932df6 844 TString sname = TString(tname);
fe4da5cc 845 GenFunc func;
753690b0 846 switch (param)
fe4da5cc 847 {
34f60c01 848 case kPhi:
fe4da5cc 849 func=YPhi;
850 break;
89512a3b 851 case kEta:
852 func=YEta;
853 break;
854 case kOmega:
855 func=YOmega;
856 break;
0ad09590 857 case kJpsiFamily:
88e5db43 858 case kPsiP:
34f60c01 859 case kJpsi:
bb6e81ac 860 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 861 func=YJpsiPbPb;
bb6e81ac 862 } else if (sname == "Vogt pp"){
863 func=YJpsiPP;
0e137c25 864 } else if (sname == "CDF scaled") {
865 func=YJpsiCDFscaled;
05932df6 866 } else {
867 func=YJpsi;
868 }
17d28ba5 869 break;
870 case kJpsiFromB:
871 func = YJpsiBPbPb;
fe4da5cc 872 break;
0ad09590 873 case kUpsilonFamily:
88e5db43 874 case kUpsilonP:
875 case kUpsilonPP:
34f60c01 876 case kUpsilon:
bb6e81ac 877 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 878 func=YUpsilonPbPb;
bb6e81ac 879 } else if (sname == "Vogt pp") {
880 func = YUpsilonPP;
0e137c25 881 } else if (sname == "CDF scaled") {
882 func=YUpsilonCDFscaled;
05932df6 883 } else {
884 func=YUpsilon;
885 }
fe4da5cc 886 break;
34f60c01 887 case kCharm:
fe4da5cc 888 func=YCharm;
889 break;
34f60c01 890 case kBeauty:
fe4da5cc 891 func=YBeauty;
892 break;
34f60c01 893 case kPion:
753690b0 894 func=YPion;
895 break;
34f60c01 896 case kKaon:
753690b0 897 func=YKaon;
898 break;
119b35c7 899 default:
900 func=0;
901 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
fe4da5cc 902 }
903 return func;
904}
65fb704d 905typedef Int_t (*GenFuncIp) (TRandom *);
198bb1c7 906GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* /*tname*/) const
fe4da5cc 907{
d90f80fd 908// Return pointer to particle type parameterisation
fe4da5cc 909 GenFuncIp func;
753690b0 910 switch (param)
fe4da5cc 911 {
34f60c01 912 case kPhi:
fe4da5cc 913 func=IpPhi;
914 break;
89512a3b 915 case kEta:
916 func=IpEta;
917 break;
918 case kOmega:
919 func=IpOmega;
920 break;
0ad09590 921 case kJpsiFamily:
922 func=IpJpsiFamily;
923 break;
88e5db43 924 case kPsiP:
925 func=IpPsiP;
926 break;
34f60c01 927 case kJpsi:
17d28ba5 928 case kJpsiFromB:
fe4da5cc 929 func=IpJpsi;
930 break;
34f60c01 931 case kUpsilon:
fe4da5cc 932 func=IpUpsilon;
933 break;
0ad09590 934 case kUpsilonFamily:
935 func=IpUpsilonFamily;
936 break;
88e5db43 937 case kUpsilonP:
938 func=IpUpsilonP;
939 break;
940 case kUpsilonPP:
941 func=IpUpsilonPP;
942 break;
34f60c01 943 case kCharm:
fe4da5cc 944 func=IpCharm;
945 break;
34f60c01 946 case kBeauty:
fe4da5cc 947 func=IpBeauty;
948 break;
34f60c01 949 case kPion:
753690b0 950 func=IpPion;
951 break;
34f60c01 952 case kKaon:
753690b0 953 func=IpKaon;
954 break;
119b35c7 955 default:
956 func=0;
957 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
fe4da5cc 958 }
959 return func;
960}
961
962
753690b0 963
05932df6 964Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0,
965 Float_t dx,
966 Int_t n, Int_t no)
967{
968//
969// Neville's alorithm for interpolation
970//
971// x: x-value
972// y: Input array
973// x0: minimum x
974// dx: step size
975// n: number of data points
976// no: order of polynom
977//
978 Float_t* c = new Float_t[n];
979 Float_t* d = new Float_t[n];
980 Int_t m, i;
981 for (i = 0; i < n; i++) {
982 c[i] = y[i];
983 d[i] = y[i];
984 }
985
986 Int_t ns = int((x - x0)/dx);
987
988 Float_t y1 = y[ns];
989 ns--;
990 for (m = 0; m < no; m++) {
991 for (i = 0; i < n-m; i++) {
992 Float_t ho = x0 + Float_t(i) * dx - x;
993 Float_t hp = x0 + Float_t(i+m+1) * dx - x;
994 Float_t w = c[i+1] - d[i];
995 Float_t den = ho-hp;
996 den = w/den;
997 d[i] = hp * den;
998 c[i] = ho * den;
999 }
1000 Float_t dy;
1001
1002 if (2*ns < (n-m-1)) {
1003 dy = c[ns+1];
1004 } else {
1005 dy = d[ns--];
1006 }
1007 y1 += dy;}
1008 delete[] c;
1009 delete[] d;
1010
1011 return y1;
1012}
1013
753690b0 1014