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

List of all members.

Public Member Functions

def __init__
def geometry_catalog
def get_param_header
def get_pool_parameters
def parameters_file
def geometry_files
def thing_files
def detid
def structure_file

Public Attributes

 parameters_filename
 geometry_filename
 structure_filename
 pool_elements
 geometry_cat
 outdir

Detailed Description

Definition at line 359 of file gen.py.


Constructor & Destructor Documentation

def XmlDetDescGen::Pool::gen::Pool::__init__ (   self)

Definition at line 360 of file gen.py.

00361                       :
00362         self.parameters_filename="parameters.xml"
00363         self.geometry_filename="geometry.xml"
00364         self.structure_filename="structure.xml"
00365 
00366         hallbot = Element("HallBot","bottom of hall","Rock")
00367         dead = Element("Dead","dead space","DeadWater","84*mm",hallbot)
00368 #        liner = Element("Liner","tyvek liner","Tyvek","50*micrometer",dead)
00369         liner = Element("Liner","tyvek liner","Tyvek","4*mm",dead)
00370         ows = Element("OWS","outer water shield","OwsWater","1.0*m",liner)
00371 #        curtain = Element("Curtain","tyvek curtain","Tyvek","50*micrometer",ows)
00372         curtain = Element("Curtain","tyvek curtain","Tyvek","4*mm",ows)
00373         iws = Element("IWS","inner water shield","IwsWater","4.037*m",curtain)
00374 
00375         self.pool_elements = { "Dead":dead, "Liner":liner, "OWS":ows, "Curtain":curtain, "IWS":iws }
00376 
00377         #self.general_parameters = [
00378         #    Parameter("PoolLipHeight","0.2*m","Height of concrete lip around pool")
00379         #    ]
00380 
00381         self.geometry_cat = None
00382         self.outdir = "."
00383         return


Member Function Documentation

def XmlDetDescGen::Pool::gen::Pool::geometry_catalog (   self)

Definition at line 384 of file gen.py.

00385                               :
00386         if self.geometry_cat: return self.geometry_cat
00387 
00388         from XmlDetDescGen.catalog import Catalog
00389         from XmlDetDescGen.reference import Reference
00390 
00391         topcat = Catalog('Geometry');
00392         poolcat = Catalog('Pool');
00393 
00394         # This is fake, just to get the right /dd/Geometry path
00395         topcat.refs = [ Reference("#Pool",poolcat) ]
00396 
00397         for name in pool_element_names:
00398             ele = self.pool_elements[name]
00399             for site in ["Near","Far"]:
00400                 lv = ele.logical_volume(site)
00401                 poolcat.refs.append(Reference("%s.xml#%s"%(name,lv.name),lv))
00402                 continue
00403             continue
00404 
00405         # Important, needed so full_paths can be set
00406         topcat.update()
00407 
00408         self.geometry_cat = poolcat
00409         return poolcat
00410 

def XmlDetDescGen::Pool::gen::Pool::get_param_header (   self)

Definition at line 411 of file gen.py.

00412                               :
00413 
00414         from XmlDetDescGen.util import Comment
00415 
00416         s = []
00417         s.append('''
00418      Define the water pool.  This is done by subsequently placing
00419      these volumes inside the bootom of the hall and then placing each
00420      in the previous.
00421 ''')
00422         for thing in pool_element_names:
00423             s.append('    - %s'%thing)
00424             continue
00425         s.append('''
00426      Each of these elements are specified by their thickness relative
00427      to their parents and the assumptions that they are concentric in
00428      X and Y and are lifted by one thickness when placed so that all
00429      their tops are coplanar.  In addition, a bevel size is
00430      calculated.  This is used to subtract out the corners of the
00431      boxes to make octagonal shapes.  It is assumed that Z sizes are
00432      site-independent.
00433 
00434      This all results in parameters looking like:
00435 
00436      NearPool_THING_SizeX
00437      NearPool_THING_SizeY
00438       FarPool_THING_SizeX
00439       FarPool_THING_SizeY
00440          Pool_THING_SizeZ
00441          Pool_THING_LiftZ
00442          Pool_THING_BevelSize
00443 
00444      Where _THING_ is
00445 ''')
00446         for thing in pool_element_names:
00447             ele = self.pool_elements[thing]
00448             s.append('    %s - %s'%(ele.name,ele.nick))
00449             continue
00450         return Comment('\n'.join(s))

def XmlDetDescGen::Pool::gen::Pool::get_pool_parameters (   self)

Definition at line 451 of file gen.py.

