Files
geant4/source/particles/management/include/G4ParticleTable.icc
T
2016-06-08 16:57:27 +02:00

148 lines
4.0 KiB
Plaintext

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4ParticleTable.icc,v 1.8 2001/07/11 10:01:58 gunter Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// ------------------------------------------------------------
// implement new version for using STL map instaed of RW PtrHashedDictionary
// 28 ct., 99 H.Kurashige
inline
const G4ShortLivedTable* G4ParticleTable::GetShortLivedTable()
{
return fShortLivedTable;
}
inline
const G4IonTable* G4ParticleTable::GetIonTable()
{
return fIonTable;
}
inline
void G4ParticleTable::SetVerboseLevel(G4int value )
{
verboseLevel = value;
}
inline
G4int G4ParticleTable::GetVerboseLevel() const
{
return verboseLevel;
}
inline
G4ParticleTable::G4PTblDictionary* G4ParticleTable::GetDictionary()
{
return fDictionary;
}
inline
G4ParticleTable::G4PTblDicIterator* G4ParticleTable::GetIterator()
{
return fIterator;
}
inline
const G4ParticleTable::G4PTblEncodingDictionary* G4ParticleTable::GetEncodingDictionary()
{
return fEncodingDictionary;
}
inline
const G4String& G4ParticleTable::GetKey(const G4ParticleDefinition *particle) const
{
return particle->GetParticleName();
}
inline
G4ParticleDefinition* G4ParticleTable::FindParticle(const G4String &particle_name)
{
G4PTblDictionary::iterator it = fDictionary->find(particle_name);
if (it != fDictionary->end()) {
return (*it).second;
}else {
return 0;
}
}
inline
G4ParticleDefinition* G4ParticleTable::FindAntiParticle(G4int aPDGEncoding)
{
return FindParticle( FindParticle(aPDGEncoding)->GetAntiPDGEncoding() );
}
inline
G4ParticleDefinition* G4ParticleTable::FindAntiParticle(const G4String& particle_name)
{
G4int pcode = FindParticle(particle_name) -> GetAntiPDGEncoding();
return FindParticle(pcode);
}
inline
G4ParticleDefinition* G4ParticleTable::FindAntiParticle(const G4ParticleDefinition *particle)
{
G4int pcode = particle -> GetAntiPDGEncoding();
return FindParticle(pcode);
}
inline
G4bool G4ParticleTable::contains(const G4String& particle_name)
{
G4PTblDictionary::iterator it = fDictionary->find(particle_name);
return (it != fDictionary->end());
}
inline
G4bool G4ParticleTable::contains(const G4ParticleDefinition *particle)
{
return contains(GetKey(particle));
}
inline
const G4String& G4ParticleTable::GetParticleName(G4int index)
{
G4ParticleDefinition* aParticle =GetParticle(index);
if (aParticle != 0) {
return aParticle->GetParticleName();
} else {
return noName;
}
}
inline
G4int G4ParticleTable::entries() const
{
return fDictionary->size();
}
inline
G4int G4ParticleTable::size() const
{
return fDictionary->size();
}