/search.css" rel="stylesheet" type="text/css"/> /search.js">
Namespaces | |
namespace | beta |
namespace | chain |
namespace | data |
namespace | decay |
namespace | elements |
namespace | g4data |
namespace | Helpers |
namespace | Histogram |
namespace | pdfrand |
namespace | test_foo |
namespace | test_rand |
namespace | u238 |
Classes | |
class | DecayRates |
Visit the chain, calculate mean and total rates given abundances and collect correlated decays. More... | |
struct | NucDecay |
class | NucState |
class | NucVisitor |
class | Radiation |
class | AlphaRadiation |
class | BetaRadiation |
class | GammaRadiation |
class | ElectronCapture |
Typedefs | |
typedef std::map< std::pair < NucState *, NucState * > , std::vector< NucDecay * > > | NucDecayMap_t |
Map mother,daughter to the decays that joins them. | |
Enumerations | |
enum | RadiationType { Unknown = 0, Alpha, BetaMinus, BetaPlus, Gamma, EleCapture } |
Functions | |
double | more_to_clhep_time (double more_time) |
double | more_to_clhep_energy (double more_energy) |
bool | get_nucleus (const more::phys::nucleus &pn, more::phys::ens::nucleus &en) |
Fill out a ens::nucleus given the phys::nucleus, return true if no error. | |
NucState * | get_state (const more::phys::nucleus &n, more::phys::ens::confiv_t hl=more::phys::ens::confiv_t(0.0, 0.0), more::phys::ens::confiv_t rel=more::phys::ens::confiv_t(0.0, 0.0), int ref=0.0) |
Return the state coresponding to given phys::nucleus, half life, relative energy and reference energy. | |
NucState * | get_ground (std::string name) |
Get a ground state by name (eg "U-238") | |
NucState * | get_ground (more::phys::nucleus nucl) |
Return the NucState for the given nucleus that is at the ground state. | |
void | chain (NucState *mother, int depth=-1, more::phys::nucleus stop_nuc=more::phys::nucleus()) |
Form decay chain starting from given mother state. | |
const NucDecayMap_t & | get_decays () |
Get all decays that have been chained so far. | |
const Radiation * | decay_radiation (const NucDecay &dk) |
Make a radiation object for given decay. | |
void | dump_dataset (const more::phys::ens::dataset &ds) |
Dump dataset on our terms. | |
std::map< NucDecay *, int > | getChainMap () |
Variables | |
list | __all__ = ['GenDecayConf','Helpers','Histogram'] |
typedef std::map<std::pair<NucState*,NucState*>,std::vector<NucDecay*> > GenDecay::NucDecayMap_t |
Definition at line 24 of file Radiation.h.
double GenDecay::more_to_clhep_time | ( | double | more_time | ) |
Definition at line 16 of file NucUtil.cc.
{
return more_time * CLHEP::second / SI::s;
}
double GenDecay::more_to_clhep_energy | ( | double | more_energy | ) |
Definition at line 20 of file NucUtil.cc.
{
return more_energy * CLHEP::MeV / SI::MeV;
}
bool GenDecay::get_nucleus | ( | const more::phys::nucleus & | pn, |
more::phys::ens::nucleus & | en | ||
) |
Fill out a ens::nucleus given the phys::nucleus, return true if no error.
Definition at line 40 of file NucUtil.cc.
{ static NucNucMap_t nucnuc; ens::nucleus out = nucnuc[pn]; if (out.has_dataset()) { en = out; return true; } try { out = pn; } catch (std::runtime_error) { cerr << "Caught run time error when assigning nucleus: \"" << pn << "\"" << endl; cerr << "Is the fetcher used a few lines above the correct one?\n" << "Maybe you need to set MORE_PHYS_FETCHER to point to the fetcher script?\n"; return false; } en = out; nucnuc[pn] = out; return true; }
NucState* GenDecay::get_state | ( | const more::phys::nucleus & | n, |
more::phys::ens::confiv_t | hl = more::phys::ens::confiv_t(0.0, 0.0) , |
||
more::phys::ens::confiv_t | rel = more::phys::ens::confiv_t(0.0, 0.0) , |
||
int | ref = 0.0 |
||
) |
Return the state coresponding to given phys::nucleus, half life, relative energy and reference energy.
NucState * GenDecay::get_ground | ( | std::string | name | ) |
Get a ground state by name (eg "U-238")
Definition at line 975 of file NucUtil.cc.
{ istringstream iss(name); phys::nucleus nucl; iss >> nucl; return get_ground(nucl); }
NucState* GenDecay::get_ground | ( | more::phys::nucleus | nucl | ) |
Return the NucState for the given nucleus that is at the ground state.
void GenDecay::chain | ( | NucState * | mother, |
int | depth = -1 , |
||
more::phys::nucleus | stop_nuc = more::phys::nucleus() |
||
) |
Form decay chain starting from given mother state.
If depth is non-negative, do not chain further down than that many daughters. If stop_nuc is given, do not chain beyond its ground state.
Definition at line 905 of file NucUtil.cc.
{ // record if a NucState has been chained yet typedef map<NucState*,int> NucChained_t; static NucChained_t chained; if (!mother) { cerr << "ERROR: chain given null mother\n"; return; } if (!depth) { //cerr << "Reached target depth with " << *mother << endl; return; } --depth; //cerr << "Mother nuc: " << mother->nuc() // << " stop_nuc: " << stop_nuc << endl; if (mother->energy() == 0.0 && mother->eref() == 0 && mother->nuc() == stop_nuc) { cerr << "Reached ground state stop_nuc = " << stop_nuc << endl; return; } // Don't chain a state that has already been seen if (chained[mother]) return; chained[mother] = 1; //cerr << "Chaining " << *mother << "(@" << (void*)mother << ") at depth "<<depth<<"\n"; // load mother ens::nucleus pnucl; if (!get_nucleus(mother->nuc(),pnucl)) { cerr << "Got run time error with " << mother->nuc() << endl; } vector<NucState*> daughters; // look for daughters for (int ind=0; get_xxx_daughters[ind]; ++ind) { vector<NucState*> ds = get_xxx_daughters[ind](mother); //cerr << *mother << " has " << ds.size() // << " daughters made by " << decay_names[ind] << endl; daughters.insert(daughters.end(),ds.begin(),ds.end()); } normalize_branching_fractions(*mother); for (int ind = 0; ind < mother->ndecays(); ++ind) { chainMap[mother->decay(ind)] = 0; mother->decay(ind)->daughter->origin_decays().push_back(mother->decay(ind)); } //cerr << *mother << " has these daughters:\n"; //for (size_t ind=0; ind < daughters.size(); ++ind) { // cerr << "\t" << *daughters[ind] << endl; //} for (int inuc=0; inuc < mother->ndecays(); ++inuc) { NucState* dau = mother->decay(inuc)->daughter; chain(dau,depth,stop_nuc); } }
const NucDecayMap_t & GenDecay::get_decays | ( | ) |
Get all decays that have been chained so far.
Definition at line 160 of file NucUtil.cc.
{ return gsNucDecays; }
Make a radiation object for given decay.
Definition at line 1009 of file NucUtil.cc.
{ static map<const NucDecay*, Radiation*> radCache; Radiation* rad = radCache[&dk]; if (rad) return rad; int parentZ = dk.mother->nuc().n_prot(); int parentA = dk.mother->nuc().n_part(); if (dk.type == "A DECAY") { rad = new AlphaRadiation(dk.clhep_energy(), parentA); } if (dk.type == "Gamma") { rad = new GammaRadiation(dk.clhep_energy()); } if (dk.type == "IT DECAY") { rad = new GammaRadiation(dk.clhep_energy()); } if (dk.type == "B- DECAY") { rad = new BetaRadiation(dk.clhep_energy(), parentZ); } if (dk.type == "B+ DECAY") { rad = new BetaRadiation(dk.clhep_energy(), -1*parentZ); } if (dk.type == "EC DECAY") { rad = new ElectronCapture(dk.clhep_energy()); } if (!rad) { cerr << "decay_radiation: failed to make radiation from \"" << dk << "\"\n"; return 0; } radCache[&dk] = rad; return rad; }
void GenDecay::dump_dataset | ( | const more::phys::ens::dataset & | ds | ) |
Dump dataset on our terms.
Can also use ds.dump(cout) to use built-in dumper.
std::map< NucDecay *, int > GenDecay::getChainMap | ( | ) |
Definition at line 898 of file NucUtil.cc.
{ return chainMap; }
list GenDecay::__all__ = ['GenDecayConf','Helpers','Histogram'] |
Definition at line 3 of file __init__.py.