00452                                  :
00453         from XmlDetDescGen.parameter import Parameter
00454         ret = [Parameter('TableHeight','2.5*m','Distance from pool floor to AD table'),
00455                Parameter("ADadeZplace",'TableHeight+0.5*ADadeHeight-0.5*PoolIWSSizeZ-PoolDeadThickness-PoolLinerThickness-PoolOWSThickness-PoolCurtainThickness','A position of AD adeelopes'),]
00456         
00457         for thing in pool_element_names:
00458             ele = self.pool_elements[thing]
00459             params = ele.parameters()
00460             p = params[ele.param_fullname('Thickness')]
00461             ret.append(p)
00462             continue
00463         for thing in pool_element_names:
00464             ele = self.pool_elements[thing]
00465             for name,param in ele.params.iteritems():
00466                 if name == ele.param_fullname('Thickness'):continue
00467                 ret.append(param)
00468                 continue
00469             continue
00470         return ret

def XmlDetDescGen::Pool::gen::Pool::parameters_file (   self)

Definition at line 471 of file gen.py.

00472                              :
00473         from XmlDetDescGen.util import XmlFile
00474         objects = [self.get_param_header()]
00475         objects.extend(self.get_pool_parameters())
00476         file = XmlFile(objects=objects)
00477         file.write(self.outdir+"/"+self.parameters_filename)
00478         return

def XmlDetDescGen::Pool::gen::Pool::geometry_files (   self)

Definition at line 479 of file gen.py.

00480                             :
00481         from XmlDetDescGen.util import XmlFile,ExternalEntity
00482         file = XmlFile(dtd="../DTD/geometry.dtd",
00483                        objects=[ExternalEntity("SiteParameters"),
00484                                 ExternalEntity("PoolParameters"),
00485                                 ExternalEntity("PoolDetailsParameters"),
00486                                 self.geometry_catalog()],
00487                        external_entities=[("SiteParameters","../Sites/parameters.xml"),("PoolDetailsParameters","../PoolDetails/parameters.xml"),
00488                                           ("PoolParameters","parameters.xml")])
00489         file.write(self.outdir+"/"+self.geometry_filename)
00490         return
00491 

def XmlDetDescGen::Pool::gen::Pool::thing_files (   self)

Definition at line 492 of file gen.py.

00493                          :
00494         from XmlDetDescGen.util import XmlFile,ExternalEntity
00495         for name in pool_element_names:
00496             ele = self.pool_elements[name]
00497 
00498             ees = [("SiteParameters","../Sites/parameters.xml"),("PoolDetailsParameters","../PoolDetails/parameters.xml"),
00499                    ("PoolParameters","parameters.xml"),
00500                    ("FarHandWrittenPhysVols","../PoolDetails/Far%sPhysVols.xml"%name),
00501                    ("NearHandWrittenPhysVols","../PoolDetails/Near%sPhysVols.xml"%name)]
00502 
00503             objects = [ExternalEntity("SiteParameters"),ExternalEntity("PoolDetailsParameters"),
00504                        ExternalEntity("PoolParameters")]
00505 
00506             if name == "IWS":
00507                 ees += [("ADParameters","../AD/parameters.xml")]
00508                 objects += [ExternalEntity("ADParameters")]
00509                 pass
00510 
00511             objects += [ele.logical_volume("Near"),
00512                         ele.logical_volume("Far")]
00513 
00514             file = XmlFile(dtd="../DTD/geometry.dtd",
00515                            objects=objects,
00516                            external_entities=ees)
00517             file.write("%s/%s.xml"%(self.outdir,name))
00518             continue
00519         return

def XmlDetDescGen::Pool::gen::Pool::detid (   self,
  loc,
  det 
)

Definition at line 520 of file gen.py.

00521                            :
00522         # All hard coded numbers from Conventions/DetectorId.h
00523         if loc.lower() == 'db':
00524             iloc = 0x01
00525         elif loc.lower() == 'la':
00526             iloc = 0x02
00527         elif loc.lower() == 'far':
00528             iloc = 0x04
00529         else:
00530             iloc = 0x00
00531         if det.lower() == 'iws':
00532             idet = 5
00533         elif det.lower() == 'ows':
00534             idet = 6
00535         else:
00536             idet = 0
00537         detid = ((iloc<<24)|(idet<<16))
00538         from XmlDetDescGen.structure import UserParameter
00539         return UserParameter("DetectorID","int", ['0x%x'%detid],
00540                              desc="Packed Detector ID")
00541 
00542 
        
def XmlDetDescGen::Pool::gen::Pool::structure_file (   self)

Definition at line 543 of file gen.py.

