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