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/10/02 21:28:06 fca
19 Removal of useless dependecies via forward declarations
21 Revision 1.2 2000/07/11 18:24:55 fca
22 Coding convention corrections + few minor bug fixes
24 Revision 1.1 2000/06/09 20:20:30 morsch
25 Same class as previously in AliSimpleGen.cxx
26 All coding rule violations except RS3 corrected (AM)
29 ///////////////////////////////////////////////////////////////////
31 // Generate the final state of the interaction as the input //
32 // to the MonteCarlo //
36 <img src="picts/AliGeneratorClass.gif">
39 <font size=+2 color=red>
40 <p>The responsible person for this module is
41 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
47 ///////////////////////////////////////////////////////////////////
49 #include "AliGenHIJINGpara.h"
55 ClassImp(AliGenHIJINGpara)
57 AliGenHIJINGpara::AliGenHIJINGpara(const AliGenHIJINGpara & para)
62 //_____________________________________________________________________________
63 static Double_t ptpi(Double_t *px, Double_t *)
66 // PT-PARAMETERIZATION CDF, PRL 61(88) 1819
67 // POWER LAW FOR PT > 500 MEV
68 // MT SCALING BELOW (T=160 MEV)
70 const Double_t kp0 = 1.3;
71 const Double_t kxn = 8.28;
72 const Double_t kxlim=0.5;
73 const Double_t kt=0.160;
74 const Double_t kxmpi=0.139;
76 Double_t y, y1, xmpi2, ynorm, a;
79 y1=TMath::Power(kp0/(kp0+kxlim),kxn);
81 ynorm=kb*(TMath::Exp(-sqrt(kxlim*kxlim+xmpi2)/kt));
84 y=a*TMath::Power(kp0/(kp0+x),kxn);
86 y=kb*TMath::Exp(-sqrt(x*x+xmpi2)/kt);
90 //_____________________________________________________________________________
91 static Double_t ptscal(Double_t pt, Int_t np)
93 // SCALING EN MASSE PAR RAPPORT A PTPI
94 // MASS PI,K,ETA,RHO,OMEGA,ETA',PHI
95 const Double_t khm[10] = {.13957,.493,.5488,.769,.7826,.958,1.02,0,0,0};
96 // VALUE MESON/PI AT 5 GEV
97 const Double_t kfmax[10]={1.,0.3,0.55,1.0,1.0,1.0,1.0,0,0,0};
99 Double_t f5=TMath::Power(((
100 sqrt(100.018215)+2.)/(sqrt(100.+khm[np]*khm[np])+2.0)),12.3);
101 Double_t fmax2=f5/kfmax[np];
103 Double_t ptpion=100.*ptpi(&pt, (Double_t*) 0);
104 Double_t fmtscal=TMath::Power(((
105 sqrt(pt*pt+0.018215)+2.)/ (sqrt(pt*pt+khm[np]*khm[np])+2.0)),12.3)/
107 return fmtscal*ptpion;
110 //_____________________________________________________________________________
111 static Double_t ptka( Double_t *px, Double_t *)
114 // pt parametrisation for k
116 return ptscal(*px,2);
120 //_____________________________________________________________________________
121 static Double_t etapic( Double_t *py, Double_t *)
124 // eta parametrisation for pi
126 const Double_t ka1 = 4913.;
127 const Double_t ka2 = 1819.;
128 const Double_t keta1 = 0.22;
129 const Double_t keta2 = 3.66;
130 const Double_t kdeta1 = 1.47;
131 const Double_t kdeta2 = 1.51;
132 Double_t y=TMath::Abs(*py);
134 Double_t ex1 = (y-keta1)*(y-keta1)/(2*kdeta1*kdeta1);
135 Double_t ex2 = (y-keta2)*(y-keta2)/(2*kdeta2*kdeta2);
136 return ka1*TMath::Exp(-ex1)+ka2*TMath::Exp(-ex2);
139 //_____________________________________________________________________________
140 static Double_t etakac( Double_t *py, Double_t *)
143 // eta parametrisation for ka
145 const Double_t ka1 = 497.6;
146 const Double_t ka2 = 215.6;
147 const Double_t keta1 = 0.79;
148 const Double_t keta2 = 4.09;
149 const Double_t kdeta1 = 1.54;
150 const Double_t kdeta2 = 1.40;
151 Double_t y=TMath::Abs(*py);
153 Double_t ex1 = (y-keta1)*(y-keta1)/(2*kdeta1*kdeta1);
154 Double_t ex2 = (y-keta2)*(y-keta2)/(2*kdeta2*kdeta2);
155 return ka1*TMath::Exp(-ex1)+ka2*TMath::Exp(-ex2);
158 //_____________________________________________________________________________
159 AliGenHIJINGpara::AliGenHIJINGpara()
163 // Default constructor
171 //_____________________________________________________________________________
172 AliGenHIJINGpara::AliGenHIJINGpara(Int_t npart)
176 // Standard constructor
179 fTitle="HIJING Parametrisation Particle Generator";
186 //_____________________________________________________________________________
187 AliGenHIJINGpara::~AliGenHIJINGpara()
190 // Standard destructor
198 //_____________________________________________________________________________
199 void AliGenHIJINGpara::Init()
202 // Initialise the HIJING parametrisation
204 Float_t etaMin =-TMath::Log(TMath::Tan(
205 TMath::Min((Double_t)fThetaMax/2,TMath::Pi()/2-1.e-10)));
206 Float_t etaMax = -TMath::Log(TMath::Tan(
207 TMath::Max((Double_t)fThetaMin/2,1.e-10)));
208 fPtpi = new TF1("ptpi",&ptpi,0,20,0);
209 fPtka = new TF1("ptka",&ptka,0,20,0);
210 fETApic = new TF1("etapic",&etapic,etaMin,etaMax,0);
211 fETAkac = new TF1("etakac",&etakac,etaMin,etaMax,0);
212 TF1 *etaPic0 = new TF1("etapic",&etapic,-7,7,0);
213 TF1 *etaKac0 = new TF1("etakac",&etakac,-7,7,0);
214 Float_t intETApi = etaPic0->Integral(-0.5, 0.5);
215 Float_t intETAka = etaKac0->Integral(-0.5, 0.5);
216 Float_t scalePi=7316/(intETApi/1.5);
217 Float_t scaleKa= 684/(intETAka/2.0);
219 Float_t intPt = (0.877*etaPic0->Integral(0, 15)+
220 0.123*etaKac0->Integral(0, 15));
221 Float_t intPtSel = (0.877*etaPic0->Integral(fPtMin, fPtMax)+
222 0.123*etaKac0->Integral(fPtMin, fPtMax));
223 Float_t ptFrac = intPtSel/intPt;
226 Float_t intETASel = (scalePi*etaPic0->Integral(etaMin, etaMax)+
227 scaleKa*etaKac0->Integral(etaMin, etaMax));
228 Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi();
229 fParentWeight = Float_t(fNpart)/intETASel*ptFrac*phiFrac;
231 printf("\n The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ", 100.*fParentWeight);
235 //_____________________________________________________________________________
236 void AliGenHIJINGpara::Generate()
239 // Generate one trigger
243 const Float_t kRaKpic=0.14;
244 const Float_t kBorne=1/(1+kRaKpic);
245 Float_t polar[3]= {0,0,0};
247 const Int_t kPions[3] = {kPi0, kPiPlus, kPiMinus};
248 const Int_t kKaons[4] = {kK0Long, kK0Short, kKPlus, kKMinus};
251 Float_t pt, pl, ptot;
254 Int_t i, part, nt, j;
261 for (j=0;j<3;j++) origin[j]=fOrigin[j];
262 if(fVertexSmear==kPerEvent) {
265 origin[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
266 TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
269 for(i=0;i<fNpart;i++) {
272 if(random[0]<kBorne) {
273 part=kPions[Int_t (random[1]*3)];
277 part=kKaons[Int_t (random[1]*4)];
281 phi=fPhiMin+random[2]*(fPhiMax-fPhiMin);
282 theta=2*TMath::ATan(TMath::Exp(-etaf->GetRandom()));
283 if(theta<fThetaMin || theta>fThetaMax) continue;
285 pl=pt/TMath::Tan(theta);
286 ptot=TMath::Sqrt(pt*pt+pl*pl);
287 if(ptot<fPMin || ptot>fPMax) continue;
288 p[0]=pt*TMath::Cos(phi);
289 p[1]=pt*TMath::Sin(phi);
291 if(fVertexSmear==kPerTrack) {
294 origin[j]=fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
295 TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
298 gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
304 AliGenHIJINGpara& AliGenHIJINGpara::operator=(const AliGenHIJINGpara& rhs)
306 // Assignment operator