2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
19 //======================================================================
20 // AliGenPHOSlib class contains parameterizations of the
21 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
22 // antiproton, neutron and anti-neutron) particles for the
23 // study of the neutral background in PHOS detector.
24 // These parameterizations are used by the
26 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
27 // AliGenPHOSlib::GetY(param),
28 // AliGenPHOSlib::GetIp(param) )
29 // param represents the particle to be simulated :
30 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
31 // Pt distributions are calculated from the transverse mass scaling
32 // with Pions, using the PtScal function taken from AliGenMUONlib
33 // version aliroot 3.01
35 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
36 // GPS @ SUBATECH, Nantes , France (October 1999)
37 // http://www-subatech.in2p3.fr/~photons/subatech
38 // martinez@subatech.in2p3.fr
39 //======================================================================
44 #include "AliGenPHOSlib.h"
46 ClassImp(AliGenPHOSlib)
48 //======================================================================
50 // (From GetPt, GetY and GetIp as param = Pion)
51 // Transverse momentum distribution" PtPion
52 // Rapidity distribution YPion
53 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
55 Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
57 // Pion transverse momentum distribtuion taken
58 // from AliGenMUONlib class, version 3.01 of aliroot
59 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
60 // POWER LAW FOR PT > 500 MEV
61 // MT SCALING BELOW (T=160 MEV)
63 const Double_t kp0 = 1.3;
64 const Double_t kxn = 8.28;
65 const Double_t kxlim=0.5;
66 const Double_t kt=0.160;
67 const Double_t kxmpi=0.139;
69 Double_t y, y1, kxmpi2, ynorm, a;
72 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
74 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
77 y=a*TMath::Power(kp0/(kp0+x),kxn);
79 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
82 Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
85 // pion y-distribution
88 const Double_t ka = 7000.;
89 const Double_t kdy = 4.;
91 Double_t y=TMath::Abs(*py);
93 Double_t ex = y*y/(2*kdy*kdy);
94 return ka*TMath::Exp(-ex);
97 Int_t AliGenPHOSlib::IpPion(TRandom *ran)
99 // particle composition pi+, pi0, pi-
102 Float_t random = ran->Rndm();
104 if ( (3.*random) < 1. )
110 if ( (3.*random) >= 2.)
122 //======================================================================
123 // Pi 0 Flat Distribution
124 // Transverse momentum distribution PtPi0Flat
125 // Rapidity distribution YPi0Flat
126 // Particle distribution IdPi0Flat 111 (pi0)
129 Double_t AliGenPHOSlib::PtPi0Flat(Double_t */*px*/, Double_t *)
131 // Pion transverse momentum flat distribution
137 Double_t AliGenPHOSlib::YPi0Flat( Double_t */*py*/, Double_t *)
140 // pion y-distribution
145 Int_t AliGenPHOSlib::IpPi0Flat(TRandom *)
148 // particle composition pi0
153 //=============================================================
155 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
158 // Fonction for the calculation of the Pt distribution for a
159 // given particle np, from the pion Pt distribution using the
160 // mt scaling. This function was taken from AliGenMUONlib
161 // aliroot version 3.01, and was extended for baryons
162 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
163 // 7=>BARYONS-BARYONBARS
165 // SCALING EN MASSE PAR RAPPORT A PTPI
166 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
167 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
168 // MASS 7=>BARYON-BARYONBAR
170 // VALUE MESON/PI AT 5 GEV
171 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
173 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
174 Double_t kfmax2=f5/kfmax[np];
176 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
177 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
178 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
179 return fmtscal*ptpion;
183 //============================================================================
185 Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
189 //____________________________________________________________
191 return PtScal(*px,2); // 2==> Kaon in the PtScal function
194 Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
197 //____________________________________________________________
199 const Double_t ka = 1000.;
200 const Double_t kdy = 4.;
203 Double_t y=TMath::Abs(*py);
205 Double_t ex = y*y/(2*kdy*kdy);
206 return ka*TMath::Exp(-ex);
209 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
211 // particle composition
214 Float_t random = ran->Rndm();
215 Float_t random2 = ran->Rndm();
227 return 130; // K^0 short
229 return 310; // K^0 long
234 //============================================================================
235 //============================================================================
237 Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
241 //____________________________________________________________
243 return PtScal(*px,3); // 3==> Eta in the PtScal function
246 Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
249 //____________________________________________________________
251 const Double_t ka = 1000.;
252 const Double_t kdy = 4.;
255 Double_t y=TMath::Abs(*py);
257 Double_t ex = y*y/(2*kdy*kdy);
258 return ka*TMath::Exp(-ex);
261 Int_t AliGenPHOSlib::IpEta(TRandom *)
263 // particle composition
270 //======================================================================
271 // Eta Flat Distribution
272 // Transverse momentum distribution PtEtaFlat
273 // Rapidity distribution YEtaFlat
274 // Particle distribution IdEtaFlat 111 (pi0)
277 Double_t AliGenPHOSlib::PtEtaFlat(Double_t */*px*/, Double_t *)
279 // Eta transverse momentum flat distribution
285 Double_t AliGenPHOSlib::YEtaFlat( Double_t */*py*/, Double_t *)
288 // pion y-distribution
293 Int_t AliGenPHOSlib::IpEtaFlat(TRandom *)
296 // particle composition eta
301 //============================================================================
302 //============================================================================
304 Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
308 //____________________________________________________________
310 return PtScal(*px,4); // 4==> Omega in the PtScal function
313 Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
316 //____________________________________________________________
318 const Double_t ka = 1000.;
319 const Double_t kdy = 4.;
322 Double_t y=TMath::Abs(*py);
324 Double_t ex = y*y/(2*kdy*kdy);
325 return ka*TMath::Exp(-ex);
328 Int_t AliGenPHOSlib::IpOmega(TRandom *)
330 // particle composition
336 //============================================================================
337 //============================================================================
339 Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
343 //____________________________________________________________
345 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
348 Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
351 //____________________________________________________________
353 const Double_t ka = 1000.;
354 const Double_t kdy = 4.;
357 Double_t y=TMath::Abs(*py);
359 Double_t ex = y*y/(2*kdy*kdy);
360 return ka*TMath::Exp(-ex);
363 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
365 // particle composition
368 return 331; // Etaprime
371 //===================================================================
372 //============================================================================
374 Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
378 //____________________________________________________________
380 return PtScal(*px,6); // 6==> Phi in the PtScal function
383 Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
386 //____________________________________________________________
388 const Double_t ka = 1000.;
389 const Double_t kdy = 4.;
392 Double_t y=TMath::Abs(*py);
394 Double_t ex = y*y/(2*kdy*kdy);
395 return ka*TMath::Exp(-ex);
398 Int_t AliGenPHOSlib::IpPhi(TRandom *)
400 // particle composition
406 //===================================================================
407 //============================================================================
408 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
409 Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
413 //____________________________________________________________
415 return PtScal(*px,7); // 7==> Baryon in the PtScal function
418 Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
421 //____________________________________________________________
423 const Double_t ka = 1000.;
424 const Double_t kdy = 4.;
427 Double_t y=TMath::Abs(*py);
429 Double_t ex = y*y/(2*kdy*kdy);
430 return ka*TMath::Exp(-ex);
433 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
435 // particle composition
438 Float_t random = ran->Rndm();
439 Float_t random2 = ran->Rndm();
445 return -2212; // pbar
453 return -2112; // n bar
458 //===================================================================
461 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
462 GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* /*tname*/) const
464 // Return pinter to pT parameterisation
495 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
500 GenFunc AliGenPHOSlib::GetY(Int_t param, const char* /*tname*/) const
502 // Return pointer to Y parameterisation
535 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
539 typedef Int_t (*GenFuncIp) (TRandom *);
540 GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* /*tname*/) const
542 // Return pointer to particle composition
576 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");