]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TUHKMgen/AliGenUHKM.cxx
Removing useless flag.
[u/mrichter/AliRoot.git] / TUHKMgen / AliGenUHKM.cxx
index e7cdb2785a69cc77bfc973ef99afa50de7b438b6..8e19451dbab2934f8cf55793fc1999021ad77ba2 100755 (executable)
 //                                                                         //
 ////////////////////////////////////////////////////////////////////////////
 
-#include <TUHKMgen.h>
+#include <iostream>
+#include <string>
+
+#include "TUHKMgen.h"
 #ifndef DATABASE_PDG
 #include "DatabasePDG.h"
 #endif
@@ -26,8 +29,8 @@
 #include <TParticle.h>
 #include <TClonesArray.h>
 #include <TMCProcess.h>
-#include "TDatabasePDG.h"
-#include "TSystem.h"
+#include <TDatabasePDG.h>
+#include <TSystem.h>
 
 #include "AliGenUHKM.h"
 #include "AliRun.h"
 #include "AliGenHijingEventHeader.h"
 #include "AliLog.h"
 
-#include <iostream>
-#include <string>
 using namespace std;
 
+
 ClassImp(AliGenUHKM)
 
 //_______________________________________
@@ -49,14 +51,10 @@ AliGenUHKM::AliGenUHKM()
    fTrials(0),
    fUHKMgen(0),
    fHydjetParams(),
-   fStableFlagged(0),
-   fUseCharmParticles(kFALSE),
-   fMinWidth(0.0),
-   fMaxWidth(10.0),
-   fMinMass(0.0001),
-   fMaxMass(10.0)
+   fStableFlagged(0)
 {
-  cout << "AliGenUHKM::AliGenUHKM() IN" << endl;
+  // Default constructor setting up default reasonable parameter values
+  // for central Pb+Pb collisions at 5.5TeV 
   
   // LHC
   fHydjetParams.fSqrtS=5500; //LHC
@@ -121,15 +119,14 @@ AliGenUHKM::AliGenUHKM()
   fHydjetParams.fIenglu=0;
   fHydjetParams.fIanglu=0;
 */
-  strcpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")));
-  strcpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")));
+  strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 255);
+  strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 255);
   for(Int_t i=0; i<500; i++) {
     fStableFlagPDG[i] = 0;
     fStableFlagStatus[i] = kFALSE;
   }
   fStableFlagged = 0;
 
-  cout << "AliGenUHKM::AliGenUHKM() OUT" << endl;
 }
 
 //_______________________________________
@@ -138,18 +135,15 @@ AliGenUHKM::AliGenUHKM(Int_t npart)
    fTrials(0),
    fUHKMgen(0),
    fHydjetParams(),
-   fStableFlagged(0),
-   fUseCharmParticles(kFALSE),
-   fMinWidth(0.0),
-   fMaxWidth(10.0),
-   fMinMass(0.0001),
-   fMaxMass(10.0)
+   fStableFlagged(0)
 {
-  cout << "AliGenUHKM::AliGenUHKM(Int_t) IN" << endl;
+  // Constructor specifying the size of the particle table
+  // and setting up default reasonable parameter values
+  // for central Pb+Pb collisions at 5.5TeV
+
   fName = "UHKM";
   fTitle= "Particle Generator using UHKM 3.0";
 
-  // Constructor specifying the size of the particle table
   fNprimaries = 0;   
 
   //LHC
@@ -215,23 +209,27 @@ AliGenUHKM::AliGenUHKM(Int_t npart)
   fHydjetParams.fIanglu=0;
 */
 
-  strcpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")));
-  strcpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")));
+  strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 255);
+  strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 255);
   for(Int_t i=0; i<500; i++) {
     fStableFlagPDG[i] = 0;
     fStableFlagStatus[i] = kFALSE;
   }
   fStableFlagged = 0;  
 
-  cout << "AliGenUHKM::AliGenUHKM(Int_t) OUT" << endl;
 }
 
 //__________________________________________
 AliGenUHKM::~AliGenUHKM()
