]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenGSIlib.cxx
First commit.
[u/mrichter/AliRoot.git] / EVGEN / AliGenGSIlib.cxx
CommitLineData
014616eb 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 **************************************************************************/
fdcaa191 15
014616eb 16/*
17$Log$
f4cd22aa 18Revision 1.5 2001/05/15 15:43:23 morsch
19Update of library for low mass resonances (Yiota Foka)
20
fdcaa191 21Revision 1.4 2001/03/09 13:01:41 morsch
22- enum constants for paramterisation type (particle family) moved to AliGen*lib.h
23- use AliGenGSIlib::kUpsilon, AliGenPHOSlib::kEtaPrime to access the constants
24
34f60c01 25Revision 1.3 2000/12/21 16:24:06 morsch
26Coding convention clean-up
27
675e9664 28Revision 1.2 2000/11/30 07:12:50 alibrary
29Introducing new Rndm and QA classes
30
fdcaa191 31Revision 1.1 2000/06/15 08:48:43 morsch
32AliGenGSIlib with parametersations for GSI physics simulation added (YF, MI)
33
34Revision 1.7 2000/05/02 08:12:13 morsch
35Coding rule violations corrected.
36
37Revision 1.6 1999/09/29 09:24:14 fca
38Introduction of the Copyright and cvs Log
39
40*/
41
42/////////////////////////////////////////////////////////////////////////////
43// //
44// Implementation of AliGenlib to collect parametrisations used for //
45// GSI simulations. //
46// It is an extension of AliMUONLib providing in addition the option //
47// for different parametrisations of pt, y and ip for every particle type //
48// //
49// Responsible: Andres.Sandoval@cern.ch //
50// //
51/////////////////////////////////////////////////////////////////////////////
52
53#include "TMath.h"
54#include "TRandom.h"
55#include "TString.h"
56#include "AliGenGSIlib.h"
fdcaa191 57
58
59ClassImp(AliGenGSIlib)
60
61//==========================================================================
62//
63// Definition of Particle Distributions
64//
65//==========================================================================
66//
67// Upsilon
68//
69//--------------------------------------------------------------------------
70//
71// upsilon particle composition
72//
73//--------------------------------------------------------------------------
74Int_t AliGenGSIlib::IpUpsilon(TRandom *)
75{
f4cd22aa 76// Return upsilon pdg code
fdcaa191 77
78 return 553;
79
80}
f4cd22aa 81Double_t AliGenGSIlib::PtUpsilonFlat( Double_t *px, Double_t *dummy )
82{
fdcaa191 83//--------------------------------------------------------------------------
84//
85// upsilon pt-distribution FLAT
86//
87//____________________________________________________________--------------
f4cd22aa 88
fdcaa191 89 const Double_t kptmin = 0.0;
90 const Double_t kptmax = 15.0;
91 Double_t x=*px;
92 Double_t weight = 0.;
93
94 if (kptmin < x < kptmax) weight = 1.;
95
96 return weight;
97
98}
f4cd22aa 99Double_t AliGenGSIlib::YUpsilonFlat(Double_t *py, Double_t *dummy)
100{
fdcaa191 101//--------------------------------------------------------------------------
102//
103// upsilon y-distribution FLAT
104//
105//--------------------------------------------------------------------------
fdcaa191 106
107 const Double_t ky0 = 1.5;
108 const Double_t kb=1.;
109 Double_t yu;
110 Double_t y=TMath::Abs(*py);
111
112 if (y < ky0)
113 yu=kb;
114 else
115 yu = 0.;
116
117 return yu;
118
119}
f4cd22aa 120Double_t AliGenGSIlib::PtUpsilonRitman( Double_t *px, Double_t *dummy )
121{
fdcaa191 122//--------------------------------------------------------------------------
123//
124// upsilon pt-distribution RITMAN
125//
126//--------------------------------------------------------------------------
fdcaa191 127
128 const Double_t kpt0 = 4.7;
129 const Double_t kxn = 3.5;
130 Double_t x=*px;
131
132 Double_t pass1 = 1.+((x*x)/(kpt0*kpt0));
133
134 return x/TMath::Power(pass1,kxn);
135
136}
f4cd22aa 137Double_t AliGenGSIlib::YUpsilonRitman(Double_t *py, Double_t *dummy)
138{
fdcaa191 139//--------------------------------------------------------------------------
140//
141// upsilon y-distribution RITMAN
142//
143//--------------------------------------------------------------------------
fdcaa191 144
145 const Double_t ky0 = 3.;
146 const Double_t kb=1.;
147 Double_t yu;
148 Double_t y=TMath::Abs(*py);
149
150 if (y < ky0)
151 yu=kb;
152 else
153 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
154
155 return yu;
156
157}
f4cd22aa 158Double_t AliGenGSIlib::PtUpsilonKarel( Double_t *px, Double_t *dummy )
159{
fdcaa191 160//--------------------------------------------------------------------------
161//
162// upsilon pt-distribution kAREL
163//
164//--------------------------------------------------------------------------
f4cd22aa 165// to implement
fdcaa191 166
167 return 0.1;
168
169}
f4cd22aa 170Double_t AliGenGSIlib::YUpsilonKarel(Double_t *py, Double_t *dummy)
171{
fdcaa191 172//--------------------------------------------------------------------------
173//
174// upsilon y-distribution KAREL
175//
176//--------------------------------------------------------------------------
fdcaa191 177
178 //to implement
179
180 return 0.2;
181
182}
f4cd22aa 183Double_t AliGenGSIlib::PtUpsilonMUON( Double_t *px, Double_t *dummy )
184{
fdcaa191 185//--------------------------------------------------------------------------
186//
187// upsilon pt-distribution MUONlib
188//
189//--------------------------------------------------------------------------
fdcaa191 190
191 const Double_t kpt0 = 5.3;
192 const Double_t kxn = 2.5;
193 Double_t x=*px;
194
195 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
196
197 return x/TMath::Power(pass1,kxn);
198
199}
f4cd22aa 200Double_t AliGenGSIlib::YUpsilonMUON(Double_t *py, Double_t *dummy)
201{
fdcaa191 202//--------------------------------------------------------------------------
203//
204// upsilon y-distribution MUONlib
205//
206//--------------------------------------------------------------------------
fdcaa191 207
208 const Double_t ky0 = 3.;
209 const Double_t kb=1.;
210 Double_t yu;
211 Double_t y=TMath::Abs(*py);
212
213 if (y < ky0)
214 yu=kb;
215 else
216 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
217
218 return yu;
219
220}
221//--------------------------------------------------------------------------
222//
223// J/Psi
224//
f4cd22aa 225Int_t AliGenGSIlib::IpJpsi(TRandom *)
226{
fdcaa191 227//--------------------------------------------------------------------------
228//
229// J/Psi particle composition
230//
231//--------------------------------------------------------------------------
fdcaa191 232
233 return 443;
234
235}
f4cd22aa 236Double_t AliGenGSIlib::PtJpsiFlat( Double_t *px, Double_t *dummy )
237{
fdcaa191 238//--------------------------------------------------------------------------
239//
240// J/Psi pt-distribution FLAT
241//
242//--------------------------------------------------------------------------
fdcaa191 243
244 const Double_t kptmin = 0.0;
245 const Double_t kptmax = 15.0;
246 Double_t x=*px;
247 Double_t weight = 0.;
248
249 if (kptmin < x < kptmax) weight = 1.;
250
251 return weight;
252
253}
f4cd22aa 254Double_t AliGenGSIlib::YJpsiFlat(Double_t *py, Double_t *dummy)
255{
fdcaa191 256//--------------------------------------------------------------------------
257//
258// J/Psi y-distribution FLAT
259//
260//--------------------------------------------------------------------------
fdcaa191 261
262 const Double_t ky0 = 1.5;
263 const Double_t kb=1.;
264 Double_t yu;
265 Double_t y=TMath::Abs(*py);
266
267 if (y < ky0)
268 yu=kb;
269 else
270 yu = 0.;
271
272 return yu;
273
274}
f4cd22aa 275Double_t AliGenGSIlib::PtJpsiMUON( Double_t *px, Double_t *dummy )
276{
fdcaa191 277//--------------------------------------------------------------------------
278//
279// J/Psi pt-distribution MUONlib
280//
281//--------------------------------------------------------------------------
fdcaa191 282
283 const Double_t kpt0 = 4.;
284 const Double_t kxn = 3.6;
285 Double_t x=*px;
286
287 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
288 return x/TMath::Power(pass1,kxn);
289
290}
f4cd22aa 291Double_t AliGenGSIlib::PtJpsiRitman( Double_t *px, Double_t *dummy )
292{
fdcaa191 293//--------------------------------------------------------------------------
294//
295// J/Psi pt-distribution Ritman
296//
297//--------------------------------------------------------------------------
fdcaa191 298
299 const Double_t kpt0 = 2.3;
300 const Double_t kxn = 3.5;
301 Double_t x=*px;
302
303 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
304
305 return x/TMath::Power(pass1,kxn);
306
307}
f4cd22aa 308Double_t AliGenGSIlib::YJpsiMUON(Double_t *py, Double_t *dummy)
309{
fdcaa191 310//--------------------------------------------------------------------------
311//
312// J/Psi y-distribution MUONlib
313//
314//--------------------------------------------------------------------------
fdcaa191 315
316 const Double_t ky0 = 4.;
317 const Double_t kb=1.;
318 Double_t yj;
319 Double_t y=TMath::Abs(*py);
320
321 if (y < ky0)
322 yj=kb;
323 else
324 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
325 return yj;
326
327}
328//--------------------------------------------------------------------------
329//
330// J/Psi pt-distribution by Sergei
331//
332//--------------------------------------------------------------------------
333//Double_t AliGenGSIlib::PtJpsi( Double_t *px, Double_t *dummy )
334//{
335
336// return x = gRandom->Rndm()*10.;
337
338//}
339//--------------------------------------------------------------------------
340//
341// J/Psi y-distribution by Sergei
342//
343//--------------------------------------------------------------------------
344/*Double_t AliGenGSIlib::YJpsi(Double_t *py, Double_t *dummy)
345{
346
347 const Double_t ky0 = 4.;
348 const Double_t kb=1.;
349 Double_t yj;
350 Double_t y=TMath::Abs(*py);
351 //
352 if (y < ky0)
353 yj=kb;
354 else
355 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
356 return yj;
357
358}
359*/
360//--------------------------------------------------------------------------
361//
362// Charm
363//
364//--------------------------------------------------------------------------
f4cd22aa 365Int_t AliGenGSIlib::IpCharm(TRandom *ran)
366{
fdcaa191 367//
368// charm particle composition
369//
370//--------------------------------------------------------------------------
fdcaa191 371
372 Float_t random;
373 Int_t ip;
374 // 411,421,431,4122
375 random = ran->Rndm();
376 if (random < 0.5) {
377 ip=411;
378 } else if (random < 0.75) {
379 ip=421;
380 } else if (random < 0.90) {
381 ip=431;
382 } else {
383 ip=4122;
384 }
385 if (ran->Rndm() < 0.5) {ip=-ip;}
386
387 return ip;
388
389}
f4cd22aa 390Double_t AliGenGSIlib::PtCharmFlat( Double_t *px, Double_t *dummy)
391{
fdcaa191 392//--------------------------------------------------------------------------
393//
394// charm pt-distribution, FLAT
395//
396//--------------------------------------------------------------------------
fdcaa191 397
398 Double_t x=*px;
399
400 if (x>10.) x = 0.;
401 else x=1.;
402 return x ;
403
404}
f4cd22aa 405Double_t AliGenGSIlib::PtCharmGSI( Double_t *px, Double_t *dummy)
406{
fdcaa191 407//--------------------------------------------------------------------------
408//
409// charm pt-distribution, from Dariuzs Miskowiec
410//
411//--------------------------------------------------------------------------
f4cd22aa 412
fdcaa191 413 //Taken from PYTHIA with MRS D-' (3031 from PDFLIB), K=3.0
414 const Double_t kp1 = 1.3;
415 const Double_t kp2 = 0.39;
416 const Double_t kp3 = 0.018;
417 const Double_t kp4 = 0.91;
418 Double_t x=*px;
419
420 Double_t pass1 =TMath::Exp(-x/kp2) ;
421 Double_t pass2 =TMath::Exp(-x/kp4) ;
422 return TMath::Power(x,kp1) * (pass1 + kp3 * pass2);
423
424}
f4cd22aa 425Double_t AliGenGSIlib::PtCharmMUON( Double_t *px, Double_t *dummy)
426{
fdcaa191 427//--------------------------------------------------------------------------
428//
429// charm pt-distribution, from MUONlib
430//
431//--------------------------------------------------------------------------
fdcaa191 432
433 const Double_t kpt0 = 4.08;
434 const Double_t kxn = 9.40;
435 Double_t x=*px;
436
437 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
438
439 return x/TMath::Power(pass1,kxn);
440
441}
f4cd22aa 442Double_t AliGenGSIlib::YCharm( Double_t *px, Double_t *dummy)
443{
fdcaa191 444//--------------------------------------------------------------------------
445//
446// charm y-distribution
447//
448//--------------------------------------------------------------------------
fdcaa191 449
450 Double_t *dum=0;
451
452 return YJpsiMUON(px,dum);
453
454}
455//--------------------------------------------------------------------------
456//
457// Beauty
458//
459//--------------------------------------------------------------------------
f4cd22aa 460Int_t AliGenGSIlib::IpBeauty(TRandom *ran)
461{
fdcaa191 462//
463// beauty particle composition
464//
465//--------------------------------------------------------------------------
fdcaa191 466
467 Float_t random;
468 Int_t ip;
469 random = ran->Rndm();
470 if (random < 0.5) {
471 ip=511;
472 } else if (random < 0.75) {
473 ip=521;
474 } else if (random < 0.90) {
475 ip=531;
476 } else {
477 ip=5122;
478 }
479 if (ran->Rndm() < 0.5) {ip=-ip;}
480
481 return ip;
482}
f4cd22aa 483Double_t AliGenGSIlib::PtBeautyFlat( Double_t *px, Double_t *dummy)
484{
fdcaa191 485//--------------------------------------------------------------------------
486//
487// beauty pt-distribution, FLAT
488//
489//--------------------------------------------------------------------------
fdcaa191 490
491 Double_t x=*px;
492
493 if (x>10.) x=0.;
494 else x = 1.;
495 return x ;
496
497}
f4cd22aa 498Double_t AliGenGSIlib::PtBeautyGSI( Double_t *px, Double_t *dummy)
499{
fdcaa191 500//--------------------------------------------------------------------------
501//
502//
503// beauty pt-distribution, from D. Miskowiec
504//
505//--------------------------------------------------------------------------
f4cd22aa 506
fdcaa191 507 //Taken from PYTHIA with MRS D-' (3031 from PDFLIB), K=3.0
508 const Double_t kp1 = 1.3;
509 const Double_t kp2 = 1.78;
510 const Double_t kp3 = 0.0096;
511 const Double_t kp4 = 4.16;
512 Double_t x=*px;
513
514 Double_t pass1 =TMath::Exp(-x/kp2) ;
515 Double_t pass2 =TMath::Exp(-x/kp4) ;
516
517 return TMath::Power(x,kp1) * (pass1 + kp3 * pass2);
518
519}
f4cd22aa 520Double_t AliGenGSIlib::PtBeautyMUON( Double_t *px, Double_t *dummy)
521{
fdcaa191 522//--------------------------------------------------------------------------
523//
524// beauty pt-distribution, from MUONlib
525//
526//--------------------------------------------------------------------------
fdcaa191 527
528 const Double_t kpt0 = 4.;
529 const Double_t kxn = 3.6;
530 Double_t x=*px;
531
532 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
533
534 return x/TMath::Power(pass1,kxn);
535
536}
f4cd22aa 537Double_t AliGenGSIlib::YBeauty( Double_t *px, Double_t *dummy)
538{
fdcaa191 539//--------------------------------------------------------------------------
540//
541// beauty y-distribution
542//
543//--------------------------------------------------------------------------
fdcaa191 544
545 Double_t *dum=0;
546
547 return YJpsiMUON(px,dum);
548
549}
550//--------------------------------------------------------------------------
551//
552// Eta
553//
554//--------------------------------------------------------------------------
f4cd22aa 555Int_t AliGenGSIlib::IpEta(TRandom *)
556{
fdcaa191 557//
558// eta particle composition
559//
560//--------------------------------------------------------------------------
fdcaa191 561
562 return 221;
563
564}
f4cd22aa 565Double_t AliGenGSIlib::PtEtaPHOS( Double_t *px, Double_t *dummy )
566{
fdcaa191 567//--------------------------------------------------------------------------
568//
569// eta pt-distribution
570//
571//____________________________________________________________--------------
fdcaa191 572
573 return PtScal(*px,3); // 3==> Eta in the PtScal function
574
575}
f4cd22aa 576Double_t AliGenGSIlib::YEtaPHOS(Double_t *py, Double_t *dummy)
577{
fdcaa191 578//--------------------------------------------------------------------------
579//
580// eta y-distribution
581//
582//--------------------------------------------------------------------------
fdcaa191 583
584 const Double_t ka = 1000.;
585 const Double_t kdy = 4.;
586
587 Double_t y=TMath::Abs(*py);
588
589 Double_t ex = y*y/(2*kdy*kdy);
590
591 return ka*TMath::Exp(-ex);
592
593}
594//--------------------------------------------------------------------------
595//
596// Etaprime
597//
598//--------------------------------------------------------------------------
f4cd22aa 599Int_t AliGenGSIlib::IpEtaprime(TRandom *)
600{
fdcaa191 601//
602// etaprime particle composition
603//
604//--------------------------------------------------------------------------
fdcaa191 605
606 return 331;
607
608}
f4cd22aa 609Double_t AliGenGSIlib::PtEtaprimePHOS( Double_t *px, Double_t *dummy )
610{
fdcaa191 611//--------------------------------------------------------------------------
612//
613// etaprime pt-distribution
614//
615//____________________________________________________________--------------
fdcaa191 616
617 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
618
619}
f4cd22aa 620Double_t AliGenGSIlib::YEtaprimePHOS(Double_t *py, Double_t *dummy)
621{
fdcaa191 622//--------------------------------------------------------------------------
623//
624// etaprime y-distribution
625//
626//--------------------------------------------------------------------------
fdcaa191 627
628 const Double_t ka = 1000.;
629 const Double_t kdy = 4.;
630
631 Double_t y=TMath::Abs(*py);
632
633 Double_t ex = y*y/(2*kdy*kdy);
634
635 return ka*TMath::Exp(-ex);
636
637}
638//--------------------------------------------------------------------------
639//
640// omega
641//
642//--------------------------------------------------------------------------
f4cd22aa 643Int_t AliGenGSIlib::IpOmega(TRandom *)
644{
fdcaa191 645//
646// omega particle composition
647//
648//--------------------------------------------------------------------------
fdcaa191 649
650 return 223;
651
652}
f4cd22aa 653Double_t AliGenGSIlib::PtOmega( Double_t *px, Double_t *dummy )
654{
fdcaa191 655//--------------------------------------------------------------------------
656//
657// omega pt-distribution
658//
659//____________________________________________________________--------------
fdcaa191 660
661 return PtScal(*px,4); // 4==> Omega in the PtScal function
662
663}
f4cd22aa 664Double_t AliGenGSIlib::YOmega(Double_t *py, Double_t *dummy)
665{
fdcaa191 666//--------------------------------------------------------------------------
667//
668// omega y-distribution
669//
670//--------------------------------------------------------------------------
fdcaa191 671
672 const Double_t ka = 1000.;
673 const Double_t kdy = 4.;
674
675
676 Double_t y=TMath::Abs(*py);
677
678 Double_t ex = y*y/(2*kdy*kdy);
679
680 return ka*TMath::Exp(-ex);
681
682}
683//--------------------------------------------------------------------------
684//
685// Rho
686//
687//--------------------------------------------------------------------------
f4cd22aa 688
689Int_t AliGenGSIlib::IpRho(TRandom *)
690{
fdcaa191 691//
692// rho particle composition
693//
694//--------------------------------------------------------------------------
fdcaa191 695
696 return 113;
697
698}
f4cd22aa 699Double_t AliGenGSIlib::PtRho( Double_t *px, Double_t *dummy )
700{
fdcaa191 701//--------------------------------------------------------------------------
702//
703// rho pt-distribution
704//
705//____________________________________________________________--------------
65fb704d 706
fdcaa191 707 return PtScal(*px,11); // 11==> Rho in the PtScal function
708
709}
f4cd22aa 710Double_t AliGenGSIlib::YRho(Double_t *py, Double_t *dummy)
711{
fdcaa191 712//--------------------------------------------------------------------------
713//
714// rho y-distribution
715//
716//--------------------------------------------------------------------------
f4cd22aa 717
fdcaa191 718 const Double_t ka = 1000.;
719 const Double_t kdy = 4.;
014616eb 720
014616eb 721
fdcaa191 722 Double_t y=TMath::Abs(*py);
014616eb 723
fdcaa191 724 Double_t ex = y*y/(2*kdy*kdy);
675e9664 725
fdcaa191 726 return ka*TMath::Exp(-ex);
65fb704d 727
fdcaa191 728}
729//--------------------------------------------------------------------------
730//
731// Pion
732//
733//--------------------------------------------------------------------------
f4cd22aa 734Int_t AliGenGSIlib::IpPionPHOS(TRandom *ran)
735{
fdcaa191 736//
737// particle composition pi+, pi0, pi-
738//
739//--------------------------------------------------------------------------
014616eb 740
fdcaa191 741 Float_t random = ran->Rndm();
014616eb 742
fdcaa191 743 if ( (3.*random) < 1. )
744 {
745 return 211 ;
746 }
747 else
748 {
749 if ( (3.*random) >= 2.)
750 {
751 return -211 ;
752 }
753 else
754 {
755 return 111 ;
756 }
757 }
758}
f4cd22aa 759Double_t AliGenGSIlib::PtPion( Double_t *px, Double_t *dummy )
760{
fdcaa191 761//--------------------------------------------------------------------------
014616eb 762//
fdcaa191 763// pion pt-distribution
014616eb 764//
fdcaa191 765// Pion transverse momentum distribtuion as in AliGenMUONlib class,
766// version 3.01 of aliroot:
767// PT-PARAMETERIZATION CDF, PRL 61(88) 1819
768// POWER LAW FOR PT > 500 MEV
769// MT SCALING BELOW (T=160 MEV)
770//
771//____________________________________________________________--------------
fdcaa191 772
773 const Double_t kp0 = 1.3;
774 const Double_t kxn = 8.28;
775 const Double_t kxlim=0.5;
776 const Double_t kt=0.160;
777 const Double_t kxmpi=0.139;
778 const Double_t kb=1.;
779 Double_t y, y1, kxmpi2, ynorm, a;
014616eb 780 Double_t x=*px;
fdcaa191 781
782 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
783 kxmpi2=kxmpi*kxmpi;
784 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
785 a=ynorm/y1;
786 if (x > kxlim)
787 y=a*TMath::Power(kp0/(kp0+x),kxn);
788 else
789 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
790 return y*x;
014616eb 791
792}
f4cd22aa 793Double_t AliGenGSIlib::YPion(Double_t *py, Double_t *dummy)
794{
fdcaa191 795//--------------------------------------------------------------------------
014616eb 796//
fdcaa191 797// pion y-distribution
014616eb 798//
fdcaa191 799//--------------------------------------------------------------------------
014616eb 800
fdcaa191 801 const Double_t ka = 7000.;
802 const Double_t kdy = 4.;
014616eb 803
fdcaa191 804 Double_t y=TMath::Abs(*py);
805
806 Double_t ex = y*y/(2*kdy*kdy);
807
808 return ka*TMath::Exp(-ex);
809
810}
f4cd22aa 811Int_t AliGenGSIlib::IpKaonPHOS(TRandom *ran)
812{
fdcaa191 813//--------------------------------------------------------------------------
814//
815//
816// Kaon
817//--------------------------------------------------------------------------
818//
819// kaon particle composition K+, K-, Ko_short, Ko_long
820//
821//--------------------------------------------------------------------------
fdcaa191 822
823 Float_t random = ran->Rndm();
824 Float_t random2 = ran->Rndm();
825 if (random2 < 0.5)
826 {
827 if (random < 0.5) {
828 return 321; // K+
829 } else {
830 return -321; // K-
831 }
832 }
014616eb 833 else
fdcaa191 834 {
835 if (random < 0.5) {
836 return 130; // K^0 short
837 } else {
838 return 310; // K^0 long
839 }
840 }
014616eb 841}
f4cd22aa 842Double_t AliGenGSIlib::PtKaonPHOS( Double_t *px, Double_t *dummy )
843{
fdcaa191 844//--------------------------------------------------------------------------
014616eb 845//
fdcaa191 846// kaon pt-distribution
847//
848//____________________________________________________________--------------
fdcaa191 849
850 return PtScal(*px,2); // 2==> Kaon in the PtScal function
851
014616eb 852}
f4cd22aa 853Double_t AliGenGSIlib::YKaonPHOS(Double_t *py, Double_t *dummy)
854{
fdcaa191 855//--------------------------------------------------------------------------
856//
857// kaon y-distribution
858//
859//--------------------------------------------------------------------------
014616eb 860
fdcaa191 861 const Double_t ka = 1000.;
862 const Double_t kdy = 4.;
014616eb 863
fdcaa191 864 Double_t y=TMath::Abs(*py);
865
866 Double_t ex = y*y/(2*kdy*kdy);
867
868 return ka*TMath::Exp(-ex);
014616eb 869
014616eb 870}
fdcaa191 871//--------------------------------------------------------------------------
014616eb 872//
fdcaa191 873// Phi
014616eb 874//
f4cd22aa 875Int_t AliGenGSIlib::IpPhi(TRandom *)
876{
fdcaa191 877//--------------------------------------------------------------------------
878//
879// particle composition
880//
881//--------------------------------------------------------------------------
014616eb 882
fdcaa191 883 return 333;
014616eb 884
fdcaa191 885}
f4cd22aa 886Double_t AliGenGSIlib::PtPhiPHOS( Double_t *px, Double_t *dummy )
887{
fdcaa191 888//--------------------------------------------------------------------------
889//
890// phi pt-distribution
891//
892//____________________________________________________________--------------
fdcaa191 893
894 return PtScal(*px,6); // 6==> Phi in the PtScal function
895
014616eb 896}
f4cd22aa 897Double_t AliGenGSIlib::YPhiPHOS(Double_t *py, Double_t *dummy)
898{
fdcaa191 899//--------------------------------------------------------------------------
900//
901// phi y-distribution
902//
903//--------------------------------------------------------------------------
014616eb 904
fdcaa191 905 const Double_t ka = 1000.;
906 const Double_t kdy = 4.;
014616eb 907
908
fdcaa191 909 Double_t y=TMath::Abs(*py);
910
911 Double_t ex = y*y/(2*kdy*kdy);
912
913 return ka*TMath::Exp(-ex);
914
915}
f4cd22aa 916Int_t AliGenGSIlib::IpBaryons(TRandom *ran)
917{
fdcaa191 918//--------------------------------------------------------------------------
919//
920// Baryons
921//
922//--------------------------------------------------------------------------
923//
924// baryons particle composition p, pbar, n, nbar
925//
926//--------------------------------------------------------------------------
fdcaa191 927
928 Float_t random = ran->Rndm();
929 Float_t random2 = ran->Rndm();
930 if (random2 < 0.5)
931 {
932 if (random < 0.5) {
933 return 2212; // p
934 } else {
935 return -2212; // pbar
936 }
937 }
938 else
939 {
940 if (random < 0.5) {
941 return 2112; // n
942 } else {
943 return -2112; // n bar
944 }
945 }
014616eb 946}
f4cd22aa 947Double_t AliGenGSIlib::PtBaryons( Double_t *px, Double_t *dummy )
948{
fdcaa191 949//--------------------------------------------------------------------------
014616eb 950//
fdcaa191 951// baryons pt-distribution
014616eb 952//
fdcaa191 953//____________________________________________________________--------------
fdcaa191 954
955 return PtScal(*px,7); // 7==> Baryon in the PtScal function
956
957}
f4cd22aa 958Double_t AliGenGSIlib::YBaryons(Double_t *py, Double_t *dummy)
959{
fdcaa191 960//--------------------------------------------------------------------------
961//
962// baryons y-distribution
963//
964//--------------------------------------------------------------------------
fdcaa191 965
966 const Double_t ka = 1000.;
967 const Double_t kdy = 4.;
968
014616eb 969 Double_t y=TMath::Abs(*py);
fdcaa191 970
971 Double_t ex = y*y/(2*kdy*kdy);
972
973 return ka*TMath::Exp(-ex);
974
014616eb 975}
fdcaa191 976//=============================================================
977//
978// Mt-scaling as in AliGenPHOSlib
979//
980//=============================================================
014616eb 981//
fdcaa191 982 Double_t AliGenGSIlib::PtScal(Double_t pt, Int_t np)
014616eb 983{
fdcaa191 984// Function for the calculation of the Pt distribution for a
985// given particle np, from the pion Pt distribution using the
986// mt scaling.
987
988// It was taken from AliGenPHOSlib aliroot version 3.04, which
989// is an update of the one in AliGenMUONlib aliroot version 3.01
990// with an extension for Baryons but supressing Rhos
991// np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
992// 7=>BARYONS-BARYONBARS
993
994// The present adds the Rhos
995
996// MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA', 6=>PHI
997// 7=>BARYON-BARYONBAR, 11==>RHO
998
999 const Double_t khm[11] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
1000 0.938, 0. , 0., 0., 0.769};
1001
1002 // VALUE MESON/PI AT 5 GEV
1003
1004 const Double_t kfmax[11]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
1005
1006 np--;
1007 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
1008 Double_t kfmax2=f5/kfmax[np];
1009 // PIONS
1010 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
1011 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
1012 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
1013 return fmtscal*ptpion;
014616eb 1014}
1015
fdcaa191 1016//==========================================================================
1017//
1018// Set Getters
1019//
1020//==========================================================================
014616eb 1021
1022typedef Double_t (*GenFunc) (Double_t*, Double_t*);
1023
65fb704d 1024typedef Int_t (*GenFuncIp) (TRandom *);
014616eb 1025
f4cd22aa 1026GenFunc AliGenGSIlib::GetPt(Int_t param, const char * tname) const
014616eb 1027{
1028// Return pointer to pT parameterisation
fdcaa191 1029 GenFunc func=0;
1030 TString sname(tname);
1031
1032 switch (param)
014616eb 1033 {
34f60c01 1034 case kUpsilon:
fdcaa191 1035 if (sname=="FLAT"){
1036 func= PtUpsilonFlat;
1037 break;
1038 }
014616eb 1039 if (sname=="MUON"){
1040 func= PtUpsilonMUON;
1041 break;
1042 }
1043 if (sname=="RITMAN"){
1044 func=PtUpsilonRitman;
1045 break;
1046 }
1047 if (sname=="KAREL"){
1048 func=PtUpsilonKarel;
1049 break;
1050 }
1051 break;
1052 func=0;
1053 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
fdcaa191 1054
1055 case kJPsi:
1056 if (sname=="FLAT"){
1057 func= PtJpsiFlat;
1058 break;
1059 }
1060 if (sname=="MUON"){
1061 func= PtJpsiMUON;
1062 break;
1063 }
1064 // if (sname=="SERGEI"){
1065 // func= PtJpsi;
1066 // break;
1067 // }
1068 break;
1069 func=0;
1070 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1071
1072 case kCharm:
1073 if (sname=="FLAT"){
1074 func= PtCharmFlat;
1075 break;
1076 }
1077
1078 if (sname=="MUON"){
1079 func= PtCharmMUON;
1080 break;
1081 }
1082
1083 if (sname=="GSI"){
1084 func= PtCharmGSI;
1085 break;
1086 }
1087 break;
1088 func=0;
1089 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1090
1091 case kBeauty:
1092 if (sname=="FLAT"){
1093 func= PtBeautyFlat;
1094 break;
1095 }
1096 if (sname=="MUON"){
1097 func= PtBeautyMUON;
1098 break;
1099 }
1100 if (sname=="GSI"){
1101 func= PtBeautyGSI;
1102 break;
1103 }
1104 break;
1105 func=0;
1106 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1107
1108
1109 case kEta:
1110 func=PtEtaPHOS;
1111 break;
1112
1113 case kEtaprime:
1114 func=PtEtaprimePHOS;
1115 break;
1116
1117 case kOmega:
1118 func=PtOmega;
1119 break;
1120
1121 case kRho:
1122 func=PtRho;
1123 break;
1124
1125 case kKaon:
1126 func=PtKaonPHOS;
1127 break;
1128
1129 case kPion:
1130 func=PtPion;
1131 break;
1132
1133 case kPhi:
1134 func=PtPhiPHOS;
1135 break;
1136
1137 // case kLambda:
1138 // func=PtLambda;
1139 // break;
1140
1141 case kBaryons:
1142 func=PtBaryons;
1143 break;
1144
014616eb 1145 default:
1146 func=0;
1147 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1148 }
1149 return func;
1150}
1151
f4cd22aa 1152GenFunc AliGenGSIlib::GetY(Int_t param, const char * tname) const
014616eb 1153{
fdcaa191 1154// Return pointer to y- parameterisation
014616eb 1155 GenFunc func=0;
fdcaa191 1156 TString sname(tname);
1157
1158 switch (param)
014616eb 1159 {
34f60c01 1160 case kUpsilon:
fdcaa191 1161 if (sname=="FLAT"){
1162 func= YUpsilonFlat;
1163 break;
1164 }
014616eb 1165 if (sname=="MUON"){
1166 func= YUpsilonMUON;
1167 break;
1168 }
1169 if (sname=="RITMAN"){
1170 func=YUpsilonRitman;
1171 break;
1172 }
1173 if (sname=="KAREL"){
1174 func=YUpsilonKarel;
1175 break;
1176 }
1177 func=0;
1178 printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
1179 break;
fdcaa191 1180
1181 case kJPsi:
1182 if (sname=="FLAT"){
1183 func= YJpsiFlat;
1184 break;
1185 }
1186 if (sname=="MUON"){
1187 func= YJpsiMUON;
1188 break;
1189 }
1190 // if (sname=="SERGEI"){
1191 // func= YJpsi;
1192 // break;
1193 // }
1194
1195 func=0;
1196 printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
1197 break;
1198
1199 case kCharm:
1200 func= YCharm;
1201 break;
1202
1203 case kBeauty:
1204 func= YBeauty;
1205 break;
1206
1207 case kEta:
1208 func=YEtaPHOS;
1209 break;
1210
1211 case kEtaprime:
1212 func=YEtaprimePHOS;
1213 break;
1214
1215 case kOmega:
1216 func=YOmega;
1217 break;
1218
1219 case kRho:
1220 func=YRho;
1221 break;
1222
1223 case kKaon:
1224 func=YKaonPHOS;
1225 break;
1226
1227 case kPion:
1228 func=YPion;
1229 break;
1230
1231 case kPhi:
1232 func=YPhiPHOS;
1233 break;
1234
1235 // case kLambda:
1236 // func=YLambda;
1237 // break;
1238
1239 case kBaryons:
1240 func=YBaryons;
1241 break;
1242
014616eb 1243 default:
1244 func=0;
1245 printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
1246 }
1247 return func;
1248}
1249
f4cd22aa 1250GenFuncIp AliGenGSIlib::GetIp(Int_t param, const char * tname) const
014616eb 1251{
1252// Return pointer to particle type parameterisation
fdcaa191 1253 GenFuncIp func=0;
1254 TString sname(tname);
1255
1256 switch (param)
014616eb 1257 {
34f60c01 1258 case kUpsilon:
fdcaa191 1259 func= IpUpsilon;
014616eb 1260 break;
fdcaa191 1261
1262 case kJPsi:
1263 func= IpJpsi;
014616eb 1264 break;
fdcaa191 1265
1266 case kCharm:
1267 func= IpCharm;
014616eb 1268 break;
fdcaa191 1269
1270 case kBeauty:
1271 func= IpBeauty;
1272 break;
1273
1274 case kEta:
1275 func=IpEta;
1276 break;
1277
1278 case kEtaprime:
1279 func=IpEtaprime;
1280 break;
1281
1282 case kOmega:
1283 func=IpOmega;
1284 break;
1285
1286 case kRho:
1287 func=IpRho;
1288 break;
1289
1290 case kKaon:
1291 func=IpKaonPHOS;
1292 break;
1293
1294 case kPion:
1295 func=IpPionPHOS;
1296 break;
1297
1298 case kPhi:
1299 func=IpPhi;
1300 break;
1301
1302 // case kLambda:
1303 // func=IpLambda;
1304 // break;
1305
1306 case kBaryons:
1307 func=IpBaryons;
1308 break;
1309
014616eb 1310 default:
1311 func=0;
1312 printf("<AliGenGSIlib::GetIp> unknown parametrisation\n");
1313 }
1314 return func;
1315}
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327