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 Revision 1.9 2002/04/23 12:54:29 morsch
20 New options kPi0Flat y kEtaFlat (Gustavo Conesa)
22 Revision 1.7 2001/03/09 13:01:41 morsch
23 - enum constants for paramterisation type (particle family) moved to AliGen*lib.h
24 - use AliGenGSIlib::kUpsilon, AliGenPHOSlib::kEtaPrime to access the constants
26 Revision 1.6 2000/11/30 07:12:50 alibrary
27 Introducing new Rndm and QA classes
29 Revision 1.5 2000/06/29 21:08:27 morsch
30 All paramatrisation libraries derive from the pure virtual base class AliGenLib.
31 This allows to pass a pointer to a library directly to AliGenParam and avoids the
32 use of function pointers in Config.C.
34 Revision 1.4 2000/06/14 15:21:05 morsch
37 Revision 1.3 2000/06/09 20:32:54 morsch
38 All coding rule violations except RS3 corrected
40 Revision 1.2 1999/11/04 11:30:48 fca
43 Revision 1.1 1999/11/03 17:43:20 fca
44 New version from G.Martinez & A.Morsch
48 //======================================================================
49 // AliGenPHOSlib class contains parameterizations of the
50 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
51 // antiproton, neutron and anti-neutron) particles for the
52 // study of the neutral background in PHOS detector.
53 // These parameterizations are used by the
55 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
56 // AliGenPHOSlib::GetY(param),
57 // AliGenPHOSlib::GetIp(param) )
58 // param represents the particle to be simulated :
59 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
60 // Pt distributions are calculated from the transverse mass scaling
61 // with Pions, using the PtScal function taken from AliGenMUONlib
62 // version aliroot 3.01
64 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
65 // GPS @ SUBATECH, Nantes , France (October 1999)
66 // http://www-subatech.in2p3.fr/~photons/subatech
67 // martinez@subatech.in2p3.fr
68 //======================================================================
73 #include "AliGenPHOSlib.h"
75 ClassImp(AliGenPHOSlib)
77 //======================================================================
79 // (From GetPt, GetY and GetIp as param = Pion)
80 // Transverse momentum distribution" PtPion
81 // Rapidity distribution YPion
82 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
84 Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
86 // Pion transverse momentum distribtuion taken
87 // from AliGenMUONlib class, version 3.01 of aliroot
88 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
89 // POWER LAW FOR PT > 500 MEV
90 // MT SCALING BELOW (T=160 MEV)
92 const Double_t kp0 = 1.3;
93 const Double_t kxn = 8.28;
94 const Double_t kxlim=0.5;
95 const Double_t kt=0.160;
96 const Double_t kxmpi=0.139;
98 Double_t y, y1, kxmpi2, ynorm, a;
101 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
103 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
106 y=a*TMath::Power(kp0/(kp0+x),kxn);
108 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
111 Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
114 // pion y-distribution
117 const Double_t ka = 7000.;
118 const Double_t kdy = 4.;
120 Double_t y=TMath::Abs(*py);
122 Double_t ex = y*y/(2*kdy*kdy);
123 return ka*TMath::Exp(-ex);
126 Int_t AliGenPHOSlib::IpPion(TRandom *ran)
128 // particle composition pi+, pi0, pi-
131 Float_t random = ran->Rndm();
133 if ( (3.*random) < 1. )
139 if ( (3.*random) >= 2.)
151 //======================================================================
152 // Pi 0 Flat Distribution
153 // Transverse momentum distribution PtPi0Flat
154 // Rapidity distribution YPi0Flat
155 // Particle distribution IdPi0Flat 111 (pi0)
158 Double_t AliGenPHOSlib::PtPi0Flat(Double_t *px, Double_t *)
160 // Pion transverse momentum flat distribution
166 Double_t AliGenPHOSlib::YPi0Flat( Double_t *py, Double_t *)
169 // pion y-distribution
174 Int_t AliGenPHOSlib::IpPi0Flat(TRandom *)
177 // particle composition pi0
182 //=============================================================
184 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
187 // Fonction for the calculation of the Pt distribution for a
188 // given particle np, from the pion Pt distribution using the
189 // mt scaling. This function was taken from AliGenMUONlib
190 // aliroot version 3.01, and was extended for baryons
191 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
192 // 7=>BARYONS-BARYONBARS
194 // SCALING EN MASSE PAR RAPPORT A PTPI
195 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
196 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
197 // MASS 7=>BARYON-BARYONBAR
199 // VALUE MESON/PI AT 5 GEV
200 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
202 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
203 Double_t kfmax2=f5/kfmax[np];
205 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
206 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
207 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
208 return fmtscal*ptpion;
212 //============================================================================
214 Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
218 //____________________________________________________________
220 return PtScal(*px,2); // 2==> Kaon in the PtScal function
223 Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
226 //____________________________________________________________
228 const Double_t ka = 1000.;
229 const Double_t kdy = 4.;
232 Double_t y=TMath::Abs(*py);
234 Double_t ex = y*y/(2*kdy*kdy);
235 return ka*TMath::Exp(-ex);
238 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
240 // particle composition
243 Float_t random = ran->Rndm();
244 Float_t random2 = ran->Rndm();
256 return 130; // K^0 short
258 return 310; // K^0 long
263 //============================================================================
264 //============================================================================
266 Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
270 //____________________________________________________________
272 return PtScal(*px,3); // 3==> Eta in the PtScal function
275 Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
278 //____________________________________________________________
280 const Double_t ka = 1000.;
281 const Double_t kdy = 4.;
284 Double_t y=TMath::Abs(*py);
286 Double_t ex = y*y/(2*kdy*kdy);
287 return ka*TMath::Exp(-ex);
290 Int_t AliGenPHOSlib::IpEta(TRandom *)
292 // particle composition
299 //======================================================================
300 // Eta Flat Distribution
301 // Transverse momentum distribution PtEtaFlat
302 // Rapidity distribution YEtaFlat
303 // Particle distribution IdEtaFlat 111 (pi0)
306 Double_t AliGenPHOSlib::PtEtaFlat(Double_t *px, Double_t *)
308 // Eta transverse momentum flat distribution
314 Double_t AliGenPHOSlib::YEtaFlat( Double_t *py, Double_t *)
317 // pion y-distribution
322 Int_t AliGenPHOSlib::IpEtaFlat(TRandom *)
325 // particle composition eta
330 //============================================================================
331 //============================================================================
333 Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
337 //____________________________________________________________
339 return PtScal(*px,4); // 4==> Omega in the PtScal function
342 Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
345 //____________________________________________________________
347 const Double_t ka = 1000.;
348 const Double_t kdy = 4.;
351 Double_t y=TMath::Abs(*py);
353 Double_t ex = y*y/(2*kdy*kdy);
354 return ka*TMath::Exp(-ex);
357 Int_t AliGenPHOSlib::IpOmega(TRandom *)
359 // particle composition
365 //============================================================================
366 //============================================================================
368 Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
372 //____________________________________________________________
374 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
377 Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
380 //____________________________________________________________
382 const Double_t ka = 1000.;
383 const Double_t kdy = 4.;
386 Double_t y=TMath::Abs(*py);
388 Double_t ex = y*y/(2*kdy*kdy);
389 return ka*TMath::Exp(-ex);
392 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
394 // particle composition
397 return 331; // Etaprime
400 //===================================================================
401 //============================================================================
403 Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
407 //____________________________________________________________
409 return PtScal(*px,6); // 6==> Phi in the PtScal function
412 Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
415 //____________________________________________________________
417 const Double_t ka = 1000.;
418 const Double_t kdy = 4.;
421 Double_t y=TMath::Abs(*py);
423 Double_t ex = y*y/(2*kdy*kdy);
424 return ka*TMath::Exp(-ex);
427 Int_t AliGenPHOSlib::IpPhi(TRandom *)
429 // particle composition
435 //===================================================================
436 //============================================================================
437 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
438 Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
442 //____________________________________________________________
444 return PtScal(*px,7); // 7==> Baryon in the PtScal function
447 Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
450 //____________________________________________________________
452 const Double_t ka = 1000.;
453 const Double_t kdy = 4.;
456 Double_t y=TMath::Abs(*py);
458 Double_t ex = y*y/(2*kdy*kdy);
459 return ka*TMath::Exp(-ex);
462 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
464 // particle composition
467 Float_t random = ran->Rndm();
468 Float_t random2 = ran->Rndm();
474 return -2212; // pbar
482 return -2112; // n bar
487 //===================================================================
490 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
491 GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* tname) const
493 // Return pinter to pT parameterisation
524 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
529 GenFunc AliGenPHOSlib::GetY(Int_t param, const char* tname) const
531 // Return pointer to Y parameterisation
564 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
568 typedef Int_t (*GenFuncIp) (TRandom *);
569 GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* tname) const
571 // Return pointer to particle composition
605 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");