| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

GenDecay::data::PrettyPrint Class Reference

List of all members.

Public Member Functions

def __init__
def tab
def __str__

Public Attributes

 iso
 depth

Static Private Attributes

string _tab = ' '

Detailed Description

Definition at line 130 of file data.py.


Member Function Documentation

def GenDecay::data::PrettyPrint::__init__ (   self,
  iso,
  depth = 0 
)

Definition at line 134 of file data.py.

00134                                   :
00135         self.iso = iso
00136         self.depth = depth
00137         return
00138 
    def tab(self): return PrettyPrint._tab*self.depth

def GenDecay::data::PrettyPrint::tab (   self  ) 

Definition at line 139 of file data.py.

00139                  : return PrettyPrint._tab*self.depth
00140 

def GenDecay::data::PrettyPrint::__str__ (   self  ) 

Definition at line 141 of file data.py.

00141                      :
00142         import decay
00143         ret = [self.tab()+str(self.iso)]
00144 
00145         iso2process = []
00146         for t in self.iso.transitions: # assume only be non-GammaDecay
00147 
00148             # Add this transition
00149             #print self.tab()+str(t)
00150             ret.append(self.tab()+str(t))
00151 
00152             # if daughter not stable
00153             if t.final.transitions: 
00154                 ft = t.final.transitions[0] 
00155                 # and if daugther decays by gamma
00156                 if type(ft.radiation) == decay.GammaDecay: 
00157                     # save string rep and ground state for later processing
00158                     ret.append(self.tab()+PrettyPrint._tab+str(ft))
00159                     if not ft.final in iso2process:
00160                         iso2process.append(ft.final)
00161                     continue
00162 
00163             # otherwise, save for recursion
00164             if not t.final in iso2process: 
00165                 iso2process.append(t.final)
00166             continue
00167         for iso in iso2process:
00168             pp = PrettyPrint(iso,self.depth+1)
00169             ret.append(str(pp))
00170 
00171         return '\n'.join(ret)
00172                        
00173 
00174 
if __name__ == '__main__':


Member Data Documentation

string GenDecay::data::PrettyPrint::_tab = ' ' [static, private]

Definition at line 132 of file data.py.

GenDecay::data::PrettyPrint::iso

Definition at line 135 of file data.py.

GenDecay::data::PrettyPrint::depth

Definition at line 136 of file data.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 Mon Apr 11 21:01:10 2011 for GenDecay by doxygen 1.4.7