]>
Commit | Line | Data |
---|---|---|
886b6f73 | 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$ | |
65fb704d | 18 | Revision 1.5 2000/06/29 21:08:27 morsch |
19 | All paramatrisation libraries derive from the pure virtual base class AliGenLib. | |
20 | This allows to pass a pointer to a library directly to AliGenParam and avoids the | |
21 | use of function pointers in Config.C. | |
22 | ||
b22ee262 | 23 | Revision 1.4 2000/06/14 15:21:05 morsch |
24 | Include clean-up (IH) | |
25 | ||
5c3fd7ea | 26 | Revision 1.3 2000/06/09 20:32:54 morsch |
27 | All coding rule violations except RS3 corrected | |
28 | ||
f87cfe57 | 29 | Revision 1.2 1999/11/04 11:30:48 fca |
30 | Improve comments | |
31 | ||
9ae59e17 | 32 | Revision 1.1 1999/11/03 17:43:20 fca |
33 | New version from G.Martinez & A.Morsch | |
34 | ||
886b6f73 | 35 | */ |
36 | ||
37 | //====================================================================== | |
38 | // AliGenPHOSlib class contains parameterizations of the | |
39 | // pion, kaon, eta, omega, etaprime, phi and baryon (proton, | |
40 | // antiproton, neutron and anti-neutron) particles for the | |
41 | // study of the neutral background in PHOS detector. | |
42 | // These parameterizations are used by the | |
43 | // AliGenParam class: | |
44 | // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param), | |
45 | // AliGenPHOSlib::GetY(param), | |
46 | // AliGenPHOSlib::GetIp(param) ) | |
47 | // param represents the particle to be simulated : | |
48 | // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon | |
49 | // Pt distributions are calculated from the transverse mass scaling | |
9ae59e17 | 50 | // with Pions, using the PtScal function taken from AliGenMUONlib |
886b6f73 | 51 | // version aliroot 3.01 |
52 | // | |
9ae59e17 | 53 | // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ |
54 | // GPS @ SUBATECH, Nantes , France (October 1999) | |
886b6f73 | 55 | // http://www-subatech.in2p3.fr/~photons/subatech |
56 | // martinez@subatech.in2p3.fr | |
57 | //====================================================================== | |
58 | ||
65fb704d | 59 | #include "TMath.h" |
60 | #include "TRandom.h" | |
61 | ||
886b6f73 | 62 | #include "AliGenPHOSlib.h" |
886b6f73 | 63 | |
64 | ClassImp(AliGenPHOSlib) | |
65 | ||
66 | //====================================================================== | |
67 | // P I O N S | |
68 | // (From GetPt, GetY and GetIp as param = Pion) | |
69 | // Transverse momentum distribution" PtPion | |
70 | // Rapidity distribution YPion | |
71 | // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-) | |
72 | // | |
73 | Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *) | |
74 | { | |
75 | // Pion transverse momentum distribtuion taken | |
9ae59e17 | 76 | // from AliGenMUONlib class, version 3.01 of aliroot |
886b6f73 | 77 | // PT-PARAMETERIZATION CDF, PRL 61(88) 1819 |
78 | // POWER LAW FOR PT > 500 MEV | |
79 | // MT SCALING BELOW (T=160 MEV) | |
80 | // | |
f87cfe57 | 81 | const Double_t kp0 = 1.3; |
82 | const Double_t kxn = 8.28; | |
83 | const Double_t kxlim=0.5; | |
84 | const Double_t kt=0.160; | |
85 | const Double_t kxmpi=0.139; | |
86 | const Double_t kb=1.; | |
87 | Double_t y, y1, kxmpi2, ynorm, a; | |
886b6f73 | 88 | Double_t x=*px; |
89 | // | |
f87cfe57 | 90 | y1=TMath::Power(kp0/(kp0+kxlim),kxn); |
91 | kxmpi2=kxmpi*kxmpi; | |
92 | ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt)); | |
886b6f73 | 93 | a=ynorm/y1; |
f87cfe57 | 94 | if (x > kxlim) |
95 | y=a*TMath::Power(kp0/(kp0+x),kxn); | |
886b6f73 | 96 | else |
f87cfe57 | 97 | y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt); |
886b6f73 | 98 | return y*x; |
99 | } | |
886b6f73 | 100 | Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *) |
101 | { | |
f87cfe57 | 102 | // |
103 | // pion y-distribution | |
104 | // | |
105 | ||
106 | const Double_t ka = 7000.; | |
107 | const Double_t kdy = 4.; | |
886b6f73 | 108 | |
109 | Double_t y=TMath::Abs(*py); | |
110 | // | |
f87cfe57 | 111 | Double_t ex = y*y/(2*kdy*kdy); |
112 | return ka*TMath::Exp(-ex); | |
886b6f73 | 113 | } |
f87cfe57 | 114 | |
65fb704d | 115 | Int_t AliGenPHOSlib::IpPion(TRandom *ran) |
886b6f73 | 116 | { |
f87cfe57 | 117 | // particle composition pi+, pi0, pi- |
118 | // | |
119 | ||
65fb704d | 120 | Float_t random = ran->Rndm(); |
886b6f73 | 121 | |
65fb704d | 122 | if ( (3.*random) < 1. ) |
886b6f73 | 123 | { |
124 | return 211 ; | |
125 | } | |
126 | else | |
127 | { | |
65fb704d | 128 | if ( (3.*random) >= 2.) |
886b6f73 | 129 | { |
130 | return -211 ; | |
131 | } | |
132 | else | |
133 | { | |
134 | return 111 ; | |
135 | } | |
136 | } | |
137 | } | |
138 | // End Pions | |
139 | //============================================================= | |
140 | // | |
f87cfe57 | 141 | Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np) |
142 | { | |
886b6f73 | 143 | // Mt-scaling |
144 | // Fonction for the calculation of the Pt distribution for a | |
145 | // given particle np, from the pion Pt distribution using the | |
146 | // mt scaling. This function was taken from AliGenMUONlib | |
147 | // aliroot version 3.01, and was extended for baryons | |
148 | // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI | |
149 | // 7=>BARYONS-BARYONBARS | |
f87cfe57 | 150 | |
886b6f73 | 151 | // SCALING EN MASSE PAR RAPPORT A PTPI |
152 | // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI | |
f87cfe57 | 153 | const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02, |
886b6f73 | 154 | // MASS 7=>BARYON-BARYONBAR |
155 | 0.938, 0. , 0., 0.}; | |
156 | // VALUE MESON/PI AT 5 GEV | |
f87cfe57 | 157 | const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.}; |
886b6f73 | 158 | np--; |
f87cfe57 | 159 | Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3); |
160 | Double_t kfmax2=f5/kfmax[np]; | |
886b6f73 | 161 | // PIONS |
162 | Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0); | |
163 | Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/ | |
f87cfe57 | 164 | (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2; |
886b6f73 | 165 | return fmtscal*ptpion; |
166 | } | |
167 | // End Scaling | |
168 | //============================================================================ | |
169 | // K A O N S | |
886b6f73 | 170 | Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *) |
171 | { | |
f87cfe57 | 172 | // kaon |
173 | // pt-distribution | |
174 | //____________________________________________________________ | |
175 | ||
886b6f73 | 176 | return PtScal(*px,2); // 2==> Kaon in the PtScal function |
177 | } | |
178 | ||
886b6f73 | 179 | Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *) |
180 | { | |
f87cfe57 | 181 | // y-distribution |
182 | //____________________________________________________________ | |
183 | ||
184 | const Double_t ka = 1000.; | |
185 | const Double_t kdy = 4.; | |
886b6f73 | 186 | |
187 | ||
188 | Double_t y=TMath::Abs(*py); | |
189 | // | |
f87cfe57 | 190 | Double_t ex = y*y/(2*kdy*kdy); |
191 | return ka*TMath::Exp(-ex); | |
886b6f73 | 192 | } |
193 | ||
65fb704d | 194 | Int_t AliGenPHOSlib::IpKaon(TRandom *ran) |
886b6f73 | 195 | { |
f87cfe57 | 196 | // particle composition |
197 | // | |
198 | ||
65fb704d | 199 | Float_t random = ran->Rndm(); |
200 | Float_t random2 = ran->Rndm(); | |
201 | if (random2 < 0.5) | |
886b6f73 | 202 | { |
65fb704d | 203 | if (random < 0.5) { |
886b6f73 | 204 | return 321; // K+ |
205 | } else { | |
206 | return -321; // K- | |
207 | } | |
208 | } | |
209 | else | |
210 | { | |
65fb704d | 211 | if (random < 0.5) { |
9ae59e17 | 212 | return 130; // K^0 short |
886b6f73 | 213 | } else { |
9ae59e17 | 214 | return 310; // K^0 long |
886b6f73 | 215 | } |
216 | } | |
217 | } | |
218 | // End Kaons | |
219 | //============================================================================ | |
220 | //============================================================================ | |
221 | // E T A S | |
886b6f73 | 222 | Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *) |
223 | { | |
f87cfe57 | 224 | // etas |
225 | // pt-distribution | |
226 | //____________________________________________________________ | |
227 | ||
886b6f73 | 228 | return PtScal(*px,3); // 3==> Eta in the PtScal function |
229 | } | |
230 | ||
886b6f73 | 231 | Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *) |
232 | { | |
f87cfe57 | 233 | // y-distribution |
234 | //____________________________________________________________ | |
235 | ||
236 | const Double_t ka = 1000.; | |
237 | const Double_t kdy = 4.; | |
886b6f73 | 238 | |
239 | ||
240 | Double_t y=TMath::Abs(*py); | |
241 | // | |
f87cfe57 | 242 | Double_t ex = y*y/(2*kdy*kdy); |
243 | return ka*TMath::Exp(-ex); | |
886b6f73 | 244 | } |
245 | ||
65fb704d | 246 | Int_t AliGenPHOSlib::IpEta(TRandom *) |
886b6f73 | 247 | { |
f87cfe57 | 248 | // particle composition |
249 | // | |
250 | ||
886b6f73 | 251 | return 221; // eta |
252 | } | |
253 | // End Etas | |
254 | //============================================================================ | |
255 | //============================================================================ | |
256 | // O M E G A S | |
f87cfe57 | 257 | Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *) |
258 | { | |
886b6f73 | 259 | // omegas |
260 | // pt-distribution | |
261 | //____________________________________________________________ | |
f87cfe57 | 262 | |
886b6f73 | 263 | return PtScal(*px,4); // 4==> Omega in the PtScal function |
264 | } | |
265 | ||
886b6f73 | 266 | Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *) |
267 | { | |
f87cfe57 | 268 | // y-distribution |
269 | //____________________________________________________________ | |
270 | ||
271 | const Double_t ka = 1000.; | |
272 | const Double_t kdy = 4.; | |
886b6f73 | 273 | |
274 | ||
275 | Double_t y=TMath::Abs(*py); | |
276 | // | |
f87cfe57 | 277 | Double_t ex = y*y/(2*kdy*kdy); |
278 | return ka*TMath::Exp(-ex); | |
886b6f73 | 279 | } |
280 | ||
65fb704d | 281 | Int_t AliGenPHOSlib::IpOmega(TRandom *) |
886b6f73 | 282 | { |
f87cfe57 | 283 | // particle composition |
284 | // | |
285 | ||
886b6f73 | 286 | return 223; // Omega |
287 | } | |
288 | // End Omega | |
289 | //============================================================================ | |
290 | //============================================================================ | |
291 | // E T A P R I M E | |
f87cfe57 | 292 | Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *) |
293 | { | |
886b6f73 | 294 | // etaprime |
295 | // pt-distribution | |
296 | //____________________________________________________________ | |
f87cfe57 | 297 | |
886b6f73 | 298 | return PtScal(*px,5); // 5==> Etaprime in the PtScal function |
299 | } | |
300 | ||
886b6f73 | 301 | Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *) |
302 | { | |
f87cfe57 | 303 | // y-distribution |
304 | //____________________________________________________________ | |
305 | ||
306 | const Double_t ka = 1000.; | |
307 | const Double_t kdy = 4.; | |
886b6f73 | 308 | |
309 | ||
310 | Double_t y=TMath::Abs(*py); | |
311 | // | |
f87cfe57 | 312 | Double_t ex = y*y/(2*kdy*kdy); |
313 | return ka*TMath::Exp(-ex); | |
886b6f73 | 314 | } |
315 | ||
65fb704d | 316 | Int_t AliGenPHOSlib::IpEtaprime(TRandom *) |
886b6f73 | 317 | { |
f87cfe57 | 318 | // particle composition |
319 | // | |
320 | ||
886b6f73 | 321 | return 331; // Etaprime |
322 | } | |
323 | // End EtaPrime | |
324 | //=================================================================== | |
325 | //============================================================================ | |
326 | // P H I S | |
f87cfe57 | 327 | Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *) |
328 | { | |
886b6f73 | 329 | // phi |
330 | // pt-distribution | |
331 | //____________________________________________________________ | |
f87cfe57 | 332 | |
886b6f73 | 333 | return PtScal(*px,6); // 6==> Phi in the PtScal function |
334 | } | |
335 | ||
886b6f73 | 336 | Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *) |
337 | { | |
f87cfe57 | 338 | // y-distribution |
339 | //____________________________________________________________ | |
340 | ||
341 | const Double_t ka = 1000.; | |
342 | const Double_t kdy = 4.; | |
886b6f73 | 343 | |
344 | ||
345 | Double_t y=TMath::Abs(*py); | |
346 | // | |
f87cfe57 | 347 | Double_t ex = y*y/(2*kdy*kdy); |
348 | return ka*TMath::Exp(-ex); | |
886b6f73 | 349 | } |
350 | ||
65fb704d | 351 | Int_t AliGenPHOSlib::IpPhi(TRandom *) |
f87cfe57 | 352 | { |
886b6f73 | 353 | // particle composition |
354 | // | |
f87cfe57 | 355 | |
886b6f73 | 356 | return 333; // Phi |
357 | } | |
358 | // End Phis | |
359 | //=================================================================== | |
360 | //============================================================================ | |
361 | // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars | |
f87cfe57 | 362 | Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *) |
363 | { | |
886b6f73 | 364 | // baryons |
365 | // pt-distribution | |
366 | //____________________________________________________________ | |
f87cfe57 | 367 | |
886b6f73 | 368 | return PtScal(*px,7); // 7==> Baryon in the PtScal function |
369 | } | |
370 | ||
886b6f73 | 371 | Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *) |
372 | { | |
f87cfe57 | 373 | // y-distribution |
374 | //____________________________________________________________ | |
375 | ||
376 | const Double_t ka = 1000.; | |
377 | const Double_t kdy = 4.; | |
886b6f73 | 378 | |
379 | ||
380 | Double_t y=TMath::Abs(*py); | |
381 | // | |
f87cfe57 | 382 | Double_t ex = y*y/(2*kdy*kdy); |
383 | return ka*TMath::Exp(-ex); | |
886b6f73 | 384 | } |
385 | ||
65fb704d | 386 | Int_t AliGenPHOSlib::IpBaryon(TRandom *ran) |
886b6f73 | 387 | { |
f87cfe57 | 388 | // particle composition |
389 | // | |
390 | ||
65fb704d | 391 | Float_t random = ran->Rndm(); |
392 | Float_t random2 = ran->Rndm(); | |
393 | if (random2 < 0.5) | |
886b6f73 | 394 | { |
65fb704d | 395 | if (random < 0.5) { |
886b6f73 | 396 | return 2212; // p |
397 | } else { | |
398 | return -2212; // pbar | |
399 | } | |
400 | } | |
401 | else | |
402 | { | |
65fb704d | 403 | if (random < 0.5) { |
886b6f73 | 404 | return 2112; // n |
405 | } else { | |
406 | return -2112; // n bar | |
407 | } | |
408 | } | |
409 | } | |
410 | // End Baryons | |
411 | //=================================================================== | |
412 | ||
413 | ||
414 | typedef Double_t (*GenFunc) (Double_t*, Double_t*); | |
b22ee262 | 415 | GenFunc AliGenPHOSlib::GetPt(Param_t param, const char* tname) |
886b6f73 | 416 | { |
f87cfe57 | 417 | // Return pinter to pT parameterisation |
886b6f73 | 418 | GenFunc func; |
419 | ||
420 | switch (param) | |
421 | { | |
422 | case Pion: | |
423 | func=PtPion; | |
424 | break; | |
425 | case Kaon: | |
426 | func=PtKaon; | |
427 | break; | |
428 | case Eta: | |
429 | func=PtEta; | |
430 | break; | |
431 | case Omega: | |
432 | func=PtOmega; | |
433 | break; | |
434 | case Etaprime: | |
435 | func=PtEtaprime; | |
436 | break; | |
437 | case Baryon: | |
438 | func=PtBaryon; | |
439 | break; | |
440 | default: | |
441 | func=0; | |
442 | printf("<AliGenPHOSlib::GetPt> unknown parametrisationn"); | |
443 | } | |
444 | return func; | |
445 | } | |
446 | ||
b22ee262 | 447 | GenFunc AliGenPHOSlib::GetY(Param_t param, const char* tname) |
886b6f73 | 448 | { |
f87cfe57 | 449 | // Return pointer to Y parameterisation |
886b6f73 | 450 | GenFunc func; |
451 | switch (param) | |
452 | { | |
453 | case Pion: | |
454 | func=YPion; | |
455 | break; | |
456 | case Kaon: | |
457 | func=YKaon; | |
458 | break; | |
459 | case Eta: | |
460 | func=YEta; | |
461 | break; | |
462 | case Omega: | |
463 | func=YOmega; | |
464 | break; | |
465 | case Etaprime: | |
466 | func=YEtaprime; | |
467 | break; | |
468 | case Phi: | |
469 | func=YPhi; | |
470 | break; | |
471 | case Baryon: | |
472 | func=YBaryon; | |
473 | break; | |
474 | default: | |
475 | func=0; | |
476 | printf("<AliGenPHOSlib::GetY> unknown parametrisationn"); | |
477 | } | |
478 | return func; | |
479 | } | |
65fb704d | 480 | typedef Int_t (*GenFuncIp) (TRandom *); |
b22ee262 | 481 | GenFuncIp AliGenPHOSlib::GetIp(Param_t param, const char* tname) |
886b6f73 | 482 | { |
f87cfe57 | 483 | // Return pointer to particle composition |
886b6f73 | 484 | GenFuncIp func; |
485 | switch (param) | |
486 | { | |
487 | case Pion: | |
488 | ||
489 | func=IpPion; | |
490 | break; | |
491 | case Kaon: | |
492 | func=IpKaon; | |
493 | break; | |
494 | case Eta: | |
495 | func=IpEta; | |
496 | break; | |
497 | case Omega: | |
498 | func=IpOmega; | |
499 | break; | |
500 | case Etaprime: | |
501 | func=IpEtaprime; | |
502 | break; | |
503 | case Phi: | |
504 | func=IpPhi; | |
505 | break; | |
506 | case Baryon: | |
507 | func=IpBaryon; | |
508 | break; | |
509 | default: | |
510 | func=0; | |
511 | printf("<AliGenPHOSlib::GetIp> unknown parametrisationn"); | |
512 | } | |
513 | return func; | |
514 | } | |
515 |