1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /////////////////////////////////////////////////////////////////////////////
20 // Implementation of AliGenlib to collect parametrisations used for //
21 // GSI simulations. //
22 // It is an extension of AliMUONLib providing in addition the option //
23 // for different parametrisations of pt, y and ip for every particle type //
25 // Responsible: Andres.Sandoval@cern.ch //
27 /////////////////////////////////////////////////////////////////////////////
32 #include "AliGenGSIlib.h"
35 ClassImp(AliGenGSIlib)
37 //==========================================================================
39 // Definition of Particle Distributions
41 //==========================================================================
45 //--------------------------------------------------------------------------
47 // upsilon particle composition
49 //--------------------------------------------------------------------------
50 Int_t AliGenGSIlib::IpUpsilon(TRandom *)
52 // Return upsilon pdg code
57 Double_t AliGenGSIlib::PtUpsilonFlat( const Double_t *px, const Double_t */*dummy*/ )
59 //--------------------------------------------------------------------------
61 // upsilon pt-distribution FLAT
63 //____________________________________________________________--------------
65 const Double_t kptmin = 0.0;
66 const Double_t kptmax = 15.0;
70 if ((x > kptmin) && (x < kptmax)) weight = 1.;
75 Double_t AliGenGSIlib::YUpsilonFlat(const Double_t *py, const Double_t */*dummy*/)
77 //--------------------------------------------------------------------------
79 // upsilon y-distribution FLAT
81 //--------------------------------------------------------------------------
83 const Double_t ky0 = 1.5;
86 Double_t y=TMath::Abs(*py);
96 Double_t AliGenGSIlib::PtUpsilonRitman( const Double_t *px, const Double_t */*dummy*/ )
98 //--------------------------------------------------------------------------
100 // upsilon pt-distribution RITMAN
102 //--------------------------------------------------------------------------
104 const Double_t kpt0 = 4.7;
105 const Double_t kxn = 3.5;
108 Double_t pass1 = 1.+((x*x)/(kpt0*kpt0));
110 return x/TMath::Power(pass1,kxn);
113 Double_t AliGenGSIlib::YUpsilonRitman(const Double_t *py, const Double_t */*dummy*/)
115 //--------------------------------------------------------------------------
117 // upsilon y-distribution RITMAN
119 //--------------------------------------------------------------------------
121 const Double_t ky0 = 3.;
122 const Double_t kb=1.;
124 Double_t y=TMath::Abs(*py);
129 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
134 Double_t AliGenGSIlib::PtUpsilonKarel( const Double_t */*px*/, const Double_t */*dummy*/ )
136 //--------------------------------------------------------------------------
138 // upsilon pt-distribution kAREL
140 //--------------------------------------------------------------------------
146 Double_t AliGenGSIlib::YUpsilonKarel(const Double_t */*py*/, const Double_t */*dummy*/)
148 //--------------------------------------------------------------------------
150 // upsilon y-distribution KAREL
152 //--------------------------------------------------------------------------
159 Double_t AliGenGSIlib::PtUpsilonMUON( const Double_t *px, const Double_t */*dummy*/ )
161 //--------------------------------------------------------------------------
163 // upsilon pt-distribution MUONlib
165 //--------------------------------------------------------------------------
167 const Double_t kpt0 = 5.3;
168 const Double_t kxn = 2.5;
171 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
173 return x/TMath::Power(pass1,kxn);
176 Double_t AliGenGSIlib::YUpsilonMUON(const Double_t *py, const Double_t */*dummy*/)
178 //--------------------------------------------------------------------------
180 // upsilon y-distribution MUONlib
182 //--------------------------------------------------------------------------
184 const Double_t ky0 = 3.;
185 const Double_t kb=1.;
187 Double_t y=TMath::Abs(*py);
192 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
197 //--------------------------------------------------------------------------
201 Int_t AliGenGSIlib::IpJpsi(TRandom *)
203 //--------------------------------------------------------------------------
205 // J/Psi particle composition
207 //--------------------------------------------------------------------------
212 Double_t AliGenGSIlib::PtJpsiFlat( const Double_t *px, const Double_t */*dummy*/ )
214 //--------------------------------------------------------------------------
216 // J/Psi pt-distribution FLAT
218 //--------------------------------------------------------------------------
220 const Double_t kptmin = 0.0;
221 const Double_t kptmax = 15.0;
223 Double_t weight = 0.;
225 if ((x > kptmin) && (x < kptmax)) weight = 1.;
230 Double_t AliGenGSIlib::YJpsiFlat(const Double_t *py, const Double_t */*dummy*/)
232 //--------------------------------------------------------------------------
234 // J/Psi y-distribution FLAT
236 //--------------------------------------------------------------------------
238 const Double_t ky0 = 1.5;
239 const Double_t kb=1.;
241 Double_t y=TMath::Abs(*py);
251 Double_t AliGenGSIlib::PtJpsiMUON( const Double_t *px, const Double_t */*dummy*/ )
253 //--------------------------------------------------------------------------
255 // J/Psi pt-distribution MUONlib
257 //--------------------------------------------------------------------------
259 const Double_t kpt0 = 4.;
260 const Double_t kxn = 3.6;
263 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
264 return x/TMath::Power(pass1,kxn);
267 Double_t AliGenGSIlib::PtJpsiRitman( const Double_t *px, const Double_t */*dummy*/ )
269 //--------------------------------------------------------------------------
271 // J/Psi pt-distribution Ritman
273 //--------------------------------------------------------------------------
275 const Double_t kpt0 = 2.3;
276 const Double_t kxn = 3.5;
279 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
281 return x/TMath::Power(pass1,kxn);
284 Double_t AliGenGSIlib::YJpsiMUON(const Double_t *py, const Double_t */*dummy*/)
286 //--------------------------------------------------------------------------
288 // J/Psi y-distribution MUONlib
290 //--------------------------------------------------------------------------
292 const Double_t ky0 = 4.;
293 const Double_t kb=1.;
295 Double_t y=TMath::Abs(*py);
300 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
304 //--------------------------------------------------------------------------
306 // J/Psi pt-distribution by Sergei
308 //--------------------------------------------------------------------------
309 //Double_t AliGenGSIlib::PtJpsi( Double_t *px, Double_t */*dummy*/ )
312 // return x = gRandom->Rndm()*10.;
315 //--------------------------------------------------------------------------
317 // J/Psi y-distribution by Sergei
319 //--------------------------------------------------------------------------
320 /*Double_t AliGenGSIlib::YJpsi(Double_t *py, Double_t *dummy)
323 const Double_t ky0 = 4.;
324 const Double_t kb=1.;
326 Double_t y=TMath::Abs(*py);
331 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
336 //--------------------------------------------------------------------------
340 //--------------------------------------------------------------------------
341 Int_t AliGenGSIlib::IpCharm(TRandom *ran)
344 // charm particle composition
346 //--------------------------------------------------------------------------
351 random = ran->Rndm();
354 } else if (random < 0.75) {
356 } else if (random < 0.90) {
361 if (ran->Rndm() < 0.5) {ip=-ip;}
366 Double_t AliGenGSIlib::PtCharmFlat( const Double_t *px, const Double_t */*dummy*/)
368 //--------------------------------------------------------------------------
370 // charm pt-distribution, FLAT
372 //--------------------------------------------------------------------------
381 Double_t AliGenGSIlib::PtCharmGSI( const Double_t *px, const Double_t */*dummy*/)
383 //--------------------------------------------------------------------------
385 // charm pt-distribution, from Dariuzs Miskowiec
387 //--------------------------------------------------------------------------
389 //Taken from PYTHIA with MRS D-' (3031 from PDFLIB), K=3.0
390 const Double_t kp1 = 1.3;
391 const Double_t kp2 = 0.39;
392 const Double_t kp3 = 0.018;
393 const Double_t kp4 = 0.91;
396 Double_t pass1 =TMath::Exp(-x/kp2) ;
397 Double_t pass2 =TMath::Exp(-x/kp4) ;
398 return TMath::Power(x,kp1) * (pass1 + kp3 * pass2);
401 Double_t AliGenGSIlib::PtCharmMUON( const Double_t *px, const Double_t */*dummy*/)
403 //--------------------------------------------------------------------------
405 // charm pt-distribution, from MUONlib
407 //--------------------------------------------------------------------------
409 const Double_t kpt0 = 4.08;
410 const Double_t kxn = 9.40;
413 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
415 return x/TMath::Power(pass1,kxn);
418 Double_t AliGenGSIlib::YCharm( const Double_t *px, const Double_t */*dummy*/)
420 //--------------------------------------------------------------------------
422 // charm y-distribution
424 //--------------------------------------------------------------------------
428 return YJpsiMUON(px,dum);
431 //--------------------------------------------------------------------------
435 //--------------------------------------------------------------------------
436 Int_t AliGenGSIlib::IpBeauty(TRandom *ran)
439 // beauty particle composition
441 //--------------------------------------------------------------------------
445 random = ran->Rndm();
448 } else if (random < 0.75) {
450 } else if (random < 0.90) {
455 if (ran->Rndm() < 0.5) {ip=-ip;}
459 Double_t AliGenGSIlib::PtBeautyFlat( const Double_t *px, const Double_t */*dummy*/)
461 //--------------------------------------------------------------------------
463 // beauty pt-distribution, FLAT
465 //--------------------------------------------------------------------------
474 Double_t AliGenGSIlib::PtBeautyGSI( const Double_t *px, const Double_t */*dummy*/)
476 //--------------------------------------------------------------------------
479 // beauty pt-distribution, from D. Miskowiec
481 //--------------------------------------------------------------------------
483 //Taken from PYTHIA with MRS D-' (3031 from PDFLIB), K=3.0
484 const Double_t kp1 = 1.3;
485 const Double_t kp2 = 1.78;
486 const Double_t kp3 = 0.0096;
487 const Double_t kp4 = 4.16;
490 Double_t pass1 =TMath::Exp(-x/kp2) ;
491 Double_t pass2 =TMath::Exp(-x/kp4) ;
493 return TMath::Power(x,kp1) * (pass1 + kp3 * pass2);
496 Double_t AliGenGSIlib::PtBeautyMUON( const Double_t *px, const Double_t */*dummy*/)
498 //--------------------------------------------------------------------------
500 // beauty pt-distribution, from MUONlib
502 //--------------------------------------------------------------------------
504 const Double_t kpt0 = 4.;
505 const Double_t kxn = 3.6;
508 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
510 return x/TMath::Power(pass1,kxn);
513 Double_t AliGenGSIlib::YBeauty( const Double_t *px, const Double_t */*dummy*/)
515 //--------------------------------------------------------------------------
517 // beauty y-distribution
519 //--------------------------------------------------------------------------
523 return YJpsiMUON(px,dum);
526 //--------------------------------------------------------------------------
530 //--------------------------------------------------------------------------
531 Int_t AliGenGSIlib::IpEta(TRandom *)
534 // eta particle composition
536 //--------------------------------------------------------------------------
541 Double_t AliGenGSIlib::PtEtaPHOS( const Double_t *px, const Double_t */*dummy*/ )
543 //--------------------------------------------------------------------------
545 // eta pt-distribution
547 //____________________________________________________________--------------
549 return PtScal(*px,2); // 2==> Eta in the PtScal function
552 Double_t AliGenGSIlib::YEtaPHOS(const Double_t *py, const Double_t */*dummy*/)
554 //--------------------------------------------------------------------------
556 // eta y-distribution
558 //--------------------------------------------------------------------------
560 const Double_t ka = 1000.;
561 const Double_t kdy = 4.;
563 Double_t y=TMath::Abs(*py);
565 Double_t ex = y*y/(2*kdy*kdy);
567 return ka*TMath::Exp(-ex);
570 //--------------------------------------------------------------------------
574 //--------------------------------------------------------------------------
575 Int_t AliGenGSIlib::IpEtaprime(TRandom *)
578 // etaprime particle composition
580 //--------------------------------------------------------------------------
585 Double_t AliGenGSIlib::PtEtaprimePHOS( const Double_t *px, const Double_t */*dummy*/ )
587 //--------------------------------------------------------------------------
589 // etaprime pt-distribution
591 //____________________________________________________________--------------
593 return PtScal(*px,4); // 4==> Etaprime in the PtScal function
596 Double_t AliGenGSIlib::YEtaprimePHOS(const Double_t *py, const Double_t */*dummy*/)
598 //--------------------------------------------------------------------------
600 // etaprime y-distribution
602 //--------------------------------------------------------------------------
604 const Double_t ka = 1000.;
605 const Double_t kdy = 4.;
607 Double_t y=TMath::Abs(*py);
609 Double_t ex = y*y/(2*kdy*kdy);
611 return ka*TMath::Exp(-ex);
614 //--------------------------------------------------------------------------
618 //--------------------------------------------------------------------------
619 Int_t AliGenGSIlib::IpOmega(TRandom *)
622 // omega particle composition
624 //--------------------------------------------------------------------------
629 Double_t AliGenGSIlib::PtOmega( const Double_t *px, const Double_t */*dummy*/ )
631 //--------------------------------------------------------------------------
633 // omega pt-distribution
635 //____________________________________________________________--------------
637 return PtScal(*px,3); // 3==> Omega in the PtScal function
640 Double_t AliGenGSIlib::YOmega(const Double_t *py, const Double_t */*dummy*/)
642 //--------------------------------------------------------------------------
644 // omega y-distribution
646 //--------------------------------------------------------------------------
648 const Double_t ka = 1000.;
649 const Double_t kdy = 4.;
652 Double_t y=TMath::Abs(*py);
654 Double_t ex = y*y/(2*kdy*kdy);
656 return ka*TMath::Exp(-ex);
659 //--------------------------------------------------------------------------
663 //--------------------------------------------------------------------------
665 Int_t AliGenGSIlib::IpRho(TRandom *)
668 // rho particle composition
670 //--------------------------------------------------------------------------
675 Double_t AliGenGSIlib::PtRho( const Double_t *px, const Double_t */*dummy*/ )
677 //--------------------------------------------------------------------------
679 // rho pt-distribution
681 //____________________________________________________________--------------
683 return PtScal(*px,10); // 10==> Rho in the PtScal function
686 Double_t AliGenGSIlib::YRho(const Double_t *py, const Double_t */*dummy*/)
688 //--------------------------------------------------------------------------
690 // rho y-distribution
692 //--------------------------------------------------------------------------
694 const Double_t ka = 1000.;
695 const Double_t kdy = 4.;
698 Double_t y=TMath::Abs(*py);
700 Double_t ex = y*y/(2*kdy*kdy);
702 return ka*TMath::Exp(-ex);
705 //--------------------------------------------------------------------------
709 //--------------------------------------------------------------------------
710 Int_t AliGenGSIlib::IpPionPHOS(TRandom *ran)
713 // particle composition pi+, pi0, pi-
715 //--------------------------------------------------------------------------
717 Float_t random = ran->Rndm();
719 if ( (3.*random) < 1. )
725 if ( (3.*random) >= 2.)
735 Double_t AliGenGSIlib::PtPion( const Double_t *px, const Double_t */*dummy*/ )
737 //--------------------------------------------------------------------------
739 // pion pt-distribution
741 // Pion transverse momentum distribtuion as in AliGenMUONlib class,
742 // version 3.01 of aliroot:
743 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
744 // POWER LAW FOR PT > 500 MEV
745 // MT SCALING BELOW (T=160 MEV)
747 //____________________________________________________________--------------
749 const Double_t kp0 = 1.3;
750 const Double_t kxn = 8.28;
751 const Double_t kxlim=0.5;
752 const Double_t kt=0.160;
753 const Double_t kxmpi=0.139;
754 const Double_t kb=1.;
755 Double_t y, y1, kxmpi2, ynorm, a;
758 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
760 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
763 y=a*TMath::Power(kp0/(kp0+x),kxn);
765 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
769 Double_t AliGenGSIlib::YPion(const Double_t *py, const Double_t */*dummy*/)
771 //--------------------------------------------------------------------------
773 // pion y-distribution
775 //--------------------------------------------------------------------------
777 const Double_t ka = 7000.;
778 const Double_t kdy = 4.;
780 Double_t y=TMath::Abs(*py);
782 Double_t ex = y*y/(2*kdy*kdy);
784 return ka*TMath::Exp(-ex);
787 Int_t AliGenGSIlib::IpKaonPHOS(TRandom *ran)
789 //--------------------------------------------------------------------------
793 //--------------------------------------------------------------------------
795 // kaon particle composition K+, K-, Ko_short, Ko_long
797 //--------------------------------------------------------------------------
799 Float_t random = ran->Rndm();
800 Float_t random2 = ran->Rndm();
812 return 130; // K^0 short
814 return 310; // K^0 long
818 Double_t AliGenGSIlib::PtKaonPHOS( const Double_t *px, const Double_t */*dummy*/ )
820 //--------------------------------------------------------------------------
822 // kaon pt-distribution
824 //____________________________________________________________--------------
826 return PtScal(*px,1); // 1==> Kaon in the PtScal function
829 Double_t AliGenGSIlib::YKaonPHOS(const Double_t *py, const Double_t */*dummy*/)
831 //--------------------------------------------------------------------------
833 // kaon y-distribution
835 //--------------------------------------------------------------------------
837 const Double_t ka = 1000.;
838 const Double_t kdy = 4.;
840 Double_t y=TMath::Abs(*py);
842 Double_t ex = y*y/(2*kdy*kdy);
844 return ka*TMath::Exp(-ex);
847 //--------------------------------------------------------------------------
851 Int_t AliGenGSIlib::IpPhi(TRandom *)
853 //--------------------------------------------------------------------------
855 // particle composition
857 //--------------------------------------------------------------------------
862 Double_t AliGenGSIlib::PtPhiPHOS( const Double_t *px, const Double_t */*dummy*/ )
864 //--------------------------------------------------------------------------
866 // phi pt-distribution
868 //____________________________________________________________--------------
870 return PtScal(*px,5); // 5==> Phi in the PtScal function
873 Double_t AliGenGSIlib::YPhiPHOS(const Double_t *py, const Double_t */*dummy*/)
875 //--------------------------------------------------------------------------
877 // phi y-distribution
879 //--------------------------------------------------------------------------
881 const Double_t ka = 1000.;
882 const Double_t kdy = 4.;
885 Double_t y=TMath::Abs(*py);
887 Double_t ex = y*y/(2*kdy*kdy);
889 return ka*TMath::Exp(-ex);
892 Int_t AliGenGSIlib::IpBaryons(TRandom *ran)
894 //--------------------------------------------------------------------------
898 //--------------------------------------------------------------------------
900 // baryons particle composition p, pbar, n, nbar
902 //--------------------------------------------------------------------------
904 Float_t random = ran->Rndm();
905 Float_t random2 = ran->Rndm();
911 return -2212; // pbar
919 return -2112; // n bar
923 Double_t AliGenGSIlib::PtBaryons( const Double_t *px, const Double_t */*dummy*/ )
925 //--------------------------------------------------------------------------
927 // baryons pt-distribution
929 //____________________________________________________________--------------
931 return PtScal(*px,6); // 6==> Baryon in the PtScal function
934 Double_t AliGenGSIlib::YBaryons(const Double_t *py, const Double_t */*dummy*/)
936 //--------------------------------------------------------------------------
938 // baryons y-distribution
940 //--------------------------------------------------------------------------
942 const Double_t ka = 1000.;
943 const Double_t kdy = 4.;
945 Double_t y=TMath::Abs(*py);
947 Double_t ex = y*y/(2*kdy*kdy);
949 return ka*TMath::Exp(-ex);
952 //=============================================================
954 // Mt-scaling as in AliGenPHOSlib
956 //=============================================================
958 Double_t AliGenGSIlib::PtScal(Double_t pt, Int_t np)
960 // Function for the calculation of the Pt distribution for a
961 // given particle np, from the pion Pt distribution using the
964 // It was taken from AliGenPHOSlib aliroot version 3.04, which
965 // is an update of the one in AliGenMUONlib aliroot version 3.01
966 // with an extension for Baryons but supressing Rhos
967 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
968 // 7=>BARYONS-BARYONBARS
970 // The present adds the Rhos
972 // MASS 0=>PI, 1=>K, 2=>ETA, 3=>OMEGA, 4=>ETA', 5=>PHI
973 // 6=>BARYON-BARYONBAR, 10==>RHO
975 const Double_t khm[11] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
976 0.938, 0. , 0., 0., 0.769};
978 // VALUE MESON/PI AT 5 GEV
980 const Double_t kfmax[11]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
982 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
983 Double_t kfmax2=f5/kfmax[np];
985 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
986 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
987 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
988 return fmtscal*ptpion;
991 //==========================================================================
995 //==========================================================================
997 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
999 typedef Int_t (*GenFuncIp) (TRandom *);
1001 GenFunc AliGenGSIlib::GetPt(Int_t param, const char * tname) const
1003 // Return pointer to pT parameterisation
1005 TString sname(tname);
1011 func= PtUpsilonFlat;
1015 func= PtUpsilonMUON;
1018 if (sname=="RITMAN"){
1019 func=PtUpsilonRitman;
1022 if (sname=="KAREL"){
1023 func=PtUpsilonKarel;
1027 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1039 // if (sname=="SERGEI"){
1044 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1063 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1080 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1089 func=PtEtaprimePHOS;
1122 printf("<AliGenGSIlib::GetPt> unknown parametrisation\n");
1127 GenFunc AliGenGSIlib::GetY(Int_t param, const char * tname) const
1129 // Return pointer to y- parameterisation
1131 TString sname(tname);
1144 if (sname=="RITMAN"){
1145 func=YUpsilonRitman;
1148 if (sname=="KAREL"){
1153 printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
1165 // if (sname=="SERGEI"){
1171 printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
1220 printf("<AliGenGSIlib::GetY> unknown parametrisation\n");
1225 GenFuncIp AliGenGSIlib::GetIp(Int_t param, const char * tname) const
1227 // Return pointer to particle type parameterisation
1229 TString sname(tname);
1287 printf("<AliGenGSIlib::GetIp> unknown parametrisation\n");