Files
geant4/source/particles/management/include/G4ParticleTable.icc
T
2016-06-09 14:55:03 +02:00

163 lines
4.4 KiB
Plaintext

//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ParticleTable.icc,v 1.10 2006/06/29 19:24:34 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// ------------------------------------------------------------
// 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();
}
inline
void G4ParticleTable::SetReadiness()
{
readyToUse = true;
}
inline
G4bool G4ParticleTable::GetReadiness() const
{
return readyToUse;
}