]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenMUONlib.cxx
Coding Convention Violation correction
[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
624 const Double_t kpt0 = 4.08;
625 const Double_t kxn = 9.40;
2280e6af 626
fe4da5cc 627 Double_t x=*px;
628 //
2280e6af 629 Double_t pass1 = 1.+(x/kpt0);
d90f80fd 630 return x/TMath::Power(pass1,kxn);
fe4da5cc 631}
632// y-distribution
198bb1c7 633Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t */*dummy*/)
fe4da5cc 634{
d90f80fd 635// Charm y
636 Double_t *dum=0;
637 return YJpsi(px,dum);
fe4da5cc 638}
639
65fb704d 640Int_t AliGenMUONlib::IpCharm(TRandom *ran)
fe4da5cc 641{
d90f80fd 642// Charm composition
65fb704d 643 Float_t random;
fe4da5cc 644 Int_t ip;
645// 411,421,431,4122
65fb704d 646 random = ran->Rndm();
647 if (random < 0.5) {
fe4da5cc 648 ip=411;
65fb704d 649 } else if (random < 0.75) {
fe4da5cc 650 ip=421;
65fb704d 651 } else if (random < 0.90) {
fe4da5cc 652 ip=431;
653 } else {
654 ip=4122;
655 }
65fb704d 656 if (ran->Rndm() < 0.5) {ip=-ip;}
fe4da5cc 657
658 return ip;
659}
660
661
662//
663// Beauty
664//
665//
666// pt-distribution
667//____________________________________________________________
198bb1c7 668Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 669{
d90f80fd 670// Beauty pT
671 const Double_t kpt0 = 4.;
672 const Double_t kxn = 3.6;
fe4da5cc 673 Double_t x=*px;
674 //
d90f80fd 675 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
676 return x/TMath::Power(pass1,kxn);
fe4da5cc 677}
678// y-distribution
198bb1c7 679Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t */*dummy*/)
fe4da5cc 680{
d90f80fd 681// Beauty y
682 Double_t *dum=0;
683 return YJpsi(px,dum);
fe4da5cc 684}
685
65fb704d 686Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
fe4da5cc 687{
d90f80fd 688// Beauty Composition
65fb704d 689 Float_t random;
fe4da5cc 690 Int_t ip;
65fb704d 691 random = ran->Rndm();
692 if (random < 0.5) {
fe4da5cc 693 ip=511;
65fb704d 694 } else if (random < 0.75) {
fe4da5cc 695 ip=521;
65fb704d 696 } else if (random < 0.90) {
fe4da5cc 697 ip=531;
698 } else {
699 ip=5122;
700 }
65fb704d 701 if (ran->Rndm() < 0.5) {ip=-ip;}
fe4da5cc 702
703 return ip;
704}
705
706typedef Double_t (*GenFunc) (Double_t*, Double_t*);
53904666 707GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
fe4da5cc 708{
d90f80fd 709// Return pointer to pT parameterisation
05932df6 710 TString sname = TString(tname);
fe4da5cc 711 GenFunc func;
753690b0 712 switch (param)
fe4da5cc 713 {
34f60c01 714 case kPhi:
fe4da5cc 715 func=PtPhi;
716 break;
89512a3b 717 case kOmega:
718 func=PtOmega;
719 break;
720 case kEta:
721 func=PtEta;
722 break;
0ad09590 723 case kJpsiFamily:
88e5db43 724 case kPsiP:
34f60c01 725 case kJpsi:
bb6e81ac 726 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 727 func=PtJpsiPbPb;
bb6e81ac 728 } else if (sname == "Vogt pp") {
729 func=PtJpsiPP;
05932df6 730 } else {
731 func=PtJpsi;
732 }
fe4da5cc 733 break;
17d28ba5 734 case kJpsiFromB:
735 func = PtJpsiBPbPb;
736 break;
0ad09590 737 case kUpsilonFamily:
88e5db43 738 case kUpsilonP:
739 case kUpsilonPP:
34f60c01 740 case kUpsilon:
bb6e81ac 741 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 742 func=PtUpsilonPbPb;
bb6e81ac 743 } else if (sname == "Vogt pp") {
744 func=PtUpsilonPP;
05932df6 745 } else {
746 func=PtUpsilon;
747 }
0ad09590 748 break;
34f60c01 749 case kCharm:
fe4da5cc 750 func=PtCharm;
751 break;
34f60c01 752 case kBeauty:
fe4da5cc 753 func=PtBeauty;
754 break;
34f60c01 755 case kPion:
753690b0 756 func=PtPion;
757 break;
34f60c01 758 case kKaon:
753690b0 759 func=PtKaon;
760 break;
119b35c7 761 default:
762 func=0;
763 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
fe4da5cc 764 }
765 return func;
766}
767
53904666 768GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
fe4da5cc 769{
ac3faee4 770 //
771 // Return pointer to y- parameterisation
772 //
05932df6 773 TString sname = TString(tname);
fe4da5cc 774 GenFunc func;
753690b0 775 switch (param)
fe4da5cc 776 {
34f60c01 777 case kPhi:
fe4da5cc 778 func=YPhi;
779 break;
89512a3b 780 case kEta:
781 func=YEta;
782 break;
783 case kOmega:
784 func=YOmega;
785 break;
0ad09590 786 case kJpsiFamily:
88e5db43 787 case kPsiP:
34f60c01 788 case kJpsi:
bb6e81ac 789 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 790 func=YJpsiPbPb;
bb6e81ac 791 } else if (sname == "Vogt pp"){
792 func=YJpsiPP;
05932df6 793 } else {
794 func=YJpsi;
795 }
17d28ba5 796 break;
797 case kJpsiFromB:
798 func = YJpsiBPbPb;
fe4da5cc 799 break;
0ad09590 800 case kUpsilonFamily:
88e5db43 801 case kUpsilonP:
802 case kUpsilonPP:
34f60c01 803 case kUpsilon:
bb6e81ac 804 if (sname == "Vogt" || sname == "Vogt PbPb") {
05932df6 805 func=YUpsilonPbPb;
bb6e81ac 806 } else if (sname == "Vogt pp") {
807 func = YUpsilonPP;
05932df6 808 } else {
809 func=YUpsilon;
810 }
fe4da5cc 811 break;
34f60c01 812 case kCharm:
fe4da5cc 813 func=YCharm;
814 break;
34f60c01 815 case kBeauty:
fe4da5cc 816 func=YBeauty;
817 break;
34f60c01 818 case kPion:
753690b0 819 func=YPion;
820 break;
34f60c01 821 case kKaon:
753690b0 822 func=YKaon;
823 break;
119b35c7 824 default:
825 func=0;
826 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
fe4da5cc 827 }
828 return func;
829}
65fb704d 830typedef Int_t (*GenFuncIp) (TRandom *);
198bb1c7 831GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* /*tname*/) const
fe4da5cc 832{
d90f80fd 833// Return pointer to particle type parameterisation
fe4da5cc 834 GenFuncIp func;
753690b0 835 switch (param)
fe4da5cc 836 {
34f60c01 837 case kPhi:
fe4da5cc 838 func=IpPhi;
839 break;
89512a3b 840 case kEta:
841 func=IpEta;
842 break;
843 case kOmega:
844 func=IpOmega;
845 break;
0ad09590 846 case kJpsiFamily:
847 func=IpJpsiFamily;
848 break;
88e5db43 849 case kPsiP:
850 func=IpPsiP;
851 break;
34f60c01 852 case kJpsi:
17d28ba5 853 case kJpsiFromB:
fe4da5cc 854 func=IpJpsi;
855 break;
34f60c01 856 case kUpsilon:
fe4da5cc 857 func=IpUpsilon;
858 break;
0ad09590 859 case kUpsilonFamily:
860 func=IpUpsilonFamily;
861 break;
88e5db43 862 case kUpsilonP:
863 func=IpUpsilonP;
864 break;
865 case kUpsilonPP:
866 func=IpUpsilonPP;
867 break;
34f60c01 868 case kCharm:
fe4da5cc 869 func=IpCharm;
870 break;
34f60c01 871 case kBeauty:
fe4da5cc 872 func=IpBeauty;
873 break;
34f60c01 874 case kPion:
753690b0 875 func=IpPion;
876 break;
34f60c01 877 case kKaon:
753690b0 878 func=IpKaon;
879 break;
119b35c7 880 default:
881 func=0;
882 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
fe4da5cc 883 }
884 return func;
885}
886
887
753690b0 888
05932df6 889Float_t AliGenMUONlib::Interpolate(Float_t x, Float_t* y, Float_t x0,
890 Float_t dx,
891 Int_t n, Int_t no)
892{
893//
894// Neville's alorithm for interpolation
895//
896// x: x-value
897// y: Input array
898// x0: minimum x
899// dx: step size
900// n: number of data points
901// no: order of polynom
902//
903 Float_t* c = new Float_t[n];
904 Float_t* d = new Float_t[n];
905 Int_t m, i;
906 for (i = 0; i < n; i++) {
907 c[i] = y[i];
908 d[i] = y[i];
909 }
910
911 Int_t ns = int((x - x0)/dx);
912
913 Float_t y1 = y[ns];
914 ns--;
915 for (m = 0; m < no; m++) {
916 for (i = 0; i < n-m; i++) {
917 Float_t ho = x0 + Float_t(i) * dx - x;
918 Float_t hp = x0 + Float_t(i+m+1) * dx - x;
919 Float_t w = c[i+1] - d[i];
920 Float_t den = ho-hp;
921 den = w/den;
922 d[i] = hp * den;
923 c[i] = ho * den;
924 }
925 Float_t dy;
926
927 if (2*ns < (n-m-1)) {
928 dy = c[ns+1];
929 } else {
930 dy = d[ns--];
931 }
932 y1 += dy;}
933 delete[] c;
934 delete[] d;
935
936 return y1;
937}
938
753690b0 939