]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THydjet/AliGenHydjet.cxx
Coding violation fixes
[u/mrichter/AliRoot.git] / THydjet / AliGenHydjet.cxx
index 3d90a42f0d2031e7630104de292dc31f62ffb601..675244b49073857e63c517e602f3832e0411fc7e 100755 (executable)
@@ -27,6 +27,7 @@
 #include <TClonesArray.h>
 
 #include "AliGenHydjet.h"
+#include "AliLog.h"
 #include "AliGenHydjetEventHeader.h"
 #include "AliRun.h"
 #include "AliPythiaRndm.h"
@@ -36,7 +37,6 @@ ClassImp(AliGenHydjet)
 AliGenHydjet::AliGenHydjet(Int_t npart) :
   AliGenMC(npart),
     //initial parameters
-  fEnergyCMS(5500.),      //Energy cms
   fFrame("CMS"),      // Reference frame
   fAtomicWeigth(207),        // Projectile-Target atomic weight
   fIfbtype(0),          // centrality type
@@ -63,18 +63,17 @@ AliGenHydjet::AliGenHydjet(Int_t npart) :
 {
 // Default PbPb collisions at 5. 5 TeV
 //
+  fEnergyCMS = 5500.;      //Energy cms
   fName = "Hydjet";
   fTitle = "Particle Generator using Hydjet";
-  fParticles = new TClonesArray("TParticle",10000);
-   // Set random number generator 
-    if (!AliPythiaRndm::GetPythiaRandom()) 
-      AliPythiaRndm::SetPythiaRandom(GetRandom());
+  // Set random number generator 
+  if (!AliPythiaRndm::GetPythiaRandom()) 
+    AliPythiaRndm::SetPythiaRandom(GetRandom());
 }
 
 AliGenHydjet::~AliGenHydjet()
 {
 // Destructor
-    delete fParticles;
 }
 
 void AliGenHydjet::Init()
@@ -133,10 +132,9 @@ void AliGenHydjet::Generate()
   {
 //    Generate one event
       fHydjet->GenerateEvent();
-      fHydjet->ImportParticles(fParticles,"All");
+      fHydjet->ImportParticles(&fParticles,"All");
 
-      Int_t np = fParticles->GetEntriesFast();
-      printf("\n **************************************************%d\n",np);
+      Int_t np = fParticles.GetEntriesFast();
       Int_t nc = 0;
       if (np == 0 ) continue;
       Int_t i;
@@ -156,7 +154,7 @@ void AliGenHydjet::Generate()
 //
 
       for(i = 0; i<np; i++){
-         TParticle *  iparticle = (TParticle *) fParticles->At(i);
+         TParticle *  iparticle = (TParticle *) fParticles.At(i);
          // Is this a final state particle ?
          if (!Stable(iparticle)) continue;
          Bool_t selected = kTRUE;
@@ -176,7 +174,7 @@ void AliGenHydjet::Generate()
 //
 
       for(i = 0; i<np; i++) {
-         TParticle *  iparticle = (TParticle *) fParticles->At(i);
+         TParticle *  iparticle = (TParticle *) fParticles.At(i);
          Bool_t  hasDaughter = (iparticle->GetFirstDaughter() > 0);
          if(pSelected[i]){
            kf = iparticle->GetPdgCode();
@@ -199,7 +197,7 @@ void AliGenHydjet::Generate()
       } // particle loop
       delete[] pSelected;
 
-      printf("\n I've put %i particles on the stack \n",nc);
+      AliInfo(Form("\n I've put %i particles on the stack \n",nc));
       if (nc > 0) break;
   } // event loop
   MakeHeader();