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 //======================================================================
19 // AliGenPHOSlib class contains parameterizations of the
20 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
21 // antiproton, neutron and anti-neutron) particles for the
22 // study of the neutral background in PHOS detector.
23 // These parameterizations are used by the
25 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
26 // AliGenPHOSlib::GetY(param),
27 // AliGenPHOSlib::GetIp(param) )
28 // param represents the particle to be simulated :
29 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
30 // Pt distributions are calculated from the transverse mass scaling
31 // with Pions, using the PtScal function taken from AliGenMUONlib
32 // version aliroot 3.01
34 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
35 // GPS @ SUBATECH, Nantes , France (October 1999)
36 // http://www-subatech.in2p3.fr/~photons/subatech
37 // martinez@subatech.in2p3.fr
38 // Additional particle species simulation options has been added:
39 // Charged Pion, Charged Kaons, KLong Proton, Anti-Proton, Neutron,
40 // Anti-Neutron --> Changes made by Gustavo Conesa in November 2004
41 // Add flat Omega(782) distribution in Nov. 2010 by Renzhuo WAN
42 //======================================================================
47 #include "AliGenPHOSlib.h"
49 ClassImp(AliGenPHOSlib)
51 //======================================================================
53 // (From GetPt, GetY and GetIp as param = Pion)
54 // Transverse momentum distribution" PtPion
55 // Rapidity distribution YPion
56 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
58 Double_t AliGenPHOSlib::PtPion(const Double_t *px, const Double_t *)
60 // Pion transverse momentum distribtuion taken
61 // from AliGenMUONlib class, version 3.01 of aliroot
62 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
63 // POWER LAW FOR PT > 500 MEV
64 // MT SCALING BELOW (T=160 MEV)
66 const Double_t kp0 = 1.3;
67 const Double_t kxn = 8.28;
68 const Double_t kxlim=0.5;
69 const Double_t kt=0.160;
70 const Double_t kxmpi=0.139;
72 Double_t y, y1, kxmpi2, ynorm, a;
75 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
77 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
80 y=a*TMath::Power(kp0/(kp0+x),kxn);
82 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
85 Double_t AliGenPHOSlib::YPion( const Double_t *py, const Double_t *)
88 // pion y-distribution
91 const Double_t ka = 7000.;
92 const Double_t kdy = 4.;
94 Double_t y=TMath::Abs(*py);
96 Double_t ex = y*y/(2*kdy*kdy);
97 return ka*TMath::Exp(-ex);
100 Int_t AliGenPHOSlib::IpPion(TRandom */*ran*/)
102 // particle composition pi+, pi0, pi-
107 Int_t AliGenPHOSlib::IpChargedPion(TRandom *ran)
109 // particle composition pi+, pi0, pi-
112 Float_t random = ran->Rndm();
114 if ( (2.*random) < 1. )
125 //======================================================================
126 // Pi 0 Flat Distribution
127 // Transverse momentum distribution PtPi0Flat
128 // Rapidity distribution YPi0Flat
129 // Particle distribution IdPi0Flat 111 (pi0)
132 Double_t AliGenPHOSlib::PtPi0Flat(const Double_t */*px*/, const Double_t *)
134 // Pion transverse momentum flat distribution
140 Double_t AliGenPHOSlib::YPi0Flat( const Double_t */*py*/, const Double_t *)
143 // pion y-distribution
148 Int_t AliGenPHOSlib::IpPi0Flat(TRandom *)
151 // particle composition pi0
156 //=============================================================
158 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
161 // Fonction for the calculation of the Pt distribution for a
162 // given particle np, from the pion Pt distribution using the
163 // mt scaling. This function was taken from AliGenMUONlib
164 // aliroot version 3.01, and was extended for baryons
165 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
166 // 7=>BARYONS-BARYONBARS
168 // SCALING EN MASSE PAR RAPPORT A PTPI
169 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
170 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
171 // MASS 7=>BARYON-BARYONBAR
173 // VALUE MESON/PI AT 5 GEV
174 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
176 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
177 Double_t kfmax2=f5/kfmax[np];
179 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
180 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
181 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
182 return fmtscal*ptpion;
186 //============================================================================
188 Double_t AliGenPHOSlib::PtKaon( const Double_t *px, const Double_t *)
192 //____________________________________________________________
194 return PtScal(*px,2); // 2==> Kaon in the PtScal function
197 Double_t AliGenPHOSlib::YKaon( const Double_t *py, const Double_t *)
200 //____________________________________________________________
202 const Double_t ka = 1000.;
203 const Double_t kdy = 4.;
206 Double_t y=TMath::Abs(*py);
208 Double_t ex = y*y/(2*kdy*kdy);
209 return ka*TMath::Exp(-ex);
212 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
214 // particle composition
217 Float_t random = ran->Rndm();
218 Float_t random2 = ran->Rndm();
230 return 130; // K^0 short
232 return 310; // K^0 long
237 Int_t AliGenPHOSlib::IpChargedKaon(TRandom *ran)
239 // particle composition
242 Float_t random = ran->Rndm();
252 Int_t AliGenPHOSlib::IpKaon0L(TRandom *)
254 // particle composition
257 return 130; // K^0 long
260 //============================================================================
261 //============================================================================
263 Double_t AliGenPHOSlib::PtEta( const Double_t *px, const Double_t *)
267 //____________________________________________________________
269 return PtScal(*px,3); // 3==> Eta in the PtScal function
272 Double_t AliGenPHOSlib::YEta( const Double_t *py, const Double_t *)
275 //____________________________________________________________
277 const Double_t ka = 1000.;
278 const Double_t kdy = 4.;
281 Double_t y=TMath::Abs(*py);
283 Double_t ex = y*y/(2*kdy*kdy);
284 return ka*TMath::Exp(-ex);
287 Int_t AliGenPHOSlib::IpEta(TRandom *)
289 // particle composition
296 //======================================================================
297 // Eta Flat Distribution
298 // Transverse momentum distribution PtEtaFlat
299 // Rapidity distribution YEtaFlat
300 // Particle distribution IdEtaFlat 111 (pi0)
303 Double_t AliGenPHOSlib::PtEtaFlat(const Double_t */*px*/, const Double_t *)
305 // Eta transverse momentum flat distribution
311 Double_t AliGenPHOSlib::YEtaFlat( const Double_t */*py*/, const Double_t *)
314 // pion y-distribution
319 Int_t AliGenPHOSlib::IpEtaFlat(TRandom *)
322 // particle composition eta
327 //============================================================================
328 //============================================================================
330 Double_t AliGenPHOSlib::PtOmega( const Double_t *px, const Double_t *)
334 //____________________________________________________________
336 return PtScal(*px,4); // 4==> Omega in the PtScal function
339 Double_t AliGenPHOSlib::YOmega( const Double_t *py, const Double_t *)
342 //____________________________________________________________
344 const Double_t ka = 1000.;
345 const Double_t kdy = 4.;
348 Double_t y=TMath::Abs(*py);
350 Double_t ex = y*y/(2*kdy*kdy);
351 return ka*TMath::Exp(-ex);
354 Int_t AliGenPHOSlib::IpOmega(TRandom *)
356 // particle composition
362 //============================================================================
363 //======================================================================
364 // Omega(782) Flat Distribution
365 // Transverse momentum distribution PtOmegaFlat
366 // Rapidity distribution YOmegaFlat
367 // Particle distribution IdOmegaFlat 223(0mega)
370 Double_t AliGenPHOSlib::PtOmegaFlat(const Double_t */*px*/, const Double_t *)
372 // omega transverse momentum flat distribution
378 Double_t AliGenPHOSlib::YOmegaFlat( const Double_t */*py*/, const Double_t *)
381 // omega y-distribution
386 Int_t AliGenPHOSlib::IpOmegaFlat(TRandom *)
389 // particle composition omega
396 //============================================================================
398 Double_t AliGenPHOSlib::PtEtaprime( const Double_t *px, const Double_t *)
402 //____________________________________________________________
404 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
407 Double_t AliGenPHOSlib::YEtaprime( const Double_t *py, const Double_t *)
410 //____________________________________________________________
412 const Double_t ka = 1000.;
413 const Double_t kdy = 4.;
416 Double_t y=TMath::Abs(*py);
418 Double_t ex = y*y/(2*kdy*kdy);
419 return ka*TMath::Exp(-ex);
422 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
424 // particle composition
427 return 331; // Etaprime
430 //===================================================================
431 //============================================================================
433 Double_t AliGenPHOSlib::PtPhi( const Double_t *px, const Double_t *)
437 //____________________________________________________________
439 return PtScal(*px,6); // 6==> Phi in the PtScal function
442 Double_t AliGenPHOSlib::YPhi( const Double_t *py, const Double_t *)
445 //____________________________________________________________
447 const Double_t ka = 1000.;
448 const Double_t kdy = 4.;
451 Double_t y=TMath::Abs(*py);
453 Double_t ex = y*y/(2*kdy*kdy);
454 return ka*TMath::Exp(-ex);
457 Int_t AliGenPHOSlib::IpPhi(TRandom *)
459 // particle composition
465 //===================================================================
466 //============================================================================
467 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
468 Double_t AliGenPHOSlib::PtBaryon( const Double_t *px, const Double_t *)
472 //____________________________________________________________
474 return PtScal(*px,7); // 7==> Baryon in the PtScal function
477 Double_t AliGenPHOSlib::YBaryon( const Double_t *py, const Double_t *)
480 //____________________________________________________________
482 const Double_t ka = 1000.;
483 const Double_t kdy = 4.;
486 Double_t y=TMath::Abs(*py);
488 Double_t ex = y*y/(2*kdy*kdy);
489 return ka*TMath::Exp(-ex);
492 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
494 // particle composition
497 Float_t random = ran->Rndm();
498 Float_t random2 = ran->Rndm();
504 return -2212; // pbar
512 return -2112; // n bar
517 Int_t AliGenPHOSlib::IpProton(TRandom *)
519 // particle composition
524 Int_t AliGenPHOSlib::IpAProton(TRandom *)
526 // particle composition
528 return -2212; // p bar
532 Int_t AliGenPHOSlib::IpNeutron(TRandom *)
534 // particle composition
539 Int_t AliGenPHOSlib::IpANeutron(TRandom *)
541 // particle composition
547 //===================================================================
549 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
550 GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* /*tname*/) const
552 // Return pinter to pT parameterisation
586 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
591 GenFunc AliGenPHOSlib::GetY(Int_t param, const char* /*tname*/) const
593 // Return pointer to Y parameterisation
629 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
633 typedef Int_t (*GenFuncIp) (TRandom *);
634 GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* /*tname*/) const
636 // Return pointer to particle composition
695 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");