/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 | Static Public Attributes | Static Private Attributes
GenDecay::chain::G4DataChain Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def getIsotope
def chain

Public Attributes

 corrTime
 subChain
 groundStates
 head

Static Public Attributes

float energyPrecision = 0.01

Static Private Attributes

dictionary _isotopes = {}

Detailed Description

Definition at line 9 of file chain.py.


Constructor & Destructor Documentation

def GenDecay::chain::G4DataChain::__init__ (   self,
  z,
  a,
  correlation_time = None 
)
Build a decay chain starting from the given (ground state)
nuclide with Z and A.  If a correlation time is given it will
be used to separate the chain into sub-chains that start at
nuclides with half lives greater than the correlation time.

Definition at line 20 of file chain.py.

00021                                                   :
00022         ''' Build a decay chain starting from the given (ground state)
00023         nuclide with Z and A.  If a correlation time is given it will
00024         be used to separate the chain into sub-chains that start at
00025         nuclides with half lives greater than the correlation time.'''
00026 
00027         self.corrTime = correlation_time
00028         
00029         self.subChain = []
00030         self.groundStates = []
00031         self.head = self.chain(z,a)
00032         return


Member Function Documentation

def GenDecay::chain::G4DataChain::__str__ (   self)

Definition at line 33 of file chain.py.

00034                      :
00035         return str(self.head)

def GenDecay::chain::G4DataChain::getIsotope (   self,
  z,
  a,
  nucexenergy 
)

Definition at line 36 of file chain.py.

00037                                         :
00038         'Retrieve isotope, return (iso,BOOL), BOOL is True if iso is freshly constructed'
00039 
00040         from data import Isotope
00041 
00042         try:
00043             isos = G4DataChain._isotopes[(z,a)]
00044         except KeyError:
00045             iso = Isotope(z,a,level=nucexenergy)
00046             G4DataChain._isotopes[(z,a)] = [iso]
00047             #print 'Making first seen: %s'%iso
00048             return iso,True
00049 
00050         for iso in isos:
00051             import math
00052             if math.fabs(nucexenergy - iso.level) <= G4DataChain.energyPrecision*nucexenergy:
00053                 #print 'Found in cache: %s'%iso
00054                 return iso,False # cache hit
00055             continue
00056 
00057         # found cached isotopes but wrong energy level
00058         iso = Isotope(z,a,level=nucexenergy)
00059         G4DataChain._isotopes[(z,a)].append(iso)
00060         assert len(G4DataChain._isotopes[(z,a)]) > 1
00061         #print 'In cache, new energy: %s'%iso
00062         return iso,True
00063         

def GenDecay::chain::G4DataChain::chain (   self,
  z,
  a,
  nucexenergy = 0.0 
)

Definition at line 64 of file chain.py.

00065                                          :
00066         'Return Isotope coresponding to given inputs'
00067         import math, decay
00068         from data import units, Transition
00069 
00070         iso,new = self.getIsotope(z,a,nucexenergy)
00071         
00072         if new and nucexenergy == 0.0: self.groundStates.append(iso)
00073         
00074         if not new:                  # been there, done that
00075             #print "Already chained: %s"%iso
00076             return iso
00077         #print 'Chaining: %s'%iso
00078 
00079         # If nucleous is excited, deal with it promptly
00080         if nucexenergy > G4DataChain.energyPrecision*units.keV:
00081             daughter = self.chain(z,a)
00082             tran = Transition(iso,daughter,decay.GammaDecay(nucexenergy))
00083             return iso
00084 
00085         try:
00086             rd = G4RadData()
00087             nuc = rd.nuclideData(z,a)
00088         except ValueError,err:
00089             print 'No data for z=%d, a=%d, assuming stable (%s)'%(z,a,err)
00090             return iso
00091 
00092         state = nuc.excitedState(nucexenergy)
00093         if state is None: 
00094             print 'No excited state for z=%d, a=%d, E = %f, assuming stable'%(z,a,nucexenergy)
00095             return iso
00096         iso.halflife = state.halflife
00097         if new and iso.halflife > self.corrTime:
00098             self.subChain.append(iso)
00099 
00100         for dk in state.decays:
00101             daughter = self.chain(dk.daughterZ,dk.daughterA,dk.daughterExcitation)
00102             tran = Transition(iso,daughter,dk.radiation,fraction=dk.fraction)
00103 
00104         return iso


Member Data Documentation

dictionary GenDecay::chain::G4DataChain::_isotopes = {} [static, private]

Definition at line 14 of file chain.py.

Definition at line 18 of file chain.py.

Definition at line 23 of file chain.py.

Definition at line 23 of file chain.py.

Definition at line 23 of file chain.py.

Definition at line 23 of file chain.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