]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TUHKMgen/TUHKMgen.cxx
Coverity fixes in TUHKMgen
[u/mrichter/AliRoot.git] / TUHKMgen / TUHKMgen.cxx
index cf81d4a32a891f50e0847c5dedeb62332e80b79b..bd8ff34cb7f073870eeb34fb3d8c2c67cf672b07 100755 (executable)
@@ -120,9 +120,9 @@ TUHKMgen::TUHKMgen() :
   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;
@@ -284,13 +284,13 @@ Int_t TUHKMgen::ImportParticles(TClonesArray *particles, const Option_t* option)
     Int_t type = it->GetType();  
       
     if (im1> -1) {
-     // particle not a primary -> set the daughter indexes for the mother particle"<< endl;
+      // particle not a primary -> set the daughter indexes for the mother particle"<< endl;
       TParticle *mother = (TParticle*) (particlesR.UncheckedAt(im1));
       mother->SetLastDaughter(nump);
       if(mother->GetFirstDaughter()==-1)
        mother->SetFirstDaughter(nump);
-    }
-      
+    } else 
+      ++numprim;
     
     new (particlesR[nump]) TParticle(it->Encoding(), type,                                             //pdg,stat
                                     im1, im2, id1, id2,                                                //m1,m2,d1,d2
@@ -329,7 +329,12 @@ void TUHKMgen::Initialize()
 
 void TUHKMgen::Print(const Option_t*) const
 {
-  cout << "TUHKMgen::Print() method not implemented yet!!" << endl;
+  cout << "**********************************************************************************" << endl;
+  cout << "* UHKM Generator interface to ROOT::TGenerator                                   *" << endl;
+  cout << "*  Documentation:                                                                *" << endl;
+  cout << "* I.P.Lokhtin, L.V.Malinina, S.V.Petrushanko, A.M.Snigirev, I.Arsene, K.Tywoniuk *" << endl;
+  cout << "*    Comput.Phys.Commun.180:779-799, 2009                                        *" << endl;
+  cout << "**********************************************************************************" << endl;
 }
 
 void TUHKMgen::GenerateEvent()