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 **************************************************************************/
16 /* $Id: AliGenEMlib.cxx 30052 2008-11-25 14:54:18Z morsch $ */
18 /////////////////////////////////////////////////////////////////////////////
20 // Implementation of AliGenEMlib for electron, di-electron, and photon //
21 // cocktail calculations. //
22 // It is based on AliGenGSIlib. //
24 // Responsible: R.Averbeck@gsi.de //
26 /////////////////////////////////////////////////////////////////////////////
32 #include "AliGenEMlib.h"
37 //==========================================================================
39 // Definition of Particle Distributions
41 //==========================================================================
43 //--------------------------------------------------------------------------
47 //--------------------------------------------------------------------------
48 Int_t AliGenEMlib::IpPizero(TRandom *)
50 // Return pizero pdg code
54 Double_t AliGenEMlib::PtPizero( const Double_t *px, const Double_t */*dummy*/ )
56 // Generate pizero pT distribution from modified Hagedorn parameterization
57 // taken from fit to unidentified hadrons in pp at 7 TeV
58 const Double_t kc=0.000565;
59 const Double_t kp0=0.2472;
60 const Double_t kp1=4.354;
61 const Double_t kn=7.007;
65 invYield = kc/TMath::Power(kp0+x/kp1,kn);
67 return invYield*(2*TMath::Pi()*x);
71 Double_t AliGenEMlib::YPizero( const Double_t *py, const Double_t */*dummy*/ )
77 //--------------------------------------------------------------------------
81 //--------------------------------------------------------------------------
82 Int_t AliGenEMlib::IpEta(TRandom *)
84 // Return eta pdg code
88 Double_t AliGenEMlib::PtEta( const Double_t *px, const Double_t */*dummy*/ )
94 Double_t AliGenEMlib::YEta( const Double_t *py, const Double_t */*dummy*/ )
100 //--------------------------------------------------------------------------
104 //--------------------------------------------------------------------------
105 Int_t AliGenEMlib::IpRho(TRandom *)
107 // Return rho pdg code
111 Double_t AliGenEMlib::PtRho( const Double_t *px, const Double_t */*dummy*/ )
114 return MtScal(*px,3);
117 Double_t AliGenEMlib::YRho( const Double_t *py, const Double_t */*dummy*/ )
123 //--------------------------------------------------------------------------
127 //--------------------------------------------------------------------------
128 Int_t AliGenEMlib::IpOmega(TRandom *)
130 // Return omega pdg code
134 Double_t AliGenEMlib::PtOmega( const Double_t *px, const Double_t */*dummy*/ )
137 return MtScal(*px,4);
140 Double_t AliGenEMlib::YOmega( const Double_t *py, const Double_t */*dummy*/ )
146 //--------------------------------------------------------------------------
150 //--------------------------------------------------------------------------
151 Int_t AliGenEMlib::IpEtaprime(TRandom *)
153 // Return etaprime pdg code
157 Double_t AliGenEMlib::PtEtaprime( const Double_t *px, const Double_t */*dummy*/ )
160 return MtScal(*px,5);
163 Double_t AliGenEMlib::YEtaprime( const Double_t *py, const Double_t */*dummy*/ )
169 //--------------------------------------------------------------------------
173 //--------------------------------------------------------------------------
174 Int_t AliGenEMlib::IpPhi(TRandom *)
176 // Return phi pdg code
180 Double_t AliGenEMlib::PtPhi( const Double_t *px, const Double_t */*dummy*/ )
183 return MtScal(*px,6);
186 Double_t AliGenEMlib::YPhi( const Double_t *py, const Double_t */*dummy*/ )
192 Double_t AliGenEMlib::YFlat(Double_t y)
194 //--------------------------------------------------------------------------
196 // flat rapidity distribution
198 //--------------------------------------------------------------------------
206 //=============================================================
210 //=============================================================
212 Double_t AliGenEMlib::MtScal(Double_t pt, Int_t np)
214 // Function for the calculation of the Pt distribution for a
215 // given particle np, from the pizero Pt distribution using
218 // MASS 1=>PIZERO, 2=>ETA, 3=>RHO, 4=>OMEGA, 5=>ETAPRIME, 6=>PHI
220 const Double_t khm[6] = {0.13498, 0.54751, 0.7755, 0.78265, 0.95778, 1.01946};
223 Double_t scaledPt = sqrt(pt*pt + khm[np]*khm[np] - khm[0]*khm[0]);
224 Double_t scaledYield = PtPizero(&scaledPt, (Double_t*) 0);
226 // VALUE MESON/PI AT 5 GEV
228 Double_t normPt = 5.;
229 Double_t scaledNormPt = sqrt(normPt*normPt + khm[np]*khm[np] - khm[0]*khm[0]);
230 const Double_t kfmax[6]={1., 0.48, 1.0, 0.9, 0.25, 0.4};
232 Double_t norm = kfmax[np] * (PtPizero(&normPt, (Double_t*) 0) / PtPizero(&scaledNormPt, (Double_t*) 0));
234 return norm*(pt/scaledPt)*scaledYield;
237 //==========================================================================
241 //==========================================================================
243 typedef Double_t (*GenFunc) (const Double_t*, const Double_t*);
245 typedef Int_t (*GenFuncIp) (TRandom *);
247 GenFunc AliGenEMlib::GetPt(Int_t param, const char * tname) const
249 // Return pointer to pT parameterisation
251 TString sname(tname);
276 printf("<AliGenEMlib::GetPt> unknown parametrisation\n");
281 GenFunc AliGenEMlib::GetY(Int_t param, const char * tname) const
283 // Return pointer to y- parameterisation
285 TString sname(tname);
310 printf("<AliGenEMlib::GetY> unknown parametrisation\n");
315 GenFuncIp AliGenEMlib::GetIp(Int_t param, const char * tname) const
317 // Return pointer to particle type parameterisation
319 TString sname(tname);
344 printf("<AliGenEMlib::GetIp> unknown parametrisation\n");