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

List of all members.

Public Member Functions

def __init__
def detid
def refframe
def write

Detailed Description

Definition at line 608 of file gen.py.


Constructor & Destructor Documentation

def XmlDetDescGen::AD::gen::Structure::__init__ (   self)

Definition at line 609 of file gen.py.

00610                       :
00611         return


Member Function Documentation

def XmlDetDescGen::AD::gen::Structure::detid (   self,
  loc,
  adn 
)

Definition at line 612 of file gen.py.

00613                            :
00614         # All hard coded numbers from Conventions/DetectorId.h
00615         if loc.lower() == 'db':
00616             iloc = 0x01
00617         elif loc.lower() == 'la':
00618             iloc = 0x02
00619         elif loc.lower() == 'far':
00620             iloc = 0x04
00621         else:
00622             iloc = 0x00
00623         detid = ((iloc<<24)|(adn<<16))
00624         from XmlDetDescGen.structure import UserParameter
00625         return UserParameter("DetectorID","int", ['0x%x'%detid],
00626                              desc="Packed Detector ID")

def XmlDetDescGen::AD::gen::Structure::refframe (   self,
  loc,
  adn 
)

Definition at line 627 of file gen.py.

00628                               :
00629         'Return parameter indicating a coordinate system'
00630         from XmlDetDescGen.structure import UserParameter
00631         return UserParameter("CoordinateSystem","int",[0],
00632                              desc="Indicate this is a user coordinate system, value indicates the level of localness of the coordinate sytem")
00633 

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

Definition at line 634 of file gen.py.

00635                           :
00636         from XmlDetDescGen.util import XmlFile, Comment,ExternalEntity
00637         from XmlDetDescGen.structure import DetElem
00638         from XmlDetDescGen.catalog import Catalog
00639         from XmlDetDescGen.reference import Reference
00640 
00641         topcat = Catalog('Structure');
00642         adcat = Catalog('AD');
00643         # Clear our refs because some how this is filled with the
00644         # contents of the /Geometry/Pool catalog!  Python bug???
00645         adcat.refs = []       
00646         topcat.refs = [ adcat ]
00647 
00648         base = "/dd/Structure/AD/"
00649 
00650         ees = []
00651         nf="Near"
00652         if Eight : 
00653             nads=2
00654         else:
00655             nads=1
00656         import sys
00657         print sys.argv[0],'Configuring for',style
00658         for loc in ["db","la","far"]:
00659             if loc == "far": 
00660                 nf="Far"
00661                 if Eight: 
00662                     nads=4
00663                 else:
00664                     nads=3
00665 
00666             adcat.things.append(Comment("\n%s %s site AD things\n"%(loc.upper(),nf)))
00667 
00668             last_support = "/dd/Structure/Pool/%s-iws"%loc
00669 
00670             ithing = -1
00671             things = ['ade','sst','oil','oav','lso','iav','gds']
00672             for thing in things:
00673                 ithing += 1
00674                 if thing == 'ade':
00675                     npath = 'pv'+nf+thing.upper()+'%(adn)d'
00676                 else:
00677                     npath = 'pv'+thing.upper()
00678                 for adn in range(1,nads+1):
00679                     de = DetElem("%s-%s%d"%(loc,thing,adn),
00680                                  "/dd/Geometry/AD/lv%s"%thing.upper(),
00681                                  npath=npath%{'adn':adn},
00682                                  support=last_support%{'adn':adn})
00683                     de.refs = []
00684                     if thing != 'gds':
00685                         href="#%s-%s%d"%(loc,things[ithing+1],adn)
00686                         de.refs.append(Reference(href,de))
00687                     if thing == 'lso':
00688                         href="../AdDetails/structure.xml#%s-ad%d-calibTubeA-gdlsInLs"%(loc,adn)
00689                         de.refs.append(Reference(href,de))
00690                         href="../AdDetails/structure.xml#%s-ad%d-calibTubeB-gdlsInLs"%(loc,adn)
00691                         de.refs.append(Reference(href,de))
00692                     if thing == 'oil':
00693                         eename = '%s%dpmts'%(loc,adn)
00694                         ees.append((eename,'../AdPmtStructure/%s%d.xml'%(loc,adn)))
00695                         de.refs.append(ExternalEntity(eename))
00696 
00697                         adrefname = '%s%dreflectors'%(loc,adn)
00698                         ees.append((adrefname,'../AdReflectorStructure/%s%d.xml'%(loc,adn)))
00699                         de.refs.append(ExternalEntity(adrefname))
00700 
00701                         de.refs.append(self.detid(loc,adn))
00702                         de.refs.append(self.refframe(loc,adn))
00703                         href="../AdDetails/structure.xml#%s-ad%d-calibTubeA-gdlsInOil"%(loc,adn)
00704                         de.refs.append(Reference(href,de))
00705                         href="../AdDetails/structure.xml#%s-ad%d-calibTubeB-gdlsInOil"%(loc,adn)
00706                         de.refs.append(Reference(href,de))
00707                         href="../AdDetails/structure.xml#%s-ad%d-calibTubeC-lsInOil"%(loc,adn)
00708                         de.refs.append(Reference(href,de))
00709                     adcat.things.append(de)
00710                     continue
00711                 last_support=base+loc+"-"+thing+"%(adn)d"
00712                 continue
00713             continue
00714         fp = XmlFile(dtd="../DTD/structure.dtd",
00715                        external_entities=ees)
00716         fp.objects = [ adcat ]
00717         fp.write(outdir+"/structure.xml")
00718         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