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 Revision 1.14.6.1 2002/06/10 14:57:41 hristov
21 Revision 1.15 2002/04/17 10:11:51 morsch
22 Coding Rule violations corrected.
24 Revision 1.14 2002/02/22 17:26:43 morsch
27 Revision 1.13 2001/03/27 11:01:04 morsch
28 Charm pt-distribution corrected. More realistic y-distribution for pi and K.
30 Revision 1.12 2001/03/09 13:01:41 morsch
31 - enum constants for paramterisation type (particle family) moved to AliGen*lib.h
32 - use AliGenGSIlib::kUpsilon, AliGenPHOSlib::kEtaPrime to access the constants
34 Revision 1.11 2000/11/30 07:12:50 alibrary
35 Introducing new Rndm and QA classes
37 Revision 1.10 2000/06/29 21:08:27 morsch
38 All paramatrisation libraries derive from the pure virtual base class AliGenLib.
39 This allows to pass a pointer to a library directly to AliGenParam and avoids the
40 use of function pointers in Config.C.
42 Revision 1.9 2000/06/14 15:20:56 morsch
45 Revision 1.8 2000/06/09 20:32:11 morsch
46 All coding rule violations except RS3 corrected
48 Revision 1.7 2000/05/02 08:12:13 morsch
49 Coding rule violations corrected.
51 Revision 1.6 1999/09/29 09:24:14 fca
52 Introduction of the Copyright and cvs Log
56 // Library class for particle pt and y distributions used for
57 // muon spectrometer simulations.
58 // To be used with AliGenParam.
59 // The following particle typed can be simulated:
60 // pi, K, phi, omega, eta, J/Psi, Upsilon, charm and beauty mesons.
62 // andreas.morsch@cern.ch
68 #include "AliGenMUONlib.h"
70 ClassImp(AliGenMUONlib)
73 Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t *dummy)
76 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
77 // POWER LAW FOR PT > 500 MEV
78 // MT SCALING BELOW (T=160 MEV)
80 const Double_t kp0 = 1.3;
81 const Double_t kxn = 8.28;
82 const Double_t kxlim=0.5;
83 const Double_t kt=0.160;
84 const Double_t kxmpi=0.139;
86 Double_t y, y1, xmpi2, ynorm, a;
89 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
91 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
94 y=a*TMath::Power(kp0/(kp0+x),kxn);
96 y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
102 Double_t AliGenMUONlib::YPion( Double_t *py, Double_t *dummy)
105 Double_t y=TMath::Abs(*py);
107 const Double_t ka = 7000.;
108 const Double_t kdy = 4.;
109 Double_t ex = y*y/(2*kdy*kdy);
110 return ka*TMath::Exp(-ex);
112 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
115 // particle composition
117 Int_t AliGenMUONlib::IpPion(TRandom *ran)
120 if (ran->Rndm() < 0.5) {
127 //____________________________________________________________
131 Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np)
133 // SCALING EN MASSE PAR RAPPORT A PTPI
134 // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
135 const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
136 // VALUE MESON/PI AT 5 GEV
137 const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
139 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
140 Double_t fmax2=f5/kfmax[np];
142 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
143 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
144 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
145 return fmtscal*ptpion;
151 //____________________________________________________________
152 Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t *dummy)
155 return PtScal(*px,2);
159 //____________________________________________________________
160 Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t *dummy)
163 Double_t y=TMath::Abs(*py);
165 const Double_t ka = 1000.;
166 const Double_t kdy = 4.;
168 Double_t ex = y*y/(2*kdy*kdy);
169 return ka*TMath::Exp(-ex);
172 return 1.16526e+04+y*-3.79886e+03+y*y*4.31130e+02;
175 // particle composition
177 Int_t AliGenMUONlib::IpKaon(TRandom *ran)
180 if (ran->Rndm() < 0.5) {
191 //____________________________________________________________
192 Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t *dummy)
195 const Double_t kpt0 = 4.;
196 const Double_t kxn = 3.6;
199 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
200 return x/TMath::Power(pass1,kxn);
204 //____________________________________________________________
205 Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t *dummy)
208 const Double_t ky0 = 4.;
209 const Double_t kb=1.;
211 Double_t y=TMath::Abs(*py);
216 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
219 // particle composition
221 Int_t AliGenMUONlib::IpJpsi(TRandom *)
231 //____________________________________________________________
232 Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t *dummy )
235 const Double_t kpt0 = 5.3;
236 const Double_t kxn = 2.5;
239 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
240 return x/TMath::Power(pass1,kxn);
245 //____________________________________________________________
246 Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t *dummy)
249 const Double_t ky0 = 3.;
250 const Double_t kb=1.;
252 Double_t y=TMath::Abs(*py);
257 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
260 // particle composition
262 Int_t AliGenMUONlib::IpUpsilon(TRandom *)
272 // pt-distribution (by scaling of pion distribution)
273 //____________________________________________________________
274 Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t *dummy)
277 return PtScal(*px,7);
280 Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t *dummy)
284 return YJpsi(px,dum);
286 // particle composition
288 Int_t AliGenMUONlib::IpPhi(TRandom *)
298 // pt-distribution (by scaling of pion distribution)
299 //____________________________________________________________
300 Double_t AliGenMUONlib::PtOmega( Double_t *px, Double_t *dummy)
303 return PtScal(*px,5);
306 Double_t AliGenMUONlib::YOmega( Double_t *px, Double_t *dummy)
310 return YJpsi(px,dum);
312 // particle composition
314 Int_t AliGenMUONlib::IpOmega(TRandom *)
325 // pt-distribution (by scaling of pion distribution)
326 //____________________________________________________________
327 Double_t AliGenMUONlib::PtEta( Double_t *px, Double_t *dummy)
330 return PtScal(*px,3);
333 Double_t AliGenMUONlib::YEta( Double_t *px, Double_t *dummy)
337 return YJpsi(px,dum);
339 // particle composition
341 Int_t AliGenMUONlib::IpEta(TRandom *)
352 //____________________________________________________________
353 Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t *dummy)
356 const Double_t kpt0 = 4.08;
357 const Double_t kxn = 9.40;
361 Double_t pass1 = 1.+(x/kpt0);
362 return x/TMath::Power(pass1,kxn);
365 Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t *dummy)
369 return YJpsi(px,dum);
372 Int_t AliGenMUONlib::IpCharm(TRandom *ran)
378 random = ran->Rndm();
381 } else if (random < 0.75) {
383 } else if (random < 0.90) {
388 if (ran->Rndm() < 0.5) {ip=-ip;}
399 //____________________________________________________________
400 Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t *dummy)
403 const Double_t kpt0 = 4.;
404 const Double_t kxn = 3.6;
407 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
408 return x/TMath::Power(pass1,kxn);
411 Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t *dummy)
415 return YJpsi(px,dum);
418 Int_t AliGenMUONlib::IpBeauty(TRandom *ran)
420 // Beauty Composition
423 random = ran->Rndm();
426 } else if (random < 0.75) {
428 } else if (random < 0.90) {
433 if (ran->Rndm() < 0.5) {ip=-ip;}
438 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
439 GenFunc AliGenMUONlib::GetPt(Int_t param, const char* tname) const
441 // Return pointer to pT parameterisation
474 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
479 GenFunc AliGenMUONlib::GetY(Int_t param, const char* tname) const
481 // Return pointer to y- parameterisation
514 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
518 typedef Int_t (*GenFuncIp) (TRandom *);
519 GenFuncIp AliGenMUONlib::GetIp(Int_t param, const char* tname) const
521 // Return pointer to particle type parameterisation
554 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");