]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenGrayParticles.cxx
New class used for primary vertex finding (AliITSVertexerTracks)
[u/mrichter/AliRoot.git] / EVGEN / AliGenGrayParticles.cxx
index 39d904a5efa520f9be90fa504d726954340db635..4bf739245c66717fd3abae99b08333b7c6b837d9 100644 (file)
 
 /*
 $Log$
+Revision 1.5  2003/01/07 14:11:43  morsch
+Comminication with gray particle model and collision geometry added.
+
+Revision 1.4  2003/01/06 10:09:57  morsch
+Use AliGrayParticleModel.
+
+Revision 1.3  2002/12/02 10:02:40  morsch
+Corrections introduced by F. Silker:
+- SetBetaSource
+- Particle type according to charge.
+
+Revision 1.2  2002/10/14 14:55:35  hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
+Revision 1.1.2.1  2002/10/10 16:40:08  hristov
+Updating VirtualMC to v3-09-02
+
+Revision 1.1  2002/10/08 13:53:17  morsch
+Gray particle generator, first commit.
+
 */
 
 /*
@@ -22,15 +42,21 @@ $Log$
   Source is modelled by a relativistic Maxwell distributions.
   Original code by  Ferenc Sikler  <sikler@rmki.kfki.hu>
  */
-#include "AliGenGrayParticles.h"
-#include "AliPDG.h"
+
 #include <TDatabasePDG.h>
+#include <TPDGCode.h>
+
+#include "AliCollisionGeometry.h"
+#include "AliGenGrayParticles.h"
+#include "AliGrayParticleModel.h"
 
  ClassImp(AliGenGrayParticles)
     
  AliGenGrayParticles::AliGenGrayParticles():AliGenerator(-1)
 {
 // Default constructor
+    fGrayParticleModel = 0;
+    fCollisionGeometry = 0;
 }
 
 AliGenGrayParticles::AliGenGrayParticles(Int_t npart)
@@ -42,13 +68,18 @@ AliGenGrayParticles::AliGenGrayParticles(Int_t npart)
     SetPmax();
     SetTarget();
     SetNominalCmsEnergy();
+    SetCharge();
     SetTemperature();
+    SetBetaSource();
+    fGrayParticleModel = new AliGrayParticleModel();
+    fCollisionGeometry = 0;
 }
 
 //____________________________________________________________
 AliGenGrayParticles::~AliGenGrayParticles()
 {
 // Destructor
+    delete  fGrayParticleModel;
 }
 
 
@@ -68,13 +99,26 @@ void AliGenGrayParticles::Generate()
   //
   // Generate one event
   //
+  //
+  // Communication with Gray Particle Model 
+  // 
+    Int_t np, nn;
+
+    Float_t b = fCollisionGeometry->ImpactParameter();
+    printf("AliGenGrayParticles: Impact parameter from Collision Geometry %f \n", b);
+    
+    fGrayParticleModel->GetNumberOfGrayNucleons(fCollisionGeometry, np, nn);
+    
+   //
     Float_t p[3];
     Float_t origin[3] = {0., 0., 0.};
     Float_t polar [3] = {0., 0., 0.};    
     Int_t nt, i;
-    for(i = 0;i < fNpart; i++) {
-       Int_t kf = kProton;
-       GenerateSlow(1, fTemperature, 0., p);
+        for(i = 0;i < fNpart; i++) {
+       Int_t kf;
+        if(fCharge==1) kf = kProton;
+                  else kf = kNeutron;
+       GenerateSlow(fCharge, fTemperature, fBetaSource, p);
        
        SetTrack(fTrackIt, -1, kf, p, origin, polar,
                 0., kPNoProcess, nt, 1.);