]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TUHKMgen/UHKM/InitialStateHydjet.cxx
Coverity fixes
[u/mrichter/AliRoot.git] / TUHKMgen / UHKM / InitialStateHydjet.cxx
index 3d77eec310f59bf09f6e36fdcbc40a747cb60aea..4412ebbf1aad4996b17fcd26c078468f917cc611 100644 (file)
@@ -469,7 +469,12 @@ Bool_t InitialStateHydjet::MultIni() {
     particleDensityPiTh = gcPiTh.ParticleNumberDensity(fDatabase->GetPDGParticle(211));
   }
 
-  for(Int_t particleIndex = 0; particleIndex < TMath::Min(fDatabase->GetNParticles(), kNPartTypes); particleIndex++) {
+  for(Int_t particleIndex = 0; particleIndex < fDatabase->GetNParticles(); particleIndex++) {
+    if(particleIndex>=kNPartTypes) {
+      cout << "InitialStateHydjet::MultIni(): ERROR Particle definitions in the PDG database exceeds the hardcoded limit of " << kNPartTypes << endl;
+      cout << "      There is either an error with reading the particles file or you might need to increase the maximum allowed definitions" << endl;
+      break;
+    }
     ParticlePDG *currParticle = fDatabase->GetPDGParticleByIndex(particleIndex);
     Int_t encoding = currParticle->GetPDG();
     //strangeness supression