fHydjetParams.fIenglu=0;
fHydjetParams.fIanglu=0;
*/
- strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 256);
- strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 256);
+ if(strlen(Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")))<255)
+ strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 256);
+ if(strlen(Form("%s/TUHKMgen/UHKM/tabledecay.txt",gSystem->Getenv("ALICE_ROOT")))<255)
+ strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 256);
for(Int_t i=0; i<500; i++) {
fStableFlagPDG[i] = 0;
fStableFlagStatus[i] = kFALSE;
fHydjetParams.fIanglu=0;
*/
- strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 256);
- strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 256);
+ if(strlen(Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")))<255)
+ strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 256);
+ if(strlen(Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")))<255)
+ strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 256);
for(Int_t i=0; i<500; i++) {
fStableFlagPDG[i] = 0;
fStableFlagStatus[i] = kFALSE;
//gluons (0: small-angular, 1: wide-angular, 2:collinear) (default: 0).
- void SetPDGParticleFile(const Char_t *name) {strncpy(fParticleFilename, name, 256);}//Set the filename containing the particle PDG info
- void SetPDGDecayFile(const Char_t *name) {strncpy(fDecayFilename, name, 256);} //Set the filename containing the PDG decay channels info
+ void SetPDGParticleFile(const Char_t *name) {if(strlen(name)<255) strncpy(fParticleFilename, name, 256);}//Set the filename containing the particle PDG info
+ void SetPDGDecayFile(const Char_t *name) {if(strlen(name)<255) strncpy(fDecayFilename, name, 256);} //Set the filename containing the PDG decay channels info
void SetPDGParticleStable(Int_t pdg, Bool_t value) { // Turn on/off the decay flag for a PDG particle
fStableFlagPDG[fStableFlagged] = pdg;
fStableFlagStatus[fStableFlagged++] = value;
fHydjetParams.fIenglu=0;
fHydjetParams.fIanglu=0;
*/
-
- strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 256);
- strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 256);
+
+ if(strlen(Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")))<255)
+ strncpy(fParticleFilename, Form("%s/TUHKMgen/UHKM/particles.data", gSystem->Getenv("ALICE_ROOT")), 256);
+ if(strlen(Form("%s/TUHKMgen/UHKM/tabledecay.txt",gSystem->Getenv("ALICE_ROOT")))<255)
+ strncpy(fDecayFilename, Form("%s/TUHKMgen/UHKM/tabledecay.txt", gSystem->Getenv("ALICE_ROOT")), 256);
for(Int_t i=0; i<500; i++) {
fStableFlagPDG[i] = 0;
fStableFlagStatus[i] = kFALSE;
// gluons (0: small-angular, 1: wide-angular, 2:collinear) (default: 0).
- void SetPDGParticleFile(const Char_t *name) {strncpy(fParticleFilename, name, 256);} // Set the filename containing the particle PDG info
- void SetPDGDecayFile(const Char_t *name) {strncpy(fDecayFilename, name, 256);} // Set the filename containing the PDG decay channels info
+ void SetPDGParticleFile(const Char_t *name) {if(strlen(name)<255) strncpy(fParticleFilename, name, 256);} // Set the filename containing the particle PDG info
+ void SetPDGDecayFile(const Char_t *name) {if(strlen(name)<255) strncpy(fDecayFilename, name, 256);} // Set the filename containing the PDG decay channels info
void SetPDGParticleStable(Int_t pdg, Bool_t value) { // Turn on/off the decay flag for a PDG particle
fStableFlagPDG[fStableFlagged] = pdg;
fStableFlagStatus[fStableFlagged++] = value;
}
void DatabasePDG::SetParticleFilename(Char_t *filename) {
- strncpy(fParticleFilename, filename, 256);
+ if(strlen(filename)<255)
+ strncpy(fParticleFilename, filename, 256);
}
void DatabasePDG::SetDecayFilename(Char_t *filename) {
- strncpy(fDecayFilename, filename, 256);
+ if(strlen(filename)<255)
+ strncpy(fDecayFilename, filename, 256);
}
Bool_t DatabasePDG::LoadData() {
// constructor
//
for(Int_t i=0; i<kMaxDaughters; i++) {
- if(i >= kMaxDaughters) {
- cout << "ERROR in DecayChannel explicit constructor: " << endl;
- cout << "Number of daughters bigger than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
- }
if(i<nDaughters)
fDaughtersPDG[fNDaughters++] = *(daughters+i);
else
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
//
// default constructor
//
- memset(fName,'0',9);
+ memset(fName,'a',9);
for(Int_t i=0; i<kMaxDecayChannels; i++)
fDecayChannels[i] = new DecayChannel();
}