/*
$Log$
+Revision 1.8 2001/07/20 11:03:58 morsch
+Issue warning message if used outside allowed eta range (-8 to 8).
+
+Revision 1.7 2001/07/17 12:41:01 morsch
+- Calculation of fraction of event corresponding to selected pt-range corrected
+(R. Turrisi)
+- Parent weight corrected.
+
+Revision 1.6 2001/05/16 14:57:10 alibrary
+New files for folders and Stack
+
+Revision 1.5 2000/12/21 16:24:06 morsch
+Coding convention clean-up
+
+Revision 1.4 2000/11/30 07:12:50 alibrary
+Introducing new Rndm and QA classes
+
+Revision 1.3 2000/10/02 21:28:06 fca
+Removal of useless dependecies via forward declarations
+
Revision 1.2 2000/07/11 18:24:55 fca
Coding convention corrections + few minor bug fixes
All coding rule violations except RS3 corrected (AM)
*/
-///////////////////////////////////////////////////////////////////
-// //
-// Generate the final state of the interaction as the input //
-// to the MonteCarlo //
-//
+
+// Parameterisation of pi and K, eta and pt distributions
+// used for the ALICE TDRs.
+// eta: according to HIJING (shadowing + quenching)
+// pT : according to CDF measurement at 1.8 TeV
+// Author: andreas.morsch@cern.ch
+
+
//Begin_Html
/*
<img src="picts/AliGeneratorClass.gif">
///////////////////////////////////////////////////////////////////
#include "AliGenHIJINGpara.h"
+#include "TF1.h"
#include "AliRun.h"
-#include "AliMC.h"
#include "AliConst.h"
#include "AliPDG.h"
TMath::Min((Double_t)fThetaMax/2,TMath::Pi()/2-1.e-10)));
Float_t etaMax = -TMath::Log(TMath::Tan(
TMath::Max((Double_t)fThetaMin/2,1.e-10)));
- fPtpi = new TF1("ptpi",&ptpi,0,20,0);
- fPtka = new TF1("ptka",&ptka,0,20,0);
+ fPtpi = new TF1("ptpi",&ptpi,0,20,0);
+ fPtka = new TF1("ptka",&ptka,0,20,0);
fETApic = new TF1("etapic",&etapic,etaMin,etaMax,0);
fETAkac = new TF1("etakac",&etakac,etaMin,etaMax,0);
+
TF1 *etaPic0 = new TF1("etapic",&etapic,-7,7,0);
TF1 *etaKac0 = new TF1("etakac",&etakac,-7,7,0);
+
+ TF1 *ptPic0 = new TF1("ptpi",&ptpi,0.,15.,0);
+ TF1 *ptKac0 = new TF1("ptka",&ptka,0.,15.,0);
+
Float_t intETApi = etaPic0->Integral(-0.5, 0.5);
Float_t intETAka = etaKac0->Integral(-0.5, 0.5);
- Float_t scalePi=7316/(intETApi/1.5);
- Float_t scaleKa= 684/(intETAka/2.0);
-
- Float_t intPt = (0.877*etaPic0->Integral(0, 15)+
- 0.123*etaKac0->Integral(0, 15));
- Float_t intPtSel = (0.877*etaPic0->Integral(fPtMin, fPtMax)+
- 0.123*etaKac0->Integral(fPtMin, fPtMax));
- Float_t ptFrac = intPtSel/intPt;
-
-
+ Float_t scalePi = 7316/(intETApi/1.5);
+ Float_t scaleKa = 684/(intETAka/2.0);
+
+// Fraction of events corresponding to the selected pt-range
+ Float_t intPt = (0.877*ptPic0->Integral(0, 15)+
+ 0.123*ptKac0->Integral(0, 15));
+ Float_t intPtSel = (0.877*ptPic0->Integral(fPtMin, fPtMax)+
+ 0.123*ptKac0->Integral(fPtMin, fPtMax));
+ Float_t ptFrac = intPtSel/intPt;
+
+// Fraction of events corresponding to the selected eta-range
Float_t intETASel = (scalePi*etaPic0->Integral(etaMin, etaMax)+
scaleKa*etaKac0->Integral(etaMin, etaMax));
- Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi();
- fParentWeight = Float_t(fNpart)/intETASel*ptFrac*phiFrac;
-
- printf("\n The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ", 100.*fParentWeight);
+// Fraction of events corresponding to the selected phi-range
+ Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi();
+
+ fParentWeight = Float_t(fNpart)/(intETASel*ptFrac*phiFrac);
+ printf("%s: The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ",
+ ClassName(),100.*fParentWeight);
+
+// Issue warning message if etaMin or etaMax are outside the alowed range
+// of the parametrization
+ if (etaMin < -8.001 || etaMax > 8.001) {
+ printf("\n \n WARNING FROM AliGenHIJINGPara !");
+ printf("\n YOU ARE USING THE PARAMETERISATION OUTSIDE ");
+ printf("\n THE ALLOWED PSEUDORAPIDITY RANGE (-8. - 8.)");
+ printf("\n YOUR LIMITS: %f %f \n \n ", etaMin, etaMax);
+ }
}
//_____________________________________________________________________________
//
for (j=0;j<3;j++) origin[j]=fOrigin[j];
if(fVertexSmear==kPerEvent) {
- gMC->Rndm(random,6);
+ Rndm(random,6);
for (j=0;j<3;j++) {
origin[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
for(i=0;i<fNpart;i++) {
while(1) {
- gMC->Rndm(random,3);
+ Rndm(random,3);
if(random[0]<kBorne) {
part=kPions[Int_t (random[1]*3)];
ptf=fPtpi;
p[1]=pt*TMath::Sin(phi);
p[2]=pl;
if(fVertexSmear==kPerTrack) {
- gMC->Rndm(random,6);
+ Rndm(random,6);
for (j=0;j<3;j++) {
origin[j]=fOrigin[j]+fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
}
}
- gAlice->SetTrack(fTrackIt,-1,part,p,origin,polar,0,"Primary",nt,fParentWeight);
+ SetTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
break;
}
}