/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 | Private Member Functions
GenDecay::decay::BetaDecay Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def energy
def sampleEnergy
def dnde
def dnde_noff
def fermi_function

Public Attributes

 qvalue
 kine
 doff
 onlyff
 parentZ
 daughterZ
 betaSign
 endpoint
 norm
 maximum

Private Member Functions

def _normalize

Detailed Description

Nuclear decay by beta emission

Definition at line 24 of file decay.py.


Constructor & Destructor Documentation

def GenDecay::decay::BetaDecay::__init__ (   self,
  qvalue,
  parentZ 
)

Definition at line 27 of file decay.py.

00028                                      :
00029         'Create a beta decay of the given qvalue and parentZ'
00030         self.qvalue = float(qvalue)
00031         self.kine = None
00032         self.doff = True        # for testing w/out fermi function
00033         self.onlyff = False     # for testing w/only fermi function
00034 
00035         if parentZ < 0:         # beta+ decay
00036             self.parentZ = -parentZ
00037             self.daughterZ = self.parentZ - 1
00038             self.betaSign = +1
00039             self.endpoint = self.qvalue - 2.0*units.electron_mass_c2
00040         else:                   # beta- decay
00041             self.parentZ = parentZ
00042             self.daughterZ = self.parentZ + 1
00043             self.betaSign = -1
00044             self.endpoint = self.qvalue
00045 
00046         self._normalize()
        return

Member Function Documentation

def GenDecay::decay::BetaDecay::_normalize (   self) [private]

Definition at line 47 of file decay.py.

00048                         :
00049         steps = 1000
00050         dx = self.endpoint/steps
00051         lo = dx/2.0
00052         self.norm = 1.0
00053         self.norm = sum([self.dnde(i*dx+lo)*dx for i in range(steps)])
00054         self.maximum = max([self.dnde(i*dx+lo) for i in range(steps)])
00055         #print 'norm=%f max=%f %s'%(self.norm,self.maximum,self)
00056         return

def GenDecay::decay::BetaDecay::__str__ (   self)

Definition at line 57 of file decay.py.

00058                      :
00059         pm = '+'
00060         if self.betaSign < 0: pm = '-'
00061         return 'beta%s: Z=%d(->%d) Q=%.3f MeV'%(pm,self.parentZ,self.daughterZ,self.qvalue/units.MeV)

def GenDecay::decay::BetaDecay::energy (   self)

Definition at line 62 of file decay.py.

00063                     :
00064         if self.kine is None:
00065             self.kine = self.sampleEnergy()
00066         return self.kine

def GenDecay::decay::BetaDecay::sampleEnergy (   self)

Definition at line 67 of file decay.py.

00068                           :
00069         from random import Random
00070         u = Random().uniform
00071         while True:
00072             T = u(0.0,self.endpoint)
00073             P = u(0.0,self.maximum)
00074             dnde = self.dnde(T)
00075             assert(type(T) is float)
00076             assert(type(P) is float)
00077             assert(type(dnde) is float)
00078             if P <= dnde: return T
00079             continue
00080         return None

def GenDecay::decay::BetaDecay::dnde (   self,
  T 
)

Definition at line 81 of file decay.py.

00082                     :
00083         if T > self.endpoint: return 0.0
00084         if T < 0.0: return 0.0
00085 
00086         if self.onlyff:
00087             ret = self.fermi_function(T)
00088         else:
00089             ret = self.dnde_noff(T)
00090             if self.doff: ret *= self.fermi_function(T)
00091         return ret/self.norm

def GenDecay::decay::BetaDecay::dnde_noff (   self,
  T 
)
Return the unormalized dN/dE at the given beta kinetic
energy and ignoring nuclear Coulomb field

Definition at line 92 of file decay.py.

00093                          :
00094         '''Return the unormalized dN/dE at the given beta kinetic
00095         energy and ignoring nuclear Coulomb field'''
00096         import math
00097         W = self.endpoint/units.electron_mass_c2 + 1.0
00098         E = T/units.electron_mass_c2 + 1.0
00099         return math.sqrt(E**2-1.0) * (W-E)**2 * E
        
def GenDecay::decay::BetaDecay::fermi_function (   self,
  T 
)

Definition at line 100 of file decay.py.

00101                               :
00102         "Return the unormalized Fermi function value for given kinetic energy"
00103         import math
00104         E = T/units.electron_mass_c2 + 1.0
00105         P = math.sqrt(E*E-1.0)
00106         U = -1*self.betaSign*self.daughterZ/137.0
00107         S = math.sqrt(1.0 - U*U) - 1.0
00108         Y = 2.0*math.pi*U*E/P
00109         A1 = U*U * E*E + P*P/4.0
00110         A2 = math.fabs(Y/(1.0-math.exp(-Y)))
00111         return math.pow(A1,S)*A2


Member Data Documentation

Definition at line 27 of file decay.py.

Definition at line 27 of file decay.py.

Definition at line 27 of file decay.py.

Definition at line 27 of file decay.py.

Definition at line 27 of file decay.py.

Definition at line 27 of file decay.py.

Definition at line 27 of file decay.py.

Definition at line 27 of file decay.py.

Definition at line 47 of file decay.py.

Definition at line 47 of file decay.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