/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
gen::RadSlab Class Reference

List of all members.

Public Member Functions

def __init__
def logical_slabs
def rad_slab_pos_xyz
def logical_volumes
def detector_elements
def get_param_header
def get_parameters
def parameters_file
def geometry_file
def structure_file

Detailed Description

Produce radiation slabs between the enlarged HallBot and the dead water.

Produce logical volume (assemblies) 

lvNearHallRadSlabs  - 8+1 slabs around/under the near pool
lvFarHallRadSlabs   - 8+1 slabs around/under the far pool

Produce catalog RadSlabs holding detector elements

{db,la,far}-radslab[1-9]

Definition at line 12 of file gen.py.


Constructor & Destructor Documentation

def gen::RadSlab::__init__ (   self)

Definition at line 26 of file gen.py.

00027                       :
00028         return


Member Function Documentation

def gen::RadSlab::logical_slabs (   self)
Return a list of slabs as:
[('Near',[1-9]), ('Far',[1-9])] with numbers meaning:
  _3_      
4/   \2    
       5| [9] |1
6\___/8
   7   

Definition at line 29 of file gen.py.

00030                            :
00031         '''
00032         Return a list of slabs as:
00033         [('Near',[1-9]), ('Far',[1-9])] with numbers meaning:
00034           _3_      
00035         4/   \2    
00036        5| [9] |1
00037         6\___/8
00038            7   
00039         '''
00040 
00041         wall_lengths = [ 
00042             # corners (2,4,6,8), type=0
00043             'PoolDeadBevelSize', 
00044             # 'short' walls (1,5), type=1
00045             '%(nf)sHallBotSizeY-sqrt(2)*PoolDeadBevelSize',
00046             # 'long' walls (3,7), type=2
00047             '%(nf)sHallBotSizeX-sqrt(2)*PoolDeadBevelSize',
00048             ]
00049 
00050         wall_slabs = []         # [[near: 1-8,9],[far: 1-8,9]]
00051         for nf in ['Near','Far']:
00052 
00053             slabs = []
00054 
00055             # The wall slabs
00056             for ind,wall_type in enumerate([1,0,2,0,1,0,2,0]):
00057                 wnum = ind+1
00058                 wlen = wall_lengths[wall_type] % {'nf':nf}
00059                 shape = Box('%s-radslab-box-%d' % (nf.lower(), wnum),
00060                             'RadSlabThickness',wlen, 'HallBotSizeZ')
00061                 lv = Logvol('lv%sRadSlab%d' % (nf, wnum),
00062                             'RadRock', shape)
00063                 slabs.append(lv)
00064                 continue
00065 
00066             secondaries = []
00067             
00068             # The subtractions for the bottom slab
00069             for ind,pm in enumerate([('',''),('','-'),('-',''),('-','-')]):
00070                 # shape,pos,rot
00071                 bs = BooleanSecondary(
00072                     Box('%s-radslab-box-9-sub%d' % (nf.lower(),ind),
00073                         'PoolDeadBevelSize','PoolDeadBevelSize','RadSlabThickness+1*cm'),
00074                     PosXYZ('%s0.5*%sPoolDeadSizeX' % (pm[0],nf),
00075                            '%s0.5*%sPoolDeadSizeY' % (pm[1],nf),
00076                            '0*m'),
00077                     RotXYZ(rotZ="45*degree")
00078                     )
00079                 secondaries.append(bs)
00080                 continue
00081 
00082             # Basic box for the bottom slab
00083             botshape = Boolean('subtraction','%s-radslab-box-9'%nf.lower(),
00084                                Box('%s-radslab-box-9-box' % nf.lower(),
00085                                    '%sHallBotSizeX' % nf,
00086                                    '%sHallBotSizeY' % nf,
00087                                    'RadSlabThickness'),
00088                                secondaries)
00089             lv = Logvol('lv%sRadSlab9' % nf, 'RadRock', botshape)
00090             slabs.append(lv)
00091 
00092             wall_slabs.append((nf,slabs))
00093             continue
00094         return wall_slabs

def gen::RadSlab::rad_slab_pos_xyz (   self,
  nf,
  wind 
)

Definition at line 95 of file gen.py.

00096                                       :
00097         'Return a PosXYZ for the given wall index in [1-8]'
00098         rec = '%s0.5*(%sHallBotSize%s + RadSlabThickness)'
00099         bev = '%s0.5*(%sHallBotSize%s - 0.5*sqrt(2)*(PoolDeadBevelSize-RadSlabThickness))'
00100         x = [None,
00101              rec % ('+', nf, 'X'),
00102              bev % ('+', nf, 'X'),
00103              '0*m',
00104              bev % ('-', nf, 'X'),
00105              rec % ('-', nf, 'X'),
00106              bev % ('-', nf, 'X'),
00107              '0*m',
00108              bev % ('+', nf, 'X')
00109              ]
00110         y = [None,
00111              '0*m',
00112              bev % ('+', nf, 'Y'),
00113              rec % ('+', nf, 'Y'),
00114              bev % ('+', nf, 'Y'),
00115              '0*m',
00116              bev % ('-', nf, 'Y'),
00117              rec % ('-', nf, 'Y'),
00118              bev % ('-', nf, 'Y'),
00119              ]
00120         return PosXYZ(x[wind],y[wind],'0*m')

