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