particleDensityPiTh = gcPiTh.ParticleNumberDensity(fDatabase->GetPDGParticle(211));
}
- for(Int_t particleIndex = 0; particleIndex < TMath::Min(fDatabase->GetNParticles(), kNPartTypes); particleIndex++) {
+ if(fDatabase->GetNParticles()>=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;
+ }
+ for(Int_t particleIndex = 0; particleIndex<fDatabase->GetNParticles() && particleIndex<kNPartTypes; particleIndex++) {
ParticlePDG *currParticle = fDatabase->GetPDGParticleByIndex(particleIndex);
Int_t encoding = currParticle->GetPDG();
//strangeness supression
}
if(particleDensity > 0.) {
- // outMult<<encoding<< " " <<particleDensity<< " "<<mu<<std::endl;
+ if(fParams.fNPartTypes>=kNPartTypes) {
+ Error("in Bool_t MultIni:", "fNPartTypes exceeds the maximum allowed particle species of %d. Check it out!", kNPartTypes);
+ return kFALSE;
+ }
fParams.fPartEnc[fParams.fNPartTypes] = encoding;
fParams.fPartMult[2 * fParams.fNPartTypes] = particleDensity;
fParams.fPartMu[2 * fParams.fNPartTypes] = mu;
++fParams.fNPartTypes;
- if(fParams.fNPartTypes > 1000)
- Error("in Bool_t MultIni:", "fNPartTypes is too large %d", fParams.fNPartTypes);
}
}
return kTRUE;