Comminication with gray particle model and collision geometry added.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Jan 2003 14:11:43 +0000 (14:11 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Jan 2003 14:11:43 +0000 (14:11 +0000)
EVGEN/AliGenGrayParticles.cxx
EVGEN/AliGenGrayParticles.h

index 3c1a4c5..20f5f7c 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+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
@@ -38,6 +41,7 @@ Gray particle generator, first commit.
  */
 #include "AliGenGrayParticles.h"
 #include "AliGrayParticleModel.h"
+#include "AliCollisionGeometry.h"
 #include "AliPDG.h"
 #include <TDatabasePDG.h>
 
@@ -46,6 +50,8 @@ Gray particle generator, first commit.
  AliGenGrayParticles::AliGenGrayParticles():AliGenerator(-1)
 {
 // Default constructor
+    fGrayParticleModel = 0;
+    fCollisionGeometry = 0;
 }
 
 AliGenGrayParticles::AliGenGrayParticles(Int_t npart)
@@ -60,12 +66,15 @@ AliGenGrayParticles::AliGenGrayParticles(Int_t npart)
     SetCharge();
     SetTemperature();
     SetBetaSource();
+    fGrayParticleModel = new AliGrayParticleModel();
+    fCollisionGeometry = 0;
 }
 
 //____________________________________________________________
 AliGenGrayParticles::~AliGenGrayParticles()
 {
 // Destructor
+    delete  fGrayParticleModel;
 }
 
 
@@ -85,11 +94,22 @@ 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++) {
+        for(i = 0;i < fNpart; i++) {
        Int_t kf;
         if(fCharge==1) kf = kProton;
                   else kf = kNeutron;
index 3882834..f7f3505 100644 (file)
@@ -25,6 +25,9 @@ public:
     //
     virtual void SetGrayParticleModel(AliGrayParticleModel* model) 
        {fGrayParticleModel = model;}
+    virtual Bool_t NeedsCollisionGeometry() {return kTRUE;}
+    virtual void   SetCollisionGeometry(AliCollisionGeometry* geom)
+       {fCollisionGeometry = geom;}
            
  protected:
     void     GenerateSlow(Int_t charge, Double_t T, Double_t beta, Float_t* q);