-{}
+{
+  // Destructor, do nothing
+  //  delete fParticles;
+}
 
 void AliGenUHKM::SetAllParametersRHIC() 
 {
+  // Set reasonable default parameters for 0-5% central Au+Au collisions
+  // at 200 GeV at RHIC
   SetEcms(200.0);                // RHIC top energy
   SetAw(197);                    // Au+Au
   SetBmin(0.0);                  // 0%
@@ -250,7 +248,7 @@ void AliGenUHKM::SetAllParametersRHIC()
   SetEtaRMax(1.1);               // Umax = 1.1
   SetMomAsymmPar(0.0);           // delta = 0.0
   SetCoordAsymmPar(0.0);         // epsilon = 0.0
-  SetFlagWeakDecay(0);           // weak decay on (<0 off !!!)
+  //  SetFlagWeakDecay(0);           // weak decay on (<0 off !!!)
   SetEtaType(1);                 // gaus distributed with fYmax dispersion (0 means boost invariant)
   SetGammaS(1.0);                // gammaS = 1.0 (no strangeness canonical suppresion)
   SetPyquenNhsel(2);             // hydro on, jets on, jet quenching on
@@ -265,6 +263,8 @@ void AliGenUHKM::SetAllParametersRHIC()
 
 void AliGenUHKM::SetAllParametersLHC()
 {
+  // Set reasonable default parameters for 0-5% central Pb+Pb collisions
+  // at 5.5 TeV at LHC
   SetEcms(5500.0);               // LHC
   SetAw(207);                    // Pb+Pb
   SetBmin(0.0);                  // 0%
@@ -283,7 +283,7 @@ void AliGenUHKM::SetAllParametersLHC()
   SetEtaRMax(1.1);               // Umax = 1.1
   SetMomAsymmPar(0.0);           // delta = 0.0
   SetCoordAsymmPar(0.0);         // epsilon = 0.0
-  SetFlagWeakDecay(0);           // weak decay on (<0 off !!!)
+  //  SetFlagWeakDecay(0);           // weak decay on (<0 off !!!)
   SetEtaType(1);                 // gaus distributed with fYmax dispersion (0 means boost invariant)
   SetGammaS(1.0);                // gammaS = 1.0 (no strangeness canonical suppresion)
   SetPyquenNhsel(2);             // hydro on, jets on, jet quenching on
@@ -299,176 +299,176 @@ void AliGenUHKM::SetAllParametersLHC()
 //_________________________________________
 void AliGenUHKM::Init()
 {
-  cout << "AliGenUHKM::Init() IN" << endl;
+  // Initialization of the TGenerator::TUHKMgen interface object. 
+  // Model input parameters are transmited to the TUHKMgen object which forwards them
+  // further to the model.
+  // HYDJET++ is initialized (average multiplicities are calculated, particle species definitions and decay
+  // channels are loaded, etc.)
 
   SetMC(new TUHKMgen());
   fUHKMgen = (TUHKMgen*) fMCEvGen;
   SetAllParameters();
-
+  
   AliGenMC::Init();
-
   fUHKMgen->Initialize();
-  CheckPDGTable();
-
-  fUHKMgen->Print();
-  cout << "AliGenUHKM::Init() OUT" << endl;
+  CheckPDGTable();    
+  fUHKMgen->Print();  
 }
 
-
-
 //________________________________________
 void AliGenUHKM::Generate()
 {
-  cout << "AliGenUHKM::Generate() IN" << endl;
+  // Generate one HYDJET++ event, get the output and push particles further 
+  // to AliRoot's stack 
+
   Float_t polar[3] = {0,0,0};
   Float_t origin[3]   = {0,0,0};
   Float_t origin0[3]  = {0,0,0};
+  Float_t time0 = 0.;
+  Float_t p[3];
   Float_t v[3];
-  Float_t mass, energy;
+  Float_t mass=0.0, energy=0.0;
 
   Vertex();
   for(Int_t j=0; j<3; j++) origin0[j] = fVertex[j];
+  time0 = fTime;
 
-  fTrials = 0;
- // cout << "AliGenUHKM::Generate() fTrials = " << fTrials << endl;
-
-  Int_t nt  = 0;
-
+  // Generate the event and import particles
   fUHKMgen->GenerateEvent();
-  fTrials++;
-
   fUHKMgen->ImportParticles(&fParticles,"All");
-
   Int_t np = fParticles.GetEntriesFast();
-  cout << "AliGenUHKM::Generate() GetEntries  " <<np<< endl;
+  Int_t nt  =  0;
 
 
+  // Handle the IDs of particles on the stack  
   Int_t* idsOnStack = new Int_t[np];
   Int_t* newPos     = new Int_t[np];
-  for(Int_t i=0; i<np; i++) newPos[i] = i;
-
-  //_________ Loop for particle selection
-  //  for(Int_t i=1; i<np; i++) {
-  for(Int_t i=1; i<np; i++) {
-    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    // the particle indexes are 0 based but fParticles is a 1 based array
-    // -1 is the trivial code (when it does not exist)
-    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    TParticle *iparticle = (TParticle*)fParticles.At(i);
-//    cout << "AliGenUHKM::Generate() particle #" << i << " in fParticles *********************"<< endl;
+  for(Int_t i=0; i<np; i++) {
+    newPos[i] = i;
+    idsOnStack[i] = -1;
+  }
+  
 
-    Int_t kf = iparticle->GetPdgCode();
-//    cout << "AliGenUHKM::Generate() PDG = " << kf << endl;
+  // Generate a random phi used to rotate the whole event
+  Double_t eventRotation = gRandom->Rndm()*TMath::Pi();
 
+  TParticle *iparticle;
+  Double_t partMomPhi=0.0, partPt=0.0;
+  Double_t partVtxPhi=0.0, partVtxR=0.0;
+  //_________ Loop for particles in the stack
+  for(Int_t i=0; i<np; i++) {
+    iparticle = (TParticle*)fParticles.At(i);
+    Int_t kf = iparticle->GetPdgCode();
     Bool_t hasMother = (iparticle->GetFirstMother() >= 0);
-
-//    cout << "AliGenUHKM::Generate() mother index in fParticles = " 
-//      << (iparticle->GetFirstMother()==-1 ? -1 : iparticle->GetFirstMother()+1)  
-//      << " ; hasMother = " << hasMother << endl;
-
     Bool_t hasDaughter = (iparticle->GetNDaughters() > 0);
-
-   // cout << "AliGenUHKM::Generate() n.daughters = " << iparticle->GetNDaughters() 
-    //<< " ; hasDaughter = " << hasDaughter << endl;
-
-
+    
     if(hasDaughter) {
-      //      cout << "AliGenUHKM::Generate() decayed particle (not trackable)" << endl;
       // This particle has decayed
       // It will not be tracked
-      // Add it only once with coordiinates not
+      // Add it only once with coordinates not
       // smeared with primary vertex position
-      Float_t p[3] = {p[0] = iparticle->Px(),
-                      p[1] = iparticle->Py(),
-                      p[2] = iparticle->Pz()};
+      
+      // rotate the direction of the particle
+      partMomPhi = TMath::ATan2(iparticle->Py(), iparticle->Px());
+      partPt = TMath::Hypot(iparticle->Px(), iparticle->Py());
+      p[0] = partPt*TMath::Cos(partMomPhi+eventRotation);
+      p[1] = partPt*TMath::Sin(partMomPhi+eventRotation);
+      p[2] = iparticle->Pz();
+      
       mass = TDatabasePDG::Instance()->GetParticle(kf)->Mass();
       energy = sqrt(mass*mass + p[0]*p[0] + p[1]*p[1] + p[2]*p[2]);
-      v[0] = iparticle->Vx();
-      v[1] = iparticle->Vy();
-      v[2] = iparticle->Vz();
-      Float_t time = iparticle->T();
 
-      Int_t type    = iparticle->GetStatusCode(); //j1/h0
+      // rotate the freezeout point
+      partVtxPhi = TMath::ATan2(iparticle->Vy(), iparticle->Vx());
+      partVtxR = TMath::Hypot(iparticle->Vx(), iparticle->Vy());
+      v[0] = partVtxR*TMath::Cos(partVtxPhi + eventRotation);
+      v[1] = partVtxR*TMath::Cos(partVtxPhi + eventRotation);
+      v[2] = iparticle->Vz();
 
+      Float_t time = iparticle->T();
+      
       Int_t imo = -1;
       if(hasMother) {
-        imo = iparticle->GetFirstMother(); //index of mother particle in fParticles
+       imo = iparticle->GetFirstMother(); //index of mother particle in fParticles
       } // if has mother
-      Bool_t trackFlag = (!hasDaughter);   // tFlag is kFALSE --> do not track the particle
-
-//      printf("Pushing Track %d with status %d mother %d\n", kf, trackFlag, imo>=0?idsOnStack[imo]:imo);
-      PushTrack(trackFlag, (imo>=0 ? idsOnStack[imo+1] : imo), kf,
-                p[0], p[1], p[2], energy,
-                v[0], v[1], v[2], time,
-                polar[0], polar[1], polar[2],
-                (hasMother ? kPDecay : kPNoProcess), nt);
-    //  cout << "AliGenUHKM::Generate() pushed on stack with stack index = " << nt 
-//        << "; mother index on stack = " << (imo>=0 ? idsOnStack[imo+1] : imo) << endl;
+      Bool_t trackFlag = kFALSE;   // tFlag is kFALSE --> do not track the particle
+      
+      PushTrack(trackFlag, (imo>=0 ? idsOnStack[imo] : imo), kf,
+               p[0], p[1], p[2], energy,
+               v[0], v[1], v[2], time,
+               polar[0], polar[1], polar[2],
+               (hasMother ? kPDecay : kPNoProcess), nt);
       idsOnStack[i] = nt;
+      
       fNprimaries++;
       KeepTrack(nt);
     }
     else {
-      //      cout << "AliGenUHKM::Generate() final particle --> push it twice on the stack" << endl;
       // This is a final state particle
       // It will be tracked
       // Add it TWICE to the stack !!!
       // First time with event-wide coordinates (for femtoscopy) -
       //   this one will not be tracked
-      // Second time with event-wide ccordiantes and vertex smearing
+      // Second time with event-wide c0ordinates and vertex smearing
       //   this one will be tracked
-      Float_t p[3] = {p[0] = iparticle->Px(),
-                      p[1] = iparticle->Py(),
-                      p[2] = iparticle->Pz()};
-      mass = TDatabasePDG::Instance()->GetParticle(kf)->Mass();
+
+      // rotate the direction of the particle      
+      partMomPhi = TMath::ATan2(iparticle->Py(), iparticle->Px());
+      partPt = TMath::Hypot(iparticle->Px(), iparticle->Py());
+      p[0] = partPt*TMath::Cos(partMomPhi+eventRotation);
+      p[1] = partPt*TMath::Sin(partMomPhi+eventRotation);
+      p[2] = iparticle->Pz();      
+
       energy = sqrt(mass*mass + p[0]*p[0] + p[1]*p[1] + p[2]*p[2]);
-      v[0] = iparticle->Vx();
-      v[1] = iparticle->Vy();
-      v[2] = iparticle->Vz();
 
-      Int_t type    = iparticle->GetStatusCode(); //j1/h0
+      // rotate the freezeout point
+      partVtxPhi = TMath::ATan2(iparticle->Vy(), iparticle->Vx());
+      partVtxR = TMath::Hypot(iparticle->Vx(), iparticle->Vy());
+      v[0] = partVtxR*TMath::Cos(partVtxPhi + eventRotation);
+      v[1] = partVtxR*TMath::Cos(partVtxPhi + eventRotation);
+      v[2] = iparticle->Vz();      
+      
+      Int_t type    = iparticle->GetStatusCode(); // 1-from jet / 0-from hydro 
       Int_t coeffT=1;
-      if(type==1)coeffT=-1; //to separate particles from jets
-
+      if(type==1) coeffT=-1; //to separate particles from jets
+      
+      
       Int_t imo = -1;
       
       if(hasMother) {
-        imo = iparticle->GetFirstMother();
+       imo = iparticle->GetFirstMother();
       } // if has mother
-      Bool_t trackFlag = (hasDaughter);  // tFlag = kFALSE --> do not track this one, its for femtoscopy
-       
-      PushTrack(trackFlag, (imo>=0 ? idsOnStack[imo+1] : imo), kf,
-                p[0], p[1], p[2], energy,
-                v[0], v[1], v[2], (iparticle->T())*coeffT,
-                polar[0], polar[1], polar[2],
-                hasMother ? kPDecay:kPNoProcess, nt);
-     // cout << "AliGenUHKM::Generate() pushed on stack with stack index = " << nt
-    //       << "; mother index on stack = " << (imo>=0 ? idsOnStack[imo+1] : imo) << endl;
-
+      
+      Bool_t trackFlag = kFALSE;  // tFlag = kFALSE --> do not track this one, its for femtoscopy
+      PushTrack(trackFlag, (imo>=0 ? idsOnStack[imo] : imo), kf,
+               p[0], p[1], p[2], energy,
+               v[0], v[1], v[2], (iparticle->T())*coeffT,    // freeze-out time is negative if the particle comes from jet
+               polar[0], polar[1], polar[2],
+               hasMother ? kPDecay:kPNoProcess, nt);
+      
       idsOnStack[i] = nt;
       fNprimaries++;
       KeepTrack(nt);
-
+      
       origin[0] = origin0[0]+v[0];
       origin[1] = origin0[1]+v[1];
       origin[2] = origin0[2]+v[2];
+      Float_t time = time0+iparticle->T();
       imo = nt;
       
-      trackFlag = (!hasDaughter);    // tFlag = kTRUE --> track this one
-      //cout << "AliGenUHKM::Generate() trackFlag = " << trackFlag << endl;
-
+      trackFlag = fTrackIt;    // Track this particle, unless otherwise specified by fTrackIt
+      
       PushTrack(trackFlag, imo, kf,
-                p[0], p[1], p[2], energy,
-                origin[0], origin[1], origin[2], iparticle->T(),
-                polar[0], polar[1], polar[2],
-                hasMother ? kPDecay:kPNoProcess, nt);
-     // cout << "AliGenUHKM::Generate() pushed on stack with stack index = " << nt
-    //       << "; mother index on stack = " << imo << endl;
+               p[0], p[1], p[2], energy,
+               origin[0], origin[1], origin[2], time,
+               polar[0], polar[1], polar[2],
+               hasMother ? kPDecay:kPNoProcess, nt);
+      
       fNprimaries++;
       KeepTrack(nt);
     }
   }
-
+  
   SetHighWaterMark(fNprimaries);
 
   TArrayF eventVertex;
@@ -476,30 +476,36 @@ void AliGenUHKM::Generate()
   eventVertex[0] = origin0[0];
   eventVertex[1] = origin0[1];
   eventVertex[2] = origin0[2];
+  Float_t eventTime = time0;
 
   // Builds the event header, to be called after each event
   AliGenEventHeader* header = new AliGenHijingEventHeader("UHKM");
+  Double_t b       = 0.;
+  Double_t npart   = 0; 
+  Double_t nbin    = 0;
+  fUHKMgen->GetCentrality(b, npart, nbin);
+  printf("********** %13.3f %13.3f %13.3f \n", b, npart, nbin);
+  
+
 
   ((AliGenHijingEventHeader*) header)->SetNProduced(fNprimaries);
   ((AliGenHijingEventHeader*) header)->SetPrimaryVertex(eventVertex);
-  ((AliGenHijingEventHeader*) header)->SetImpactParameter(0.0);
+  ((AliGenHijingEventHeader*) header)->SetInteractionTime(eventTime);
+  ((AliGenHijingEventHeader*) header)->SetImpactParameter(b);
   ((AliGenHijingEventHeader*) header)->SetTotalEnergy(0.0);
   ((AliGenHijingEventHeader*) header)->SetHardScatters(0);
-  ((AliGenHijingEventHeader*) header)->SetParticipants(0, 0);
-  ((AliGenHijingEventHeader*) header)->SetCollisions(0, 0, 0, 0);
+  ((AliGenHijingEventHeader*) header)->SetParticipants(Int_t(npart), 0);
+  ((AliGenHijingEventHeader*) header)->SetCollisions(Int_t(nbin), 0, 0, 0);
   ((AliGenHijingEventHeader*) header)->SetSpectators(0, 0, 0, 0);
   ((AliGenHijingEventHeader*) header)->SetReactionPlaneAngle(0);//evrot);
 
   header->SetPrimaryVertex(fVertex);
+  header->SetInteractionTime(fTime);
   AddHeader(header);
   fCollisionGeometry = (AliGenHijingEventHeader*)  header;
 
-  delete idsOnStack;
-
-  //  gAlice->SetGenEventHeader(header);
-
-  printf(" Finish Generate .. %d ..\n",nt);
-  cout << "AliGenUHKM::Generate() OUT" << endl;
+  delete [] idsOnStack;
+  delete [] newPos;
 }
 
 void AliGenUHKM::Copy(TObject &) const
@@ -508,7 +514,7 @@ void AliGenUHKM::Copy(TObject &) const
 }
 
 void AliGenUHKM::SetAllParameters() {
-  cout << "AliGenUHKM::SetAllParameters() IN" << endl;
+  // Forward all input parameters to the TGenerator::TUHKMgen object
 
   fUHKMgen->SetEcms(fHydjetParams.fSqrtS);
   fUHKMgen->SetBmin(fHydjetParams.fBmin);
@@ -532,7 +538,6 @@ void AliGenUHKM::SetAllParameters() {
   fUHKMgen->SetCoordAsymmPar(fHydjetParams.fEpsilon);
 
   fUHKMgen->SetGammaS(fHydjetParams.fCorrS);
-  // fUHKMgen->SetHdec(fHydjetParams.fTime);
   fUHKMgen->SetEtaType(fHydjetParams.fEtaType);
   fUHKMgen->SetFlagWeakDecay(fHydjetParams.fWeakDecay);
 
@@ -549,16 +554,23 @@ void AliGenUHKM::SetAllParameters() {
 
   fUHKMgen->SetPDGParticleFile(fParticleFilename);
   fUHKMgen->SetPDGDecayFile(fDecayFilename);
-  for(Int_t i=0; i<fStableFlagged; i++) fUHKMgen->SetPDGParticleStable(fStableFlagPDG[i], fStableFlagStatus[i]);
-  fUHKMgen->SetUseCharmParticles(fUseCharmParticles);
-  fUHKMgen->SetMinimumWidth(fMinWidth);
-  fUHKMgen->SetMaximumWidth(fMaxWidth);
-  fUHKMgen->SetMinimumMass(fMinMass);
-  fUHKMgen->SetMaximumMass(fMaxMass);
-
- cout<<" Print all parameters "<<endl;
- cout<<" SqrtS = "<<fHydjetParams.fSqrtS<<endl;
- cout<<" Bmin  = "<< fHydjetParams.fBmin<<endl;
+  //  fUHKMgen->SetUseCharmParticles(fUseCharmParticles);
+  //  fUHKMgen->SetMinimumWidth(fMinWidth);
+  //  fUHKMgen->SetMaximumWidth(fMaxWidth);
+  //  fUHKMgen->SetMinimumMass(fMinMass);
+  //  fUHKMgen->SetMaximumMass(fMaxMass);
+
+  //  cout << "AliGenUHKM::Init() no. stable flagged particles = " << fStableFlagged << endl;
+  for(Int_t i=0; i<fStableFlagged; i++) {
+    //    cout << "AliGenUHKM::Init() flag no. " << i
+    //         << " PDG = " << fStableFlagPDG[i]
+    //         << " flag = " << fStableFlagStatus[i] << endl;
+    fUHKMgen->SetPDGParticleStable(fStableFlagPDG[i], fStableFlagStatus[i]);
+  }
+
+   cout<<" Print all parameters "<<endl;
+   cout<<" SqrtS = "<<fHydjetParams.fSqrtS<<endl;
+   cout<<" Bmin  = "<< fHydjetParams.fBmin<<endl;
  cout<<" Bmax= "<<fHydjetParams.fBmax<<endl;
  cout<<" Aw= "<<fHydjetParams.fAw<<endl;
  cout<<" Seed= "<<fHydjetParams.fSeed<<endl;
@@ -585,7 +597,6 @@ cout<<"-----Volume parameters -------------- "<<endl;
 cout<<" --------Flags------ "<<endl;
 
  cout<<" GammaS= "<<fHydjetParams.fCorrS<<endl;
-  // fUHKMgen->SetHdec(fHydjetParams.fTime<<endl;
  cout<<" EtaType= "<<fHydjetParams.fEtaType<<endl;
  cout<<" FlagWeakDecay= "<<fHydjetParams.fWeakDecay<<endl;
 
@@ -600,34 +611,30 @@ cout<<" --------Flags------ "<<endl;
   cout<<" Ienglu= "<<fHydjetParams.fIenglu<<endl;
   cout<<" Ianglu= "<<fHydjetParams.fIanglu<<endl;
 
-  cout<<"----PDG table parameters---"<<endl;
+  //  cout<<"----PDG table parameters---"<<endl;
   
-  cout<<" UseCharmParticles= "<<fUseCharmParticles<<endl;
-  cout<<" MinimumWidth= "<<fMinWidth<<endl;
-  cout<<" MaximumWidth= "<<fMaxWidth<<endl;
-  cout<<" MinimumMass= "<<fMinMass<<endl;
-  cout<<" MaximumMass= "<<fMaxMass<<endl;
-
+  //  cout<<" UseCharmParticles= "<<fUseCharmParticles<<endl;
+  //  cout<<" MinimumWidth= "<<fMinWidth<<endl;
+  //  cout<<" MaximumWidth= "<<fMaxWidth<<endl;
+  //  cout<<" MinimumMass= "<<fMinMass<<endl;
+  //  cout<<" MaximumMass= "<<fMaxMass<<endl;
 
-
-  cout << "AliGenUHKM::SetAllParameters() OUT" << endl;
+  //  cout << "AliGenUHKM::SetAllParameters() OUT" << endl;
 }
 
 // add the additional PDG codes from UHKM(SHARE table) to ROOT's table
 void AliGenUHKM::CheckPDGTable() {
-  cout << "AliGenUHKM::CheckPDGTable()   IN" << endl;
-  //TDabasePDG *rootPDG  = TDatabasePDG::Instance();         // ROOT's PDG table
+  // Add temporarely all particle definitions from HYDJET++ which miss in the ROOT's PDG tables
+  // to the TDatabasePDG table.
+
   DatabasePDG *uhkmPDG = fUHKMgen->PDGInfo();              // UHKM's PDG table
   TParticlePDG *rootTestParticle;
   ParticlePDG *uhkmTestParticle;
-
-  cout << "particles with good status in UHKM table = " << uhkmPDG->GetNParticles() << endl;
+  
   // loop over all particles in the SHARE table
   for(Int_t i=0; i<uhkmPDG->GetNParticles(); i++) {
-    cout << "particle #" << i << " ================" << endl;
     // get a particle specie
     uhkmTestParticle = uhkmPDG->GetPDGParticleByIndex(i);
-    cout << "PDG = " << uhkmTestParticle->GetPDG() << endl;
     // check if this code exists in ROOT's table
     rootTestParticle = TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG());
     if(!rootTestParticle) {    // if not then add it to the ROOT's PDG database
@@ -638,13 +645,10 @@ void AliGenUHKM::CheckPDGTable() {
                                            uhkmTestParticle->GetWidth(), 
                                            (Int_t(uhkmTestParticle->GetBaryonNumber())==0 ? "meson" : "baryon"),
                                            uhkmTestParticle->GetPDG());    
-     cout << "Not found in ROOT's PDG database --> added now" << endl;
-    if(uhkmTestParticle->GetWidth()<1e-10) cout<<uhkmTestParticle->GetPDG()<<"its mass "<< 
-    TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG())->Mass()<<
-    TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG())->Width()<<endl;  
+      if(uhkmTestParticle->GetWidth()<1e-10) 
+       cout << uhkmTestParticle->GetPDG() << " with mass "
+            << TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG())->Mass()
+            << TDatabasePDG::Instance()->GetParticle(uhkmTestParticle->GetPDG())->Width() << endl;  
     }
-    else
-      cout << "Found in ROOT's PDG database --> not added" << endl;
   }  // end for
-  cout << "AliGenUHKM::CheckPDGTable()   OUT" << endl;
 }