newly implemented model for slow nucleon production
[u/mrichter/AliRoot.git] / EVGEN / AliGenParam.cxx
index 1089601..717dae0 100644 (file)
@@ -273,8 +273,16 @@ void AliGenParam::Init()
 //____________________________________________________________
 void AliGenParam::Generate()
 {
+  // 
+  // Generate 1 event (see Generate(Int_t ntimes) for details
   //
-  // Generate 'npart' of light and heavy mesons (J/Psi, upsilon or phi, Pion,
+  GenerateN(1);
+}
+//____________________________________________________________
+void AliGenParam::GenerateN(Int_t ntimes)
+{
+  //
+  // Generate ntimes*'npart' light and heavy mesons (J/Psi, upsilon or phi, Pion,
   // Kaons, Etas, Omegas) and Baryons (proton, antiprotons, neutrons and 
   // antineutrons in the the desired theta, phi and momentum windows; 
   // Gaussian smearing on the vertex is done if selected. 
@@ -322,7 +330,8 @@ void AliGenParam::Generate()
   // Generating fNpart particles
   fNprimaries = 0;
   
-  while (ipa<fNpart) {
+  Int_t nGen = fNpart*ntimes;
+  while (ipa<nGen) {
       while(1) {
       //
       // particle type 
@@ -504,9 +513,9 @@ void AliGenParam::Generate()
                          Int_t ksc  = iparticle->GetStatusCode();
                          Int_t jpa  = iparticle->GetFirstMother()-1;
                          
-                         och[0] = origin0[0]+iparticle->Vx()/10;
-                         och[1] = origin0[1]+iparticle->Vy()/10;
-                         och[2] = origin0[2]+iparticle->Vz()/10;
+                         och[0] = origin0[0]+iparticle->Vx();
+                         och[1] = origin0[1]+iparticle->Vy();
+                         och[2] = origin0[2]+iparticle->Vz();
                          pc[0]  = iparticle->Px();
                          pc[1]  = iparticle->Py();
                          pc[2]  = iparticle->Pz();