00544                             :
00545         from XmlDetDescGen.util import XmlFile,ExternalEntity
00546         from XmlDetDescGen.reference import Reference
00547         from XmlDetDescGen.structure import DetElem
00548         from XmlDetDescGen.catalog import Catalog
00549 
00550         ees = [ ("dbInnFinpmts", "../PoolPmtStructure/dbInnFin.xml"),
00551                 ("dbOutFinpmts", "../PoolPmtStructure/dbOutFin.xml"),
00552                 ("dbOutFoutpmts", "../PoolPmtStructure/dbOutFout.xml"),
00553                 ("laInnFinpmts", "../PoolPmtStructure/laInnFin.xml"),
00554                 ("laOutFinpmts", "../PoolPmtStructure/laOutFin.xml"),
00555                 ("laOutFoutpmts", "../PoolPmtStructure/laOutFout.xml"),
00556                 ("farInnFinpmts", "../PoolPmtStructure/farInnFin.xml"),
00557                 ("farOutFinpmts", "../PoolPmtStructure/farOutFin.xml"),
00558                 ("farOutFoutpmts", "../PoolPmtStructure/farOutFout.xml") 
00559                 ]
00560 
00561         file = XmlFile(dtd="../DTD/structure.dtd",
00562                        external_entities=ees)
00563 
00564         # To assure logical volume's full_path is set
00565         gc = self.geometry_catalog()
00566         gc.update()
00567 
00568         topcat = Catalog('Structure');
00569         poolcat = Catalog('Pool');
00570         # Clear our refs because some how this is filled with the
00571         # contents of the /Geometry/Pool catalog!  Python bug???
00572         poolcat.refs = []       
00573         topcat.refs = [ poolcat ]
00574 
00575         base = "/dd/Structure/Pool/"
00576 
00577         delist = {"DB":[],"LA":[],"Far":[]}
00578 
00579         last_support = "/dd/Structure/Sites/%(loc)s-rock"
00580 
00581         import sys
00582         print sys.argv[0],'Structuring for',style
00583 
00584         for (thing,npath) in pool_detelem_data:
00585             ele = self.pool_elements[thing]
00586             nf="Near"
00587             nlf="Near"
00588             if Eight: 
00589                 ADnumbers = [2,2,4]
00590             else:
00591                 ADnumbers = [1,1,3]
00592 
00593             for loc,adn in zip(["DB","LA","Far"], ADnumbers ):
00594                 if loc == "LA" : 
00595                     nlf = "LA"
00596                 if loc == "Far": 
00597                     nf = "Far"
00598                     nlf = "Far"
00599                 lv_name = '/dd/Geometry/Pool/'+ele.logical_volume(nf).name
00600                 de = DetElem(loc.lower()+'-'+thing.lower(),
00601                              lv_name,
00602                              npath%{"loc":loc,"nf":nf,"nlf":nlf},
00603                              last_support%{'loc':loc.lower()})
00604                 de.refs = []
00605                 if thing == 'IWS':
00606                     for iad in range(0,adn):
00607                         iad+=1
00608                         href='../AD%s/structure.xml#%s-ade%d'%(suffix,loc.lower(),iad)
00609                         de.refs.append(Reference(href,de))
00610                         continue
00611                 if thing == 'IWS':
00612                     de.refs.append(ExternalEntity(loc.lower()+"InnFinpmts"))
00613                 if thing == 'OWS':
00614                     de.refs.append(ExternalEntity(loc.lower()+"OutFinpmts"))
00615                     de.refs.append(ExternalEntity(loc.lower()+"OutFoutpmts"))
00616 
00617                 if thing == 'IWS' or thing == 'OWS':
00618                     de.refs.append(self.detid(loc,thing))
00619                 poolcat.things.append(de)
00620                 delist[loc].append(de)
00621                 continue
00622             last_support = base+"%(loc)s-"+ thing.lower()
00623             continue
00624         
00625 
00626         # Fix up detelemrefs
00627         for (k,lst) in delist.iteritems():
00628             lst.reverse()
00629             while lst:
00630                 de = lst.pop()
00631                 try:
00632                     next_de = lst[-1]
00633                 except IndexError:
00634                     break
00635                 de.refs.insert(0,Reference("#%s"%next_de.name,next_de))
00636                 continue
00637             continue
00638 
00639         file.objects = [ poolcat ]
00640         file.write(self.outdir+"/"+self.structure_filename)
00641         return
00642 


Member Data Documentation

Definition at line 360 of file gen.py.

Definition at line 360 of file gen.py.

Definition at line 360 of file gen.py.

Definition at line 360 of file gen.py.

Definition at line 360 of file gen.py.

Definition at line 360 of file gen.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 09:56:07 for XmlDetDesc by doxygen 1.7.4