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

List of all members.

Public Member Functions

def __init__
def catalog
def write

Public Attributes

 parameters
 adcat

Static Public Attributes

string filename = "geometry.xml"

Detailed Description

Definition at line 539 of file gen.py.


Constructor & Destructor Documentation

def XmlDetDescGen::AD::gen::Geometry::__init__ (   self,
  parameters 
)

Definition at line 541 of file gen.py.

00542                                  :
00543 
00544         self.parameters = parameters
00545         self.adcat = None
00546         return


Member Function Documentation

def XmlDetDescGen::AD::gen::Geometry::catalog (   self)

Definition at line 547 of file gen.py.

00548                      :
00549 
00550         if self.adcat: return self.adcat
00551 
00552         from XmlDetDescGen.catalog import Catalog
00553         from XmlDetDescGen.reference import Reference
00554 
00555         topcat = Catalog("Geometry")
00556         ac = Catalog("AD")
00557         # This is fake, just to get the right /dd/Geometry path
00558         topcat.refs = [ Reference("#AD",ac) ]
00559 
00560         for c in self.parameters.cylinders():
00561             NAME = c.name.upper()
00562             name = '${GEOM_%(name)s_HREF}%(name)s.xml#lv%(name)s'%{'name':NAME}
00563             #print name
00564             ac.refs.append(Reference(name,c.logvol()))
00565             continue
00566 
00567         # Important, needed so full_paths can be set
00568         topcat.update()
00569 
00570         self.adcat = ac
00571         return self.adcat

def XmlDetDescGen::AD::gen::Geometry::write (   self,
  outdir 
)

Definition at line 572 of file gen.py.

00573                           :
00574         from XmlDetDescGen.util import XmlFile
00575         objects = [self.catalog()]
00576         fp = XmlFile(dtd="../DTD/geometry.dtd",
00577                        objects=objects)
00578         fp.write(outdir+"/"+self.filename)
00579 
00580         params = ("ADParameters",self.parameters.filename)
00581         AdDetailParams = ("AdDetailParameters","../AdDetails/%s"%self.parameters.filename)
00582         OverflowParams = ("OverflowParameters","../OverflowTanks/%s"%self.parameters.filename)
00583         CalibrationBoxParams = ("CalibrationBoxParameters","../CalibrationBox/%s"%self.parameters.filename)
00584         for c in self.parameters.cylinders():
00585             from XmlDetDescGen.util import ExternalEntity
00586             
00587             details = ("HandWrittenPhysVols","../AdDetails/%sPhysVols.xml" % c.name.upper())
00588             envvar_ent = "${DD_AD_%s_EE}" % c.name.upper()
00589             envvar_top = "${DD_AD_%s_TOP}" % c.name.upper()
00590             envvar_pv = "  ${DD_AD_%s_PV}" % c.name.upper()
00591 
00592             lv = c.logvol()
00593             lv.physvols.append(envvar_pv)
00594 
00595             fp = XmlFile(dtd="../DTD/geometry.dtd",
00596                            objects=[ExternalEntity("ADParameters"),
00597                                     ExternalEntity("AdDetailParameters"), 
00598                                     ExternalEntity("OverflowParameters"), 
00599                                     ExternalEntity("CalibrationBoxParameters"),
00600                                     envvar_top,c.logvol()],
00601                            external_entities=[params, AdDetailParams, 
00602                                               OverflowParams, CalibrationBoxParams, 
00603                                               details, envvar_ent])
00604             fp.write(outdir+"/"+c.name.upper()+".xml")
00605 
00606         return
00607 


Member Data Documentation

string XmlDetDescGen::AD::gen::Geometry::filename = "geometry.xml" [static]

Definition at line 540 of file gen.py.

Definition at line 541 of file gen.py.

Definition at line 541 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