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 //======================================================================
19 // AliGenPHOSlib class contains parameterizations of the
20 // pion, kaon, eta, omega, etaprime, phi and baryon (proton,
21 // antiproton, neutron and anti-neutron) particles for the
22 // study of the neutral background in PHOS detector.
23 // These parameterizations are used by the
25 // AliGenParam(npar, param, AliGenPHOSlib::GetPt(param),
26 // AliGenPHOSlib::GetY(param),
27 // AliGenPHOSlib::GetIp(param) )
28 // param represents the particle to be simulated :
29 // Pion, Kaon, Eta, Omega, Etaprime, Phi or Baryon
30 // Pt distributions are calculated from the transverse mass scaling
31 // with Pions, using the PtScal function taken from AliGenMUONlib
32 // version aliroot 3.01
34 // Gines MARTINEZ. Laurent APHECETCHE and Yves SCHUTZ
35 // GPS @ SUBATECH, Nantes , France (October 1999)
36 // http://www-subatech.in2p3.fr/~photons/subatech
37 // martinez@subatech.in2p3.fr
38 // Additional particle species simulation options has been added:
39 // Charged Pion, Charged Kaons, KLong Proton, Anti-Proton, Neutron,
40 // Anti-Neutron --> Changes made by Gustavo Conesa in November 2004
41 // Add flat Omega(782) distribution in Nov. 2010 by Renzhuo WAN
42 //======================================================================
47 #include "AliGenPHOSlib.h"
49 ClassImp(AliGenPHOSlib)
51 //======================================================================
53 // (From GetPt, GetY and GetIp as param = Pion)
54 // Transverse momentum distribution" PtPion
55 // Rapidity distribution YPion
56 // Particle distribution IdPion 111, 211 and -211 (pi0, pi+ and pi-)
58 Double_t AliGenPHOSlib::PtPion(const Double_t *px, const Double_t *)
60 // Pion transverse momentum distribtuion taken
61 // from AliGenMUONlib class, version 3.01 of aliroot
62 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
63 // POWER LAW FOR PT > 500 MEV
64 // MT SCALING BELOW (T=160 MEV)
66 const Double_t kp0 = 1.3;
67 const Double_t kxn = 8.28;
68 const Double_t kxlim=0.5;
69 const Double_t kt=0.160;
70 const Double_t kxmpi=0.139;
72 Double_t y, y1, kxmpi2, ynorm, a;
75 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
77 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+kxmpi2)/kt));
80 y=a*TMath::Power(kp0/(kp0+x),kxn);
82 y=kb*TMath::Exp(-sqrt(x*x+kxmpi2)/kt);
85 Double_t AliGenPHOSlib::YPion( const Double_t *py, const Double_t *)
88 // pion y-distribution
91 const Double_t ka = 7000.;
92 const Double_t kdy = 4.;
94 Double_t y=TMath::Abs(*py);
96 Double_t ex = y*y/(2*kdy*kdy);
97 return ka*TMath::Exp(-ex);
100 Int_t AliGenPHOSlib::IpPion(TRandom */*ran*/)
102 // particle composition pi+, pi0, pi-
107 Int_t AliGenPHOSlib::IpChargedPion(TRandom *ran)
109 // particle composition pi+, pi0, pi-
112 Float_t random = ran->Rndm();
114 if ( (2.*random) < 1. )
125 //======================================================================
126 // Pi 0 Flat Distribution
127 // Transverse momentum distribution PtPi0Flat
128 // Rapidity distribution YPi0Flat
129 // Particle distribution IdPi0Flat 111 (pi0)
132 Double_t AliGenPHOSlib::PtPi0(const Double_t * px, const Double_t *)
134 // Pion transverse momentum
135 const Double_t kp0 =1.35;
136 const Double_t kxn= 6.18;
137 return TMath::Power(kp0 /(kp0 + px[0]), kxn);
140 Double_t AliGenPHOSlib::PtPi0Flat(const Double_t */*px*/, const Double_t *)
142 // Pion transverse momentum flat distribution
148 Double_t AliGenPHOSlib::YPi0Flat( const Double_t */*py*/, const Double_t *)
151 // pion y-distribution
156 Int_t AliGenPHOSlib::IpPi0Flat(TRandom *)
159 // particle composition pi0
164 //=============================================================
166 Double_t AliGenPHOSlib::PtScal(Double_t pt, Int_t np)
169 // Fonction for the calculation of the Pt distribution for a
170 // given particle np, from the pion Pt distribution using the
171 // mt scaling. This function was taken from AliGenMUONlib
172 // aliroot version 3.01, and was extended for baryons
173 // np = 1=>Pions 2=>Kaons 3=>Etas 4=>Omegas 5=>ETA' 6=>PHI
174 // 7=>BARYONS-BARYONBARS
176 // SCALING EN MASSE PAR RAPPORT A PTPI
177 // MASS 0=>PI, 1=>K, 2=>ETA, 3=>OMEGA, 4=>ETA',5=>PHI
178 const Double_t khm[10] = {0.1396, 0.494, 0.547, 0.782, 0.957, 1.02,
179 // MASS 6=>BARYON-BARYONBAR
181 // VALUE MESON/PI AT 5 GEV
182 const Double_t kfmax[10]={1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
183 Double_t f5=TMath::Power(((sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
184 Double_t kfmax2=f5/kfmax[np];
186 Double_t ptpion=100.*PtPion(&pt, (Double_t*) 0);
187 Double_t fmtscal=TMath::Power(((sqrt(pt*pt+0.018215)+2.)/
188 (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/ kfmax2;
189 return fmtscal*ptpion;
193 //============================================================================
195 Double_t AliGenPHOSlib::PtKaon( const Double_t *px, const Double_t *)
199 //____________________________________________________________
201 return PtScal(*px,1); // 1==> Kaon in the PtScal function
204 Double_t AliGenPHOSlib::YKaon( const Double_t *py, const Double_t *)
207 //____________________________________________________________
209 const Double_t ka = 1000.;
210 const Double_t kdy = 4.;
213 Double_t y=TMath::Abs(*py);
215 Double_t ex = y*y/(2*kdy*kdy);
216 return ka*TMath::Exp(-ex);
219 Int_t AliGenPHOSlib::IpKaon(TRandom *ran)
221 // particle composition
224 Float_t random = ran->Rndm();
225 Float_t random2 = ran->Rndm();
237 return 130; // K^0 short
239 return 310; // K^0 long
244 Int_t AliGenPHOSlib::IpChargedKaon(TRandom *ran)
246 // particle composition
249 Float_t random = ran->Rndm();
259 Int_t AliGenPHOSlib::IpKaon0L(TRandom *)
261 // particle composition
264 return 130; // K^0 long
267 //============================================================================
268 //============================================================================
270 Double_t AliGenPHOSlib::PtEta( const Double_t *px, const Double_t *)
274 //____________________________________________________________
276 return PtScal(*px,2); // 2==> Eta in the PtScal function
279 Double_t AliGenPHOSlib::YEta( const Double_t *py, const Double_t *)
282 //____________________________________________________________
284 const Double_t ka = 1000.;
285 const Double_t kdy = 4.;
288 Double_t y=TMath::Abs(*py);
290 Double_t ex = y*y/(2*kdy*kdy);
291 return ka*TMath::Exp(-ex);
294 Int_t AliGenPHOSlib::IpEta(TRandom *)
296 // particle composition
303 //======================================================================
304 // Eta Flat Distribution
305 // Transverse momentum distribution PtEtaFlat
306 // Rapidity distribution YEtaFlat
307 // Particle distribution IdEtaFlat 111 (pi0)
310 Double_t AliGenPHOSlib::PtEtaFlat(const Double_t */*px*/, const Double_t *)
312 // Eta transverse momentum flat distribution
318 Double_t AliGenPHOSlib::YEtaFlat( const Double_t */*py*/, const Double_t *)
321 // pion y-distribution
326 Int_t AliGenPHOSlib::IpEtaFlat(TRandom *)
329 // particle composition eta
334 //============================================================================
335 //============================================================================
337 Double_t AliGenPHOSlib::PtOmega( const Double_t *px, const Double_t *)
341 //____________________________________________________________
343 return PtScal(*px,3); // 3==> Omega in the PtScal function
346 Double_t AliGenPHOSlib::YOmega( const Double_t *py, const Double_t *)
349 //____________________________________________________________
351 const Double_t ka = 1000.;
352 const Double_t kdy = 4.;
355 Double_t y=TMath::Abs(*py);
357 Double_t ex = y*y/(2*kdy*kdy);
358 return ka*TMath::Exp(-ex);
361 Int_t AliGenPHOSlib::IpOmega(TRandom *)
363 // particle composition
369 //============================================================================
370 //======================================================================
371 // Omega(782) Flat Distribution
372 // Transverse momentum distribution PtOmegaFlat
373 // Rapidity distribution YOmegaFlat
374 // Particle distribution IdOmegaFlat 223(0mega)
377 Double_t AliGenPHOSlib::PtOmegaFlat(const Double_t */*px*/, const Double_t *)
379 // omega transverse momentum flat distribution
385 Double_t AliGenPHOSlib::YOmegaFlat( const Double_t */*py*/, const Double_t *)
388 // omega y-distribution
393 Int_t AliGenPHOSlib::IpOmegaFlat(TRandom *)
396 // particle composition omega
403 //============================================================================
405 Double_t AliGenPHOSlib::PtEtaprime( const Double_t *px, const Double_t *)
409 //____________________________________________________________
411 return PtScal(*px,4); // 4==> Etaprime in the PtScal function
414 Double_t AliGenPHOSlib::YEtaprime( const Double_t *py, const Double_t *)
417 //____________________________________________________________
419 const Double_t ka = 1000.;
420 const Double_t kdy = 4.;
423 Double_t y=TMath::Abs(*py);
425 Double_t ex = y*y/(2*kdy*kdy);
426 return ka*TMath::Exp(-ex);
429 Int_t AliGenPHOSlib::IpEtaprime(TRandom *)
431 // particle composition
434 return 331; // Etaprime
437 //===================================================================
438 //============================================================================
440 Double_t AliGenPHOSlib::PtPhi( const Double_t *px, const Double_t *)
444 //____________________________________________________________
446 return PtScal(*px,5); // 5==> Phi in the PtScal function
449 Double_t AliGenPHOSlib::YPhi( const Double_t *py, const Double_t *)
452 //____________________________________________________________
454 const Double_t ka = 1000.;
455 const Double_t kdy = 4.;
458 Double_t y=TMath::Abs(*py);
460 Double_t ex = y*y/(2*kdy*kdy);
461 return ka*TMath::Exp(-ex);
464 Int_t AliGenPHOSlib::IpPhi(TRandom *)
466 // particle composition
472 //===================================================================
473 //============================================================================
474 // B A R Y O N S == protons, protonsbar, neutrons, and neutronsbars
475 Double_t AliGenPHOSlib::PtBaryon( const Double_t *px, const Double_t *)
479 //____________________________________________________________
481 return PtScal(*px,6); // 6==> Baryon in the PtScal function
484 Double_t AliGenPHOSlib::YBaryon( const Double_t *py, const Double_t *)
487 //____________________________________________________________
489 const Double_t ka = 1000.;
490 const Double_t kdy = 4.;
493 Double_t y=TMath::Abs(*py);
495 Double_t ex = y*y/(2*kdy*kdy);
496 return ka*TMath::Exp(-ex);
499 Int_t AliGenPHOSlib::IpBaryon(TRandom *ran)
501 // particle composition
504 Float_t random = ran->Rndm();
505 Float_t random2 = ran->Rndm();
511 return -2212; // pbar
519 return -2112; // n bar
524 Int_t AliGenPHOSlib::IpProton(TRandom *)
526 // particle composition
531 Int_t AliGenPHOSlib::IpAProton(TRandom *)
533 // particle composition
535 return -2212; // p bar
539 Int_t AliGenPHOSlib::IpNeutron(TRandom *)
541 // particle composition
546 Int_t AliGenPHOSlib::IpANeutron(TRandom *)
548 // particle composition
554 //===================================================================
556 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
557 GenFunc AliGenPHOSlib::GetPt(Int_t param, const char* /*tname*/) const
559 // Return pinter to pT parameterisation
596 printf("<AliGenPHOSlib::GetPt> unknown parametrisationn");
601 GenFunc AliGenPHOSlib::GetY(Int_t param, const char* /*tname*/) const
603 // Return pointer to Y parameterisation
640 printf("<AliGenPHOSlib::GetY> unknown parametrisationn");
644 typedef Int_t (*GenFuncIp) (TRandom *);
645 GenFuncIp AliGenPHOSlib::GetIp(Int_t param, const char* /*tname*/) const
647 // Return pointer to particle composition
707 printf("<AliGenPHOSlib::GetIp> unknown parametrisationn");