/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
GenDecay::g4data::NuclideData Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def excitedState
def load

Public Attributes

 Z
 A
 states
 name

Detailed Description

Definition at line 59 of file g4data.py.


Constructor & Destructor Documentation

def GenDecay::g4data::NuclideData::__init__ (   self,
  z,
  a 
)
Create data for given Z and A

Definition at line 62 of file g4data.py.

00063                           :
00064         '''Create data for given Z and A'''
00065         self.Z = z
00066         self.A = a
00067         self.states = []
00068         self.name = '%d%s'%(self.A,elements.symbol(self.Z))
00069         self.load()
00070         return


Member Function Documentation

def GenDecay::g4data::NuclideData::__str__ (   self)

Definition at line 71 of file g4data.py.

00072                      :
00073         ret = ['z%d.a%d %s %d excited state(s):'%(self.Z,self.A,self.name,len(self.states))]
00074         for s in self.states:
00075             ret.append(str(s))
00076             continue
00077         return '\n'.join(ret)

def GenDecay::g4data::NuclideData::excitedState (   self,
  nucexenergy = 0.0 
)
Return state with given excitation energy

Definition at line 78 of file g4data.py.

00079                                             :
00080         '''Return state with given excitation energy'''
00081         for s in self.states:
00082             if nucexenergy == s.excitation: return s
00083             continue
00084         return None

def GenDecay::g4data::NuclideData::load (   self)

Definition at line 85 of file g4data.py.

00086                   :
00087         import os
00088         dir = os.getenv('G4RADIOACTIVEDATA')
00089         if dir is None:
00090             raise EnvironmentError,'No G4RADIOACTIVEDATA variable, can not find data for Z=%d, A=%d'%(self.Z,self.A)
00091         file = dir + '/z%d.a%d'%(self.Z,self.A)
00092         file = open(file)
00093         types_seen = {}
00094         for line in file.readlines():
00095             line = line.strip()
00096             #print line
00097 
00098             # skip comments
00099             if line[0] == '#': continue
00100 
00101             # parent
00102             if line[0] == 'P':
00103                 self.states.append(NuclideState(self.name))
00104                 types_seen = {}
00105                 p,ex,hl = line.split()
00106                 self.states[-1].excitation = float(ex)
00107                 self.states[-1].halflife = float(hl)*units.second
00108                 continue
00109 
00110             # warning
00111             if line[0] == 'W':
00112                 #print line
00113                 continue
00114                 
00115             # now parsing data
00116             chunks = line.split()
00117 
00118             # skip first total BR for type
00119             if not types_seen.has_key(chunks[0]):
00120                 types_seen[chunks[0]] = float(chunks[2])
00121                 continue
00122 
00123             dk = NuclideDecay(chunks[0],float(chunks[2])/100.0,
00124                               float(chunks[3])*units.keV,float(chunks[1])*units.keV)
00125             import decay
00126             if dk.type == 'Alpha':
00127                 dk.daughterZ = self.Z - 2
00128                 dk.daughterA = self.A - 4
00129                 dk.radiation = decay.AlphaDecay(dk.qvalue,self.Z)
00130             elif dk.type == 'BetaMinus':
00131                 dk.daughterZ = self.Z + 1
00132                 dk.daughterA = self.A
00133                 dk.radiation = decay.BetaDecay(dk.qvalue,self.Z)
00134             elif dk.type == 'BetaPlus':
00135                 dk.daughterZ = self.Z - 1
00136                 dk.daughterA = self.A
00137                 dk.radiation = decay.BetaDecay(dk.qvalue,-1*self.Z)
00138             else:
00139                 print 'Warning - not yet supported decay type: %s'%dk.type
00140                 continue
00141 
00142             self.states[-1].decays.append(dk)
00143             continue
00144         return


Member Data Documentation

Definition at line 62 of file g4data.py.

Definition at line 62 of file g4data.py.

Definition at line 62 of file g4data.py.

Definition at line 62 of file g4data.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:21:06 for GenDecay by doxygen 1.7.4