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 Revision 1.6 2000/11/30 07:12:50 alibrary
19 Introducing new Rndm and QA classes
21 Revision 1.5 2000/06/29 21:08:27 morsch
22 All paramatrisation libraries derive from the pure virtual base class AliGenLib.
23 This allows to pass a pointer to a library directly to AliGenParam and avoids the
24 use of function pointers in Config.C.
26 Revision 1.4 2000/06/14 15:21:05 morsch
29 Revision 1.3 2000/06/09 20:32:54 morsch
30 All coding rule violations except RS3 corrected
32 Revision 1.2 1999/11/04 11:30:48 fca
35 Revision 1.1 1999/11/03 17:43:20 fca
36 New version from G.Martinez & A.Morsch
40 //======================================================================
41 // AliGenPHOSlib class contains parameterizations of the
42 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
43 // antiproton, neutron and anti-neutron) particles for the
44 // study of the neutral background in PHOS detector.
45 // These parameterizations are used by the
47 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
48 // AliGenPHOSlib::GetY(param),
49 // AliGenPHOSlib::GetIp(param) )
50 // param represents the particle to be simulated :
51 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
52 // Pt distributions are calculated from the transverse mass scaling
53 // with Pions, using the PtScal function taken from AliGenMUONlib
54 // version aliroot 3.01
56 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
57 // GPS @ SUBATECH, Nantes , France (October 1999)
58 // http://www-subatech.in2p3.fr/~photons/subatech
59 // martinez@subatech.in2p3.fr
60 //======================================================================
65 #include "AliGenPHOSlib.h"
67 ClassImp(AliGenPHOSlib)
69 //======================================================================
71 // (From GetPt, GetY and GetIp as param = Pion)
72 // Transverse momentum distribution" PtPion
73 // Rapidity distribution YPion
74 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
76 Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
78 // Pion transverse momentum distribtuion taken
79 // from AliGenMUONlib class, version 3.01 of aliroot
80 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
81 // POWER LAW FOR PT > 500 MEV
82 // MT SCALING BELOW (T=160 MEV)
84 const Double_t kp0 = 1.3;
85 const Double_t kxn = 8.28;
86 const Double_t kxlim=0.5;
87 const Double_t kt=0.160;
88 const Double_t kxmpi=0.139;
90 Double_t y, y1, kxmpi2, ynorm, a;
93 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
95 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
98 y=a*TMath::Power(kp0/(kp0+x),kxn);
100 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
103 Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
106 // pion y-distribution
109 const Double_t ka = 7000.;
110 const Double_t kdy = 4.;
112 Double_t y=TMath::Abs(*py);
114 Double_t ex = y*y/(2*kdy*kdy);
115 return ka*TMath::Exp(-ex);
118 Int_t AliGenPHOSlib::IpPion(TRandom *ran)
120 // particle composition pi+, pi0, pi-
123 Float_t random = ran->Rndm();
125 if ( (3.*random) < 1. )
131 if ( (3.*random) >= 2.)
142 //=============================================================
144 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
147 // Fonction for the calculation of the Pt distribution for a
148 // given particle np, from the pion Pt distribution using the
149 // mt scaling. This function was taken from AliGenMUONlib
150 // aliroot version 3.01, and was extended for baryons
151 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
152 // 7=>BARYONS-BARYONBARS
154 // SCALING EN MASSE PAR RAPPORT A PTPI
155 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
156 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
157 // MASS 7=>BARYON-BARYONBAR
159 // VALUE MESON/PI AT 5 GEV
160 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
162 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
163 Double_t kfmax2=f5/kfmax[np];
165 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
166 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
167 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
168 return fmtscal*ptpion;
171 //============================================================================
173 Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
177 //____________________________________________________________
179 return PtScal(*px,2); // 2==> Kaon in the PtScal function
182 Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
185 //____________________________________________________________
187 const Double_t ka = 1000.;
188 const Double_t kdy = 4.;
191 Double_t y=TMath::Abs(*py);
193 Double_t ex = y*y/(2*kdy*kdy);
194 return ka*TMath::Exp(-ex);
197 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
199 // particle composition
202 Float_t random = ran->Rndm();
203 Float_t random2 = ran->Rndm();
215 return 130; // K^0 short
217 return 310; // K^0 long
222 //============================================================================
223 //============================================================================
225 Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
229 //____________________________________________________________
231 return PtScal(*px,3); // 3==> Eta in the PtScal function
234 Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
237 //____________________________________________________________
239 const Double_t ka = 1000.;
240 const Double_t kdy = 4.;
243 Double_t y=TMath::Abs(*py);
245 Double_t ex = y*y/(2*kdy*kdy);
246 return ka*TMath::Exp(-ex);
249 Int_t AliGenPHOSlib::IpEta(TRandom *)
251 // particle composition
257 //============================================================================
258 //============================================================================
260 Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
264 //____________________________________________________________
266 return PtScal(*px,4); // 4==> Omega in the PtScal function
269 Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
272 //____________________________________________________________
274 const Double_t ka = 1000.;
275 const Double_t kdy = 4.;
278 Double_t y=TMath::Abs(*py);
280 Double_t ex = y*y/(2*kdy*kdy);
281 return ka*TMath::Exp(-ex);
284 Int_t AliGenPHOSlib::IpOmega(TRandom *)
286 // particle composition
292 //============================================================================
293 //============================================================================
295 Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
299 //____________________________________________________________
301 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
304 Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
307 //____________________________________________________________
309 const Double_t ka = 1000.;
310 const Double_t kdy = 4.;
313 Double_t y=TMath::Abs(*py);
315 Double_t ex = y*y/(2*kdy*kdy);
316 return ka*TMath::Exp(-ex);
319 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
321 // particle composition
324 return 331; // Etaprime
327 //===================================================================
328 //============================================================================
330 Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
334 //____________________________________________________________
336 return PtScal(*px,6); // 6==> Phi in the PtScal function
339 Double_t AliGenPHOSlib::YPhi( Double_t *py, 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::IpPhi(TRandom *)
356 // particle composition
362 //===================================================================
363 //============================================================================
364 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
365 Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
369 //____________________________________________________________
371 return PtScal(*px,7); // 7==> Baryon in the PtScal function
374 Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
377 //____________________________________________________________
379 const Double_t ka = 1000.;
380 const Double_t kdy = 4.;
383 Double_t y=TMath::Abs(*py);
385 Double_t ex = y*y/(2*kdy*kdy);
386 return ka*TMath::Exp(-ex);
389 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
391 // particle composition
394 Float_t random = ran->Rndm();
395 Float_t random2 = ran->Rndm();
401 return -2212; // pbar
409 return -2112; // n bar
414 //===================================================================
417 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
418 GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* tname)
420 // Return pinter to pT parameterisation
445 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
450 GenFunc AliGenPHOSlib::GetY(Int_t param, const char* tname)
452 // Return pointer to Y parameterisation
479 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
483 typedef Int_t (*GenFuncIp) (TRandom *);
484 GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* tname)
486 // Return pointer to particle composition
514 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");