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.3 2000/06/09 20:32:54 morsch
19 All coding rule violations except RS3 corrected
21 Revision 1.2 1999/11/04 11:30:48 fca
24 Revision 1.1 1999/11/03 17:43:20 fca
25 New version from G.Martinez & A.Morsch
29 //======================================================================
30 // AliGenPHOSlib class contains parameterizations of the
31 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
32 // antiproton, neutron and anti-neutron) particles for the
33 // study of the neutral background in PHOS detector.
34 // These parameterizations are used by the
36 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
37 // AliGenPHOSlib::GetY(param),
38 // AliGenPHOSlib::GetIp(param) )
39 // param represents the particle to be simulated :
40 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
41 // Pt distributions are calculated from the transverse mass scaling
42 // with Pions, using the PtScal function taken from AliGenMUONlib
43 // version aliroot 3.01
45 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
46 // GPS @ SUBATECH, Nantes , France (October 1999)
47 // http://www-subatech.in2p3.fr/~photons/subatech
48 // martinez@subatech.in2p3.fr
49 //======================================================================
51 #include "AliGenPHOSlib.h"
54 ClassImp(AliGenPHOSlib)
56 //======================================================================
58 // (From GetPt, GetY and GetIp as param = Pion)
59 // Transverse momentum distribution" PtPion
60 // Rapidity distribution YPion
61 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
63 Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
65 // Pion transverse momentum distribtuion taken
66 // from AliGenMUONlib class, version 3.01 of aliroot
67 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
68 // POWER LAW FOR PT > 500 MEV
69 // MT SCALING BELOW (T=160 MEV)
71 const Double_t kp0 = 1.3;
72 const Double_t kxn = 8.28;
73 const Double_t kxlim=0.5;
74 const Double_t kt=0.160;
75 const Double_t kxmpi=0.139;
77 Double_t y, y1, kxmpi2, ynorm, a;
80 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
82 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
85 y=a*TMath::Power(kp0/(kp0+x),kxn);
87 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
90 Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
93 // pion y-distribution
96 const Double_t ka = 7000.;
97 const Double_t kdy = 4.;
99 Double_t y=TMath::Abs(*py);
101 Double_t ex = y*y/(2*kdy*kdy);
102 return ka*TMath::Exp(-ex);
105 Int_t AliGenPHOSlib::IpPion()
107 // particle composition pi+, pi0, pi-
113 if ( (3.*random[0]) < 1. )
119 if ( (3.*random[0]) >= 2.)
130 //=============================================================
132 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
135 // Fonction for the calculation of the Pt distribution for a
136 // given particle np, from the pion Pt distribution using the
137 // mt scaling. This function was taken from AliGenMUONlib
138 // aliroot version 3.01, and was extended for baryons
139 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
140 // 7=>BARYONS-BARYONBARS
142 // SCALING EN MASSE PAR RAPPORT A PTPI
143 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
144 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
145 // MASS 7=>BARYON-BARYONBAR
147 // VALUE MESON/PI AT 5 GEV
148 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
150 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
151 Double_t kfmax2=f5/kfmax[np];
153 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
154 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
155 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
156 return fmtscal*ptpion;
159 //============================================================================
161 Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
165 //____________________________________________________________
167 return PtScal(*px,2); // 2==> Kaon in the PtScal function
170 Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
173 //____________________________________________________________
175 const Double_t ka = 1000.;
176 const Double_t kdy = 4.;
179 Double_t y=TMath::Abs(*py);
181 Double_t ex = y*y/(2*kdy*kdy);
182 return ka*TMath::Exp(-ex);
185 Int_t AliGenPHOSlib::IpKaon()
187 // particle composition
190 Float_t random[1],random2[1];
192 gMC->Rndm(random2,1);
193 if (random2[0] < 0.5)
195 if (random[0] < 0.5) {
203 if (random[0] < 0.5) {
204 return 130; // K^0 short
206 return 310; // K^0 long
211 //============================================================================
212 //============================================================================
214 Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
218 //____________________________________________________________
220 return PtScal(*px,3); // 3==> Eta in the PtScal function
223 Double_t AliGenPHOSlib::YEta( 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::IpEta()
240 // particle composition
246 //============================================================================
247 //============================================================================
249 Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
253 //____________________________________________________________
255 return PtScal(*px,4); // 4==> Omega in the PtScal function
258 Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
261 //____________________________________________________________
263 const Double_t ka = 1000.;
264 const Double_t kdy = 4.;
267 Double_t y=TMath::Abs(*py);
269 Double_t ex = y*y/(2*kdy*kdy);
270 return ka*TMath::Exp(-ex);
273 Int_t AliGenPHOSlib::IpOmega()
275 // particle composition
281 //============================================================================
282 //============================================================================
284 Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
288 //____________________________________________________________
290 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
293 Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
296 //____________________________________________________________
298 const Double_t ka = 1000.;
299 const Double_t kdy = 4.;
302 Double_t y=TMath::Abs(*py);
304 Double_t ex = y*y/(2*kdy*kdy);
305 return ka*TMath::Exp(-ex);
308 Int_t AliGenPHOSlib::IpEtaprime()
310 // particle composition
313 return 331; // Etaprime
316 //===================================================================
317 //============================================================================
319 Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
323 //____________________________________________________________
325 return PtScal(*px,6); // 6==> Phi in the PtScal function
328 Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
331 //____________________________________________________________
333 const Double_t ka = 1000.;
334 const Double_t kdy = 4.;
337 Double_t y=TMath::Abs(*py);
339 Double_t ex = y*y/(2*kdy*kdy);
340 return ka*TMath::Exp(-ex);
343 Int_t AliGenPHOSlib::IpPhi()
345 // particle composition
351 //===================================================================
352 //============================================================================
353 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
354 Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
358 //____________________________________________________________
360 return PtScal(*px,7); // 7==> Baryon in the PtScal function
363 Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
366 //____________________________________________________________
368 const Double_t ka = 1000.;
369 const Double_t kdy = 4.;
372 Double_t y=TMath::Abs(*py);
374 Double_t ex = y*y/(2*kdy*kdy);
375 return ka*TMath::Exp(-ex);
378 Int_t AliGenPHOSlib::IpBaryon()
380 // particle composition
383 Float_t random[1],random2[1];
385 gMC->Rndm(random2,1);
386 if (random2[0] < 0.5)
388 if (random[0] < 0.5) {
391 return -2212; // pbar
396 if (random[0] < 0.5) {
399 return -2112; // n bar
404 //===================================================================
407 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
408 GenFunc AliGenPHOSlib::GetPt(Param_t param)
410 // Return pinter to pT parameterisation
435 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
440 GenFunc AliGenPHOSlib::GetY(Param_t param)
442 // Return pointer to Y parameterisation
469 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
473 typedef Int_t (*GenFuncIp) ();
474 GenFuncIp AliGenPHOSlib::GetIp(Param_t param)
476 // Return pointer to particle composition
504 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");