]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVGEN/AliGenMUONlib.cxx
Digitize:
[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
16/*
17$Log$
b22ee262 18Revision 1.9 2000/06/14 15:20:56 morsch
19Include clean-up (IH)
20
5c3fd7ea 21Revision 1.8 2000/06/09 20:32:11 morsch
22All coding rule violations except RS3 corrected
23
f87cfe57 24Revision 1.7 2000/05/02 08:12:13 morsch
25Coding rule violations corrected.
26
d90f80fd 27Revision 1.6 1999/09/29 09:24:14 fca
28Introduction of the Copyright and cvs Log
29
4c039060 30*/
31
fe4da5cc 32#include "AliGenMUONlib.h"
f87cfe57 33#include "AliMC.h"
5c3fd7ea 34
fe4da5cc 35ClassImp(AliGenMUONlib)
36//
37// Pions
d90f80fd 38Double_t AliGenMUONlib::PtPion(Double_t *px, Double_t *dummy)
fe4da5cc 39{
40//
41// PT-PARAMETERIZATION CDF, PRL 61(88) 1819
42// POWER LAW FOR PT > 500 MEV
43// MT SCALING BELOW (T=160 MEV)
44//
d90f80fd 45 const Double_t kp0 = 1.3;
46 const Double_t kxn = 8.28;
47 const Double_t kxlim=0.5;
48 const Double_t kt=0.160;
49 const Double_t kxmpi=0.139;
50 const Double_t kb=1.;
fe4da5cc 51 Double_t y, y1, xmpi2, ynorm, a;
52 Double_t x=*px;
53 //
d90f80fd 54 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
55 xmpi2=kxmpi*kxmpi;
56 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
fe4da5cc 57 a=ynorm/y1;
d90f80fd 58 if (x > kxlim)
59 y=a*TMath::Power(kp0/(kp0+x),kxn);
fe4da5cc 60 else
d90f80fd 61 y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
fe4da5cc 62 return y*x;
63}
753690b0 64//
65// y-distribution
66//
d90f80fd 67Double_t AliGenMUONlib::YPion( Double_t *py, Double_t *dummy)
753690b0 68{
d90f80fd 69// Pion y
70 const Double_t ka = 7000.;
71 const Double_t kdy = 4.;
753690b0 72
73 Double_t y=TMath::Abs(*py);
74 //
d90f80fd 75 Double_t ex = y*y/(2*kdy*kdy);
76 return ka*TMath::Exp(-ex);
753690b0 77}
78// particle composition
79//
80Int_t AliGenMUONlib::IpPion()
81{
d90f80fd 82// Pion composition
753690b0 83 Float_t random[1];
cfce8870 84 gMC->Rndm(random,1);
753690b0 85 if (random[0] < 0.5) {
86 return 211;
87 } else {
88 return -211;
89 }
90}
fe4da5cc 91
92//____________________________________________________________
93//
94// Mt-scaling
95
96Double_t AliGenMUONlib::PtScal(Double_t pt, Int_t np)
97{
98 // SCALING EN MASSE PAR RAPPORT A PTPI
99 // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
d90f80fd 100 const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
fe4da5cc 101 // VALUE MESON/PI AT 5 GEV
d90f80fd 102 const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
fe4da5cc 103 np--;
d90f80fd 104 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
105 Double_t fmax2=f5/kfmax[np];
fe4da5cc 106 // PIONS
107 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
108 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
d90f80fd 109 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ fmax2;
fe4da5cc 110 return fmtscal*ptpion;
111}
112//
753690b0 113// kaon
114//
115// pt-distribution
116//____________________________________________________________
d90f80fd 117Double_t AliGenMUONlib::PtKaon( Double_t *px, Double_t *dummy)
753690b0 118{
d90f80fd 119// Kaon pT
753690b0 120 return PtScal(*px,2);
121}
122
123// y-distribution
fe4da5cc 124//____________________________________________________________
d90f80fd 125Double_t AliGenMUONlib::YKaon( Double_t *py, Double_t *dummy)
fe4da5cc 126{
d90f80fd 127// Kaon y
128 const Double_t ka = 1000.;
129 const Double_t kdy = 4.;
753690b0 130
131
fe4da5cc 132 Double_t y=TMath::Abs(*py);
133 //
d90f80fd 134 Double_t ex = y*y/(2*kdy*kdy);
135 return ka*TMath::Exp(-ex);
753690b0 136}
137
138// particle composition
139//
140Int_t AliGenMUONlib::IpKaon()
141{
d90f80fd 142// Kaon composition
753690b0 143 Float_t random[1];
cfce8870 144 gMC->Rndm(random,1);
753690b0 145 if (random[0] < 0.5) {
146 return 321;
147 } else {
148 return -321;
149 }
fe4da5cc 150}
753690b0 151
fe4da5cc 152// J/Psi
153//
154//
155// pt-distribution
156//____________________________________________________________
d90f80fd 157Double_t AliGenMUONlib::PtJpsi( Double_t *px, Double_t *dummy)
fe4da5cc 158{
d90f80fd 159// J/Psi pT
160 const Double_t kpt0 = 4.;
161 const Double_t kxn = 3.6;
fe4da5cc 162 Double_t x=*px;
163 //
d90f80fd 164 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
165 return x/TMath::Power(pass1,kxn);
fe4da5cc 166}
167//
168// y-distribution
169//____________________________________________________________
d90f80fd 170Double_t AliGenMUONlib::YJpsi(Double_t *py, Double_t *dummy)
fe4da5cc 171{
d90f80fd 172// J/psi y
173 const Double_t ky0 = 4.;
174 const Double_t kb=1.;
fe4da5cc 175 Double_t yj;
176 Double_t y=TMath::Abs(*py);
177 //
d90f80fd 178 if (y < ky0)
179 yj=kb;
fe4da5cc 180 else
d90f80fd 181 yj=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
fe4da5cc 182 return yj;
183}
184// particle composition
185//
186Int_t AliGenMUONlib::IpJpsi()
187{
d90f80fd 188// J/Psi composition
fe4da5cc 189 return 443;
190}
191
192// Upsilon
193//
194//
195// pt-distribution
196//____________________________________________________________
d90f80fd 197Double_t AliGenMUONlib::PtUpsilon( Double_t *px, Double_t *dummy )
fe4da5cc 198{
d90f80fd 199// Upsilon pT
200 const Double_t kpt0 = 5.3;
201 const Double_t kxn = 2.5;
fe4da5cc 202 Double_t x=*px;
203 //
d90f80fd 204 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
205 return x/TMath::Power(pass1,kxn);
fe4da5cc 206}
207//
208// y-distribution
209//
210//____________________________________________________________
d90f80fd 211Double_t AliGenMUONlib::YUpsilon(Double_t *py, Double_t *dummy)
fe4da5cc 212{
d90f80fd 213// Upsilon y
214 const Double_t ky0 = 3.;
215 const Double_t kb=1.;
fe4da5cc 216 Double_t yu;
217 Double_t y=TMath::Abs(*py);
218 //
d90f80fd 219 if (y < ky0)
220 yu=kb;
fe4da5cc 221 else
d90f80fd 222 yu=kb*TMath::Exp(-(y-ky0)*(y-ky0)/2);
fe4da5cc 223 return yu;
224}
225// particle composition
226//
227Int_t AliGenMUONlib::IpUpsilon()
228{
d90f80fd 229// y composition
fe4da5cc 230 return 553;
231}
232
233//
234// Phi
235//
236//
237// pt-distribution (by scaling of pion distribution)
238//____________________________________________________________
d90f80fd 239Double_t AliGenMUONlib::PtPhi( Double_t *px, Double_t *dummy)
fe4da5cc 240{
d90f80fd 241// Phi pT
fe4da5cc 242 return PtScal(*px,7);
243}
244// y-distribution
d90f80fd 245Double_t AliGenMUONlib::YPhi( Double_t *px, Double_t *dummy)
fe4da5cc 246{
d90f80fd 247// Phi y
248 Double_t *dum=0;
249 return YJpsi(px,dum);
fe4da5cc 250}
251// particle composition
252//
253Int_t AliGenMUONlib::IpPhi()
254{
d90f80fd 255// Phi composition
fe4da5cc 256 return 41;
257}
258
259//
260// Charm
261//
262//
263// pt-distribution
264//____________________________________________________________
d90f80fd 265Double_t AliGenMUONlib::PtCharm( Double_t *px, Double_t *dummy)
fe4da5cc 266{
d90f80fd 267// Charm pT
268 const Double_t kpt0 = 4.08;
269 const Double_t kxn = 9.40;
fe4da5cc 270 Double_t x=*px;
271 //
d90f80fd 272 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
273 return x/TMath::Power(pass1,kxn);
fe4da5cc 274}
275// y-distribution
d90f80fd 276Double_t AliGenMUONlib::YCharm( Double_t *px, Double_t *dummy)
fe4da5cc 277{
d90f80fd 278// Charm y
279 Double_t *dum=0;
280 return YJpsi(px,dum);
fe4da5cc 281}
282
283Int_t AliGenMUONlib::IpCharm()
284{
d90f80fd 285// Charm composition
fe4da5cc 286 Float_t random[2];
287 Int_t ip;
288// 411,421,431,4122
cfce8870 289 gMC->Rndm(random,2);
fe4da5cc 290 if (random[0] < 0.5) {
291 ip=411;
292 } else if (random[0] < 0.75) {
293 ip=421;
294 } else if (random[0] < 0.90) {
295 ip=431;
296 } else {
297 ip=4122;
298 }
299 if (random[1] < 0.5) {ip=-ip;}
300
301 return ip;
302}
303
304
305//
306// Beauty
307//
308//
309// pt-distribution
310//____________________________________________________________
d90f80fd 311Double_t AliGenMUONlib::PtBeauty( Double_t *px, Double_t *dummy)
fe4da5cc 312{
d90f80fd 313// Beauty pT
314 const Double_t kpt0 = 4.;
315 const Double_t kxn = 3.6;
fe4da5cc 316 Double_t x=*px;
317 //
d90f80fd 318 Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
319 return x/TMath::Power(pass1,kxn);
fe4da5cc 320}
321// y-distribution
d90f80fd 322Double_t AliGenMUONlib::YBeauty( Double_t *px, Double_t *dummy)
fe4da5cc 323{
d90f80fd 324// Beauty y
325 Double_t *dum=0;
326 return YJpsi(px,dum);
fe4da5cc 327}
328
329Int_t AliGenMUONlib::IpBeauty()
330{
d90f80fd 331// Beauty Composition
fe4da5cc 332 Float_t random[2];
333 Int_t ip;
cfce8870 334 gMC->Rndm(random,2);
fe4da5cc 335 if (random[0] < 0.5) {
336 ip=511;
337 } else if (random[0] < 0.75) {
338 ip=521;
339 } else if (random[0] < 0.90) {
340 ip=531;
341 } else {
342 ip=5122;
343 }
344 if (random[1] < 0.5) {ip=-ip;}
345
346 return ip;
347}
348
349typedef Double_t (*GenFunc) (Double_t*, Double_t*);
b22ee262 350GenFunc AliGenMUONlib::GetPt(Param_t param, const char* tname)
fe4da5cc 351{
d90f80fd 352// Return pointer to pT parameterisation
fe4da5cc 353 GenFunc func;
753690b0 354 switch (param)
fe4da5cc 355 {
753690b0 356 case phi_p:
fe4da5cc 357 func=PtPhi;
358 break;
753690b0 359 case jpsi_p:
fe4da5cc 360 func=PtJpsi;
361 break;
753690b0 362 case upsilon_p:
fe4da5cc 363 func=PtUpsilon;
364 break;
753690b0 365 case charm_p:
fe4da5cc 366 func=PtCharm;
367 break;
753690b0 368 case beauty_p:
fe4da5cc 369 func=PtBeauty;
370 break;
753690b0 371 case pion_p:
372 func=PtPion;
373 break;
374 case kaon_p:
375 func=PtKaon;
376 break;
119b35c7 377 default:
378 func=0;
379 printf("<AliGenMUONlib::GetPt> unknown parametrisation\n");
fe4da5cc 380 }
381 return func;
382}
383
b22ee262 384GenFunc AliGenMUONlib::GetY(Param_t param, const char* tname)
fe4da5cc 385{
d90f80fd 386// Return pointer to y- parameterisation
fe4da5cc 387 GenFunc func;
753690b0 388 switch (param)
fe4da5cc 389 {
753690b0 390 case phi_p:
fe4da5cc 391 func=YPhi;
392 break;
753690b0 393 case jpsi_p:
fe4da5cc 394 func=YJpsi;
395 break;
753690b0 396 case upsilon_p:
fe4da5cc 397 func=YUpsilon;
398 break;
753690b0 399 case charm_p:
fe4da5cc 400 func=YCharm;
401 break;
753690b0 402 case beauty_p:
fe4da5cc 403 func=YBeauty;
404 break;
753690b0 405 case pion_p:
406 func=YPion;
407 break;
408 case kaon_p:
409 func=YKaon;
410 break;
119b35c7 411 default:
412 func=0;
413 printf("<AliGenMUONlib::GetY> unknown parametrisation\n");
fe4da5cc 414 }
415 return func;
416}
417typedef Int_t (*GenFuncIp) ();
b22ee262 418GenFuncIp AliGenMUONlib::GetIp(Param_t param, const char* tname)
fe4da5cc 419{
d90f80fd 420// Return pointer to particle type parameterisation
fe4da5cc 421 GenFuncIp func;
753690b0 422 switch (param)
fe4da5cc 423 {
753690b0 424 case phi_p:
fe4da5cc 425 func=IpPhi;
426 break;
753690b0 427 case jpsi_p:
fe4da5cc 428 func=IpJpsi;
429 break;
753690b0 430 case upsilon_p:
fe4da5cc 431 func=IpUpsilon;
432 break;
753690b0 433 case charm_p:
fe4da5cc 434 func=IpCharm;
435 break;
753690b0 436 case beauty_p:
fe4da5cc 437 func=IpBeauty;
438 break;
753690b0 439 case pion_p:
440 func=IpPion;
441 break;
442 case kaon_p:
443 func=IpKaon;
444 break;
119b35c7 445 default:
446 func=0;
447 printf("<AliGenMUONlib::GetIp> unknown parametrisation\n");
fe4da5cc 448 }
449 return func;
450}
451
452
753690b0 453
454