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.4 2000/06/14 15:21:05 morsch
21 Revision 1.3 2000/06/09 20:32:54 morsch
22 All coding rule violations except RS3 corrected
24 Revision 1.2 1999/11/04 11:30:48 fca
27 Revision 1.1 1999/11/03 17:43:20 fca
28 New version from G.Martinez & A.Morsch
32 //======================================================================
33 // AliGenPHOSlib class contains parameterizations of the
34 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
35 // antiproton, neutron and anti-neutron) particles for the
36 // study of the neutral background in PHOS detector.
37 // These parameterizations are used by the
39 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
40 // AliGenPHOSlib::GetY(param),
41 // AliGenPHOSlib::GetIp(param) )
42 // param represents the particle to be simulated :
43 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
44 // Pt distributions are calculated from the transverse mass scaling
45 // with Pions, using the PtScal function taken from AliGenMUONlib
46 // version aliroot 3.01
48 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
49 // GPS @ SUBATECH, Nantes , France (October 1999)
50 // http://www-subatech.in2p3.fr/~photons/subatech
51 // martinez@subatech.in2p3.fr
52 //======================================================================
54 #include "AliGenPHOSlib.h"
57 ClassImp(AliGenPHOSlib)
59 //======================================================================
61 // (From GetPt, GetY and GetIp as param = Pion)
62 // Transverse momentum distribution" PtPion
63 // Rapidity distribution YPion
64 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
66 Double_t AliGenPHOSlib::PtPion(Double_t *px, Double_t *)
68 // Pion transverse momentum distribtuion taken
69 // from AliGenMUONlib class, version 3.01 of aliroot
70 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
71 // POWER LAW FOR PT > 500 MEV
72 // MT SCALING BELOW (T=160 MEV)
74 const Double_t kp0 = 1.3;
75 const Double_t kxn = 8.28;
76 const Double_t kxlim=0.5;
77 const Double_t kt=0.160;
78 const Double_t kxmpi=0.139;
80 Double_t y, y1, kxmpi2, ynorm, a;
83 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
85 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
88 y=a*TMath::Power(kp0/(kp0+x),kxn);
90 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
93 Double_t AliGenPHOSlib::YPion( Double_t *py, Double_t *)
96 // pion y-distribution
99 const Double_t ka = 7000.;
100 const Double_t kdy = 4.;
102 Double_t y=TMath::Abs(*py);
104 Double_t ex = y*y/(2*kdy*kdy);
105 return ka*TMath::Exp(-ex);
108 Int_t AliGenPHOSlib::IpPion()
110 // particle composition pi+, pi0, pi-
116 if ( (3.*random[0]) < 1. )
122 if ( (3.*random[0]) >= 2.)
133 //=============================================================
135 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
138 // Fonction for the calculation of the Pt distribution for a
139 // given particle np, from the pion Pt distribution using the
140 // mt scaling. This function was taken from AliGenMUONlib
141 // aliroot version 3.01, and was extended for baryons
142 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
143 // 7=>BARYONS-BARYONBARS
145 // SCALING EN MASSE PAR RAPPORT A PTPI
146 // MASS 1=>PI, 2=>K, 3=>ETA, 4=>OMEGA, 5=>ETA',6=>PHI
147 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
148 // MASS 7=>BARYON-BARYONBAR
150 // VALUE MESON/PI AT 5 GEV
151 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
153 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
154 Double_t kfmax2=f5/kfmax[np];
156 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
157 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
158 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
159 return fmtscal*ptpion;
162 //============================================================================
164 Double_t AliGenPHOSlib::PtKaon( Double_t *px, Double_t *)
168 //____________________________________________________________
170 return PtScal(*px,2); // 2==> Kaon in the PtScal function
173 Double_t AliGenPHOSlib::YKaon( Double_t *py, Double_t *)
176 //____________________________________________________________
178 const Double_t ka = 1000.;
179 const Double_t kdy = 4.;
182 Double_t y=TMath::Abs(*py);
184 Double_t ex = y*y/(2*kdy*kdy);
185 return ka*TMath::Exp(-ex);
188 Int_t AliGenPHOSlib::IpKaon()
190 // particle composition
193 Float_t random[1],random2[1];
195 gMC->Rndm(random2,1);
196 if (random2[0] < 0.5)
198 if (random[0] < 0.5) {
206 if (random[0] < 0.5) {
207 return 130; // K^0 short
209 return 310; // K^0 long
214 //============================================================================
215 //============================================================================
217 Double_t AliGenPHOSlib::PtEta( Double_t *px, Double_t *)
221 //____________________________________________________________
223 return PtScal(*px,3); // 3==> Eta in the PtScal function
226 Double_t AliGenPHOSlib::YEta( Double_t *py, Double_t *)
229 //____________________________________________________________
231 const Double_t ka = 1000.;
232 const Double_t kdy = 4.;
235 Double_t y=TMath::Abs(*py);
237 Double_t ex = y*y/(2*kdy*kdy);
238 return ka*TMath::Exp(-ex);
241 Int_t AliGenPHOSlib::IpEta()
243 // particle composition
249 //============================================================================
250 //============================================================================
252 Double_t AliGenPHOSlib::PtOmega( Double_t *px, Double_t *)
256 //____________________________________________________________
258 return PtScal(*px,4); // 4==> Omega in the PtScal function
261 Double_t AliGenPHOSlib::YOmega( Double_t *py, Double_t *)
264 //____________________________________________________________
266 const Double_t ka = 1000.;
267 const Double_t kdy = 4.;
270 Double_t y=TMath::Abs(*py);
272 Double_t ex = y*y/(2*kdy*kdy);
273 return ka*TMath::Exp(-ex);
276 Int_t AliGenPHOSlib::IpOmega()
278 // particle composition
284 //============================================================================
285 //============================================================================
287 Double_t AliGenPHOSlib::PtEtaprime( Double_t *px, Double_t *)
291 //____________________________________________________________
293 return PtScal(*px,5); // 5==> Etaprime in the PtScal function
296 Double_t AliGenPHOSlib::YEtaprime( Double_t *py, Double_t *)
299 //____________________________________________________________
301 const Double_t ka = 1000.;
302 const Double_t kdy = 4.;
305 Double_t y=TMath::Abs(*py);
307 Double_t ex = y*y/(2*kdy*kdy);
308 return ka*TMath::Exp(-ex);
311 Int_t AliGenPHOSlib::IpEtaprime()
313 // particle composition
316 return 331; // Etaprime
319 //===================================================================
320 //============================================================================
322 Double_t AliGenPHOSlib::PtPhi( Double_t *px, Double_t *)
326 //____________________________________________________________
328 return PtScal(*px,6); // 6==> Phi in the PtScal function
331 Double_t AliGenPHOSlib::YPhi( Double_t *py, Double_t *)
334 //____________________________________________________________
336 const Double_t ka = 1000.;
337 const Double_t kdy = 4.;
340 Double_t y=TMath::Abs(*py);
342 Double_t ex = y*y/(2*kdy*kdy);
343 return ka*TMath::Exp(-ex);
346 Int_t AliGenPHOSlib::IpPhi()
348 // particle composition
354 //===================================================================
355 //============================================================================
356 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
357 Double_t AliGenPHOSlib::PtBaryon( Double_t *px, Double_t *)
361 //____________________________________________________________
363 return PtScal(*px,7); // 7==> Baryon in the PtScal function
366 Double_t AliGenPHOSlib::YBaryon( Double_t *py, Double_t *)
369 //____________________________________________________________
371 const Double_t ka = 1000.;
372 const Double_t kdy = 4.;
375 Double_t y=TMath::Abs(*py);
377 Double_t ex = y*y/(2*kdy*kdy);
378 return ka*TMath::Exp(-ex);
381 Int_t AliGenPHOSlib::IpBaryon()
383 // particle composition
386 Float_t random[1],random2[1];
388 gMC->Rndm(random2,1);
389 if (random2[0] < 0.5)
391 if (random[0] < 0.5) {
394 return -2212; // pbar
399 if (random[0] < 0.5) {
402 return -2112; // n bar
407 //===================================================================
410 typedef Double_t (*GenFunc) (Double_t*, Double_t*);
411 GenFunc AliGenPHOSlib::GetPt(Param_t param, const char* tname)
413 // Return pinter to pT parameterisation
438 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
443 GenFunc AliGenPHOSlib::GetY(Param_t param, const char* tname)
445 // Return pointer to Y parameterisation
472 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
476 typedef Int_t (*GenFuncIp) ();
477 GenFuncIp AliGenPHOSlib::GetIp(Param_t param, const char* tname)
479 // Return pointer to particle composition
507 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");