PyNE C++
Classes | Variables
pyne::particle Namespace Reference

Converts betweeen naming/numbering conventions for particle types. More...

Classes

class  NotAParticle
 Custom excpeption for failed particle types. More...
 

Functions

is_hydrogen functions

map of name to geant4 string

Returns whether or not the given particle is hydrogen or not, for example, Protons (Hydrogen) are both valid nucids and fundamental pdc types, all the following identify as hydrogen, Proton, Hydrogen, Protium, "H1", "1H", 100001000, PDC(2212)

Parameters
nInteger PDC number or nucid
sString valid particle name, altname or nucid
bool is_hydrogen (int n)
 
bool is_hydrogen (char *s)
 
bool is_hydrogen (std::string s)
 
is_heavy_ion functions

Returns whether or not the given particle is a heavy ion or not. Heavy ions are not covered by the PDC scheme, therefore the pyne::nucname class is used.

Parameters
nInteger PDC number or nucid
sString valid particle name, altname or nucid
bool is_heavy_ion (int s)
 
bool is_heavy_ion (char *s)
 
bool is_heavy_ion (std::string s)
 
is_valid functions

Returns whether or not the the given particle is a valid particle in the PyNE particle class. All PDC numbers, names, altnames nucnames are valid particle types

Parameters
nInteger PDC number or nucid
sString valid particle name, altname or nucid
bool is_valid (int n)
 
bool is_valid (char *s)
 
bool is_valid (std::string s)
 
pdc_number functions

Returns the PDC number of the particle given, if a valid pdc particle, will return the number, for heavy ions will return 0.

Parameters
nInteger PDC number or nucid
sString valid particle name, altname or nucid
int id (int n)
 
int id (char *s)
 
int id (std::string s)
 
name functions

Returns the pyne::particle name of the particle given, if a valid pdc particle number, name or nucname. Raises exception if not a valid name

Parameters
nInteger PDC number or nucid
sString valid particle name, altname or nucid
std::string name (int s)
 
std::string name (char *s)
 
std::string name (std::string s)
 
mcnp functions

Returns the mcnp string of a valid pyne::particle name

Parameters
sint, char*, String valid particle name, altname or nucid
std::string mcnp (int s)
 
std::string mcnp (char *s)
 
std::string mcnp (std::string s)
 
mcnp6 functions

Returns the mcnp6 string of a valid pyne::particle name

Parameters
sint, char*, String valid particle name, altname or nucid
std::string mcnp6 (int s)
 
std::string mcnp6 (char *s)
 
std::string mcnp6 (std::string s)
 
fluka functions

Returns the Fluka string of a valid pyne::particle name, or heavy ion

Parameters
sint, char*, String valid particle name, altname or nucid
std::string fluka (int s)
 
std::string fluka (char *s)
 
std::string fluka (std::string s)
 
geant4 functions

Returns the Geant4 string of a valid pyne::particle name, or heavy ion

Parameters
sint, char*, String valid particle name, altname or nucid
std::string geant4 (int s)
 
std::string geant4 (char *s)
 
std::string geant4 (std::string s)
 

Variables

int _pdcids [NUM_PARTICLES]
 
std::string _docs [NUM_PARTICLES]
 set of Particle Data Centre integer id numbers
 
std::string _names [NUM_PARTICLES]
 set of doc strings that describe the particle types
 
std::set< std::string > names
 set of name strings that are the particle types
 
std::set< int > pdc_nums
 set of valid names
 
std::map< std::string, int > name_id
 set of valid pdc numbers
 
std::map< int, std::string > id_name
 map of name to pdc number
 
std::map< std::string, std::string > docs
 map of pdc number to name
 
std::map< std::string, int > altnames
 map of name to doc string
 
std::map< std::string, std::string > part_to_mcnp
 map of alternative name to pdc number
 
std::map< std::string, std::string > part_to_mcnp6
 map of name to mcnp string
 
std::map< std::string, std::string > part_to_fluka
 map of name to mcnp6 string
 
std::map< std::string, std::string > part_to_geant4
 map of name to fluka string
 

describe functions

Returns a long string that describes the particle, if given a valid particle name, otherwise raises exception

Parameters
nInteger PDC number or nucid
sString valid particle name, altname or nucid
void * filler = pyne::particle::_fill_maps()
 A dummy variable used when calling _fill_maps().
 
std::string describe (int s)
 
std::string describe (char *s)
 
std::string describe (std::string s)
 
void * _fill_maps ()
 A helper function to set the contents of the variables in this library.
 

Detailed Description

Converts betweeen naming/numbering conventions for particle types.