def gen::RadSlab::logical_volumes (   self)
Build and return all rad slab logical volumes in the form: [[near],[far]]

Definition at line 121 of file gen.py.

00122                              :
00123         '''Build and return all rad slab logical volumes in the form: [[near],[far]]'''
00124         wall_slabs = self.logical_slabs()
00125 
00126         lvs = []
00127         for nf,slabs in wall_slabs:
00128             pvs = []
00129             # wall slab placements
00130             for ind in range(0,8):
00131                 deg = ind*45
00132                 wind = ind+1
00133                 pv = Physvol('pv%sHallRadSlab%d' % (nf,wind),
00134                              logvol = slabs[ind],
00135                              pos = self.rad_slab_pos_xyz(nf,wind),
00136                              rot = RotXYZ(rotZ='%s*degree'%deg))
00137                 pvs.append(pv)
00138                 continue
00139             # bottom slab placement
00140             pv = Physvol('pv%sHallRadSlab9' % nf,
00141                          logvol = slabs[8],
00142                          pos = PosXYZ(Z = '-0.5*(HallBotSizeZ+RadSlabThickness)'))
00143             pvs.append(pv)
00144             lv = Logvol('lv%sHallRadSlabs'%nf, None, None, physvols = pvs)
00145             lvs += slabs
00146             lvs.append(lv)
00147             continue
        return lvs
def gen::RadSlab::detector_elements (   self)
Return a list of detector elements for each slab

Definition at line 148 of file gen.py.

00149                                :
00150         '''
00151         Return a list of detector elements for each slab
00152         '''
00153         things = []
00154         for site in ['db','la','far']:
00155             nf = 'Near'
00156             nlf = 'Near'
00157             if site == 'la':
00158                 nlf= 'LA'
00159             if site == 'far': 
00160                 nf = 'Far'
00161                 nlf = 'Far'
00162             for slab in range(9):
00163                 slab += 1
00164                 the_npath='pv%sHallBot/pv%sHallRadSlabs/pv%sHallRadSlab%d' % \
00165                     (nlf, nf, nf, slab)
00166                 de = DetElem('%s-radslab%d' % (site,slab),
00167                              '/dd/Geometry/RadSlabs/lv%sRadSlab%d' % (nf,slab),
00168                              npath = the_npath,
00169                              support='/dd/Structure/Sites/%s-rock'%site)
00170                 things.append(de)
00171                 continue
00172             continue
00173         return things

def gen::RadSlab::get_param_header (   self)

Definition at line 174 of file gen.py.

00175                               :
00176 
00177         from XmlDetDescGen.util import Comment
00178         header = Comment('''
00179      Define parameters for the radioactive slabs.  
00180 
00181      They are parameterized only by their thickness.''')
00182         return header

def gen::RadSlab::get_parameters (   self)

Definition at line 183 of file gen.py.

00184                             :
00185         from XmlDetDescGen.parameter import Parameter
00186         ret = [Parameter('RadSlabThickness','30*cm',
00187                          'Radioactive Rock Slab Thickness'),]
00188         return ret

def gen::RadSlab::parameters_file (   self,
  filename 
)

Definition at line 189 of file gen.py.

00190                                       :
00191         from XmlDetDescGen.util import XmlFile
00192         objects = [self.get_param_header()]
00193         objects.extend(self.get_parameters())
00194         fp = XmlFile(objects=objects)
00195         fp.write(filename)
00196         return

def gen::RadSlab::geometry_file (   self,
  filename 
)
Spit out geometry files

Definition at line 197 of file gen.py.

00198                                     :
00199         '''
00200         Spit out geometry files
00201         '''
00202 
00203         topcat = Catalog("Geometry")
00204         rscat = Catalog('RadSlabs')
00205         topcat.refs = [ Reference("#RadSlabs", rscat) ]
00206         rscat.logvols = self.logical_volumes()
00207         #self.cat.things = self.detector_elements()
00208         topcat.update()
00209 
00210 
00211         print 'At print cat has %d logvols' % len(rscat.logvols)
00212 
00213         fp = XmlFile(dtd="../DTD/geometry.dtd",
00214                      objects=[\
00215                 ExternalEntity("RadSlabParameters"),
00216                 ExternalEntity("PoolParameters"),
00217                 ExternalEntity("SiteParameters"),
00218                 rscat],
00219                      external_entities=[\
00220                 ("RadSlabParameters","parameters.xml"),
00221                 ("PoolParameters","../Pool/parameters.xml"),
00222                 ("SiteParameters","../Sites/parameters.xml")])
00223 
00224         fp.write(filename)
00225         return

def gen::RadSlab::structure_file (   self,
  filename 
)
Write the structure to the given filename

Definition at line 226 of file gen.py.

00227                                      :
00228         '''
00229         Write the structure to the given filename
00230         '''
00231         topcat = Catalog("Structure")
00232         rscat = Catalog('RadSlabs')
00233         topcat.refs = [ Reference("#RadSlabs", rscat) ]
00234         rscat.things = self.detector_elements()
00235         topcat.update()
00236 
00237         fp = XmlFile(dtd = '../DTD/structure.dtd',
00238                      objects = [ rscat ])
00239         fp.write(filename)
00240         return


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 09:56:07 for XmlDetDesc by doxygen 1.7.4