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.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.
23 Revision 1.4 2000/06/14 15:21:05 morsch
26 Revision 1.3 2000/06/09 20:32:54 morsch
27 All coding rule violations except RS3 corrected
29 Revision 1.2 1999/11/04 11:30:48 fca
32 Revision 1.1 1999/11/03 17:43:20 fca
33 New version from G.Martinez & A.Morsch
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
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
50 // with Pions, using the PtScal function taken from AliGenMUONlib
51 // version aliroot 3.01
53 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
54 // GPS @ SUBATECH, Nantes , France (October 1999)
55 // http://www-subatech.in2p3.fr/~photons/subatech
56 // martinez@subatech.in2p3.fr
57 //======================================================================
62 #include "AliGenPHOSlib.h"
64 ClassImp(AliGenPHOSlib)
66 //======================================================================
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-)
73 Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
75 // Pion transverse momentum distribtuion taken
76 // from AliGenMUONlib class, version 3.01 of aliroot
77 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
78 // POWER LAW FOR PT > 500 MEV
79 // MT SCALING BELOW (T=160 MEV)
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;
87 Double_t y, y1, kxmpi2, ynorm, a;
90 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
92 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
95 y=a*TMath::Power(kp0/(kp0+x),kxn);
97 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
100 Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
103 // pion y-distribution
106 const Double_t ka = 7000.;
107 const Double_t kdy = 4.;
109 Double_t y=TMath::Abs(*py);
111 Double_t ex = y*y/(2*kdy*kdy);
112 return ka*TMath::Exp(-ex);
115 Int_t AliGenPHOSlib::IpPion(TRandom *ran)
117 // particle composition pi+, pi0, pi-
120 Float_t random = ran->Rndm();
122 if ( (3.*random) < 1. )
128 if ( (3.*random) >= 2.)
139 //=============================================================
141 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
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
151 // SCALING EN MASSE PAR RAPPORT A PTPI
152 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
153 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
154 // MASS 7=>BARYON-BARYONBAR
156 // VALUE MESON/PI AT 5 GEV
157 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
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];
162 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
163 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
164 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
165 return fmtscal*ptpion;
168 //============================================================================
170 Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
174 //____________________________________________________________
176 return PtScal(*px,2); // 2==> Kaon in the PtScal function
179 Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
182 //____________________________________________________________
184 const Double_t ka = 1000.;
185 const Double_t kdy = 4.;
188 Double_t y=TMath::Abs(*py);
190 Double_t ex = y*y/(2*kdy*kdy);
191 return ka*TMath::Exp(-ex);
194 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
196 // particle composition
199 Float_t random = ran->Rndm();
200 Float_t random2 = ran->Rndm();
212 return 130; // K^0 short
214 return 310; // K^0 long
219 //============================================================================
220 //============================================================================
222 Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
226 //____________________________________________________________
228 return PtScal(*px,3); // 3==> Eta in the PtScal function
231 Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
234 //____________________________________________________________
236 const Double_t ka = 1000.;
237 const Double_t kdy = 4.;
240 Double_t y=TMath::Abs(*py);
242 Double_t ex = y*y/(2*kdy*kdy);
243 return ka*TMath::Exp(-ex);
246 Int_t AliGenPHOSlib::IpEta(TRandom *)
248 // particle composition
254 //============================================================================
255 //============================================================================
257 Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
261 //____________________________________________________________
263 return PtScal(*px,4); // 4==> Omega in the PtScal function
266 Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
269 //____________________________________________________________
271 const Double_t ka = 1000.;
272 const Double_t kdy = 4.;
275 Double_t y=TMath::Abs(*py);
277 Double_t ex = y*y/(2*kdy*kdy);
278 return ka*TMath::Exp(-ex);
281 Int_t AliGenPHOSlib::IpOmega(TRandom *)
283 // particle composition
289 //============================================================================
290 //============================================================================
292 Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
296 //____________________________________________________________
298 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
301 Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
304 //____________________________________________________________
306 const Double_t ka = 1000.;
307 const Double_t kdy = 4.;
310 Double_t y=TMath::Abs(*py);
312 Double_t ex = y*y/(2*kdy*kdy);
313 return ka*TMath::Exp(-ex);
316 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
318 // particle composition
321 return 331; // Etaprime
324 //===================================================================
325 //============================================================================
327 Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
331 //____________________________________________________________
333 return PtScal(*px,6); // 6==> Phi in the PtScal function
336 Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
339 //____________________________________________________________
341 const Double_t ka = 1000.;
342 const Double_t kdy = 4.;
345 Double_t y=TMath::Abs(*py);
347 Double_t ex = y*y/(2*kdy*kdy);
348 return ka*TMath::Exp(-ex);
351 Int_t AliGenPHOSlib::IpPhi(TRandom *)
353 // particle composition
359 //===================================================================
360 //============================================================================
361 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
362 Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
366 //____________________________________________________________
368 return PtScal(*px,7); // 7==> Baryon in the PtScal function
371 Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
374 //____________________________________________________________
376 const Double_t ka = 1000.;
377 const Double_t kdy = 4.;
380 Double_t y=TMath::Abs(*py);
382 Double_t ex = y*y/(2*kdy*kdy);
383 return ka*TMath::Exp(-ex);
386 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
388 // particle composition
391 Float_t random = ran->Rndm();
392 Float_t random2 = ran->Rndm();
398 return -2212; // pbar
406 return -2112; // n bar
411 //===================================================================
414 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
415 GenFunc AliGenPHOSlib::GetPt(Param_t param, const char* tname)
417 // Return pinter to pT parameterisation
442 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
447 GenFunc AliGenPHOSlib::GetY(Param_t param, const char* tname)
449 // Return pointer to Y parameterisation
476 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
480 typedef Int_t (*GenFuncIp) (TRandom *);
481 GenFuncIp AliGenPHOSlib::GetIp(Param_t param, const char* tname)
483 // Return pointer to particle composition
511 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");