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

In This Package:

gen::AdPmts Class Reference

List of all members.

Public Member Functions

def __init__
def pmtid
def write

Public Attributes

 site
 siteid
 adcount

Static Public Attributes

string lvname = "/dd/Geometry/PMT/lvPmtHemiwPmtHolder"
string lvname2 = "/dd/Geometry/PMT/lvHeadonPmtFrame"
list siteids = [0x01,0x02,0x04]
list adcounts = [ 2, 2, 4]

Detailed Description

Definition at line 48 of file gen.py.


Member Function Documentation

def gen::AdPmts::__init__ (   self,
  site,
  siteid,
  adcount 
)

Definition at line 55 of file gen.py.

00055                                           :
00056         self.site = site
00057         self.siteid = siteid
00058         self.adcount = adcount
00059         pass
00060 
00061     # this must match what Conventions/Detectors does
    def pmtid(self,site,adn,icol,iring):

def gen::AdPmts::pmtid (   self,
  site,
  adn,
  icol,
  iring 
)

Definition at line 62 of file gen.py.

00062                                        :
00063         return (site<<24)|(adn<<16)|(iring<<8)|icol
00064 
00065 
    def write(self,outdir):

def gen::AdPmts::write (   self,
  outdir 
)

Definition at line 66 of file gen.py.

00066                           :
00067 
00068         from XmlDetDescGen.util import XmlFile, Comment
00069         from XmlDetDescGen.structure import DetElem,UserParameter
00070 
00071         for adn in range(0,self.adcount):
00072             adn += 1
00073 
00074             pmts = []
00075 
00076             ipmt = 0
00077             for iring in range(0,8):
00078                 iring += 1
00079 
00080                 # 3 cols of PMTs on Ladder #1, 1 through 3
00081                 ladn = 1
00082                 for icol in range(0, 3):
00083                     icol += 1
00084                     ipmt = ipmt+1
00085                     coln = (ladn - 1)*3 + icol
00086                     pmtid = self.pmtid(siteid,adn,coln,iring)
00087                     data = {
00088                         'site':site,
00089                         'siteid':siteid,
00090                         'adnum':adn,
00091                         'ladnum':ladn,
00092                         'ringnum':iring,
00093                         'columnnum':icol,
00094                         'glbcoln':coln,
00095                         'pmtid':pmtid
00096                         }
00097                     
00098                     de = DetElem('%(site)s-ad%(adnum)d-ring%(ringnum)d-column%(glbcoln)d'%data,
00099                                  self.lvname,
00100                                  npath="pvAdPmtArray/pvAdPmtLadder1/pvAdPmtLadderArrayRotated/pvAdPmtLadderArrayRow:%(ringnum)s/pvAdPmtInCol:%(columnnum)d/pvAdPmtUnit"%data,
00101                                  support="/dd/Structure/AD/%(site)s-oil%(adnum)d"%data)
00102                     
00103                     de.refs = [UserParameter("PmtID","int",['0x%x'%pmtid],desc="Packed PMT ID")]
00104                     
00105                     pmts.append(de)
00106                     continue
00107 
00108                 # 3 cols of PMTs on Ladder #7
00109                 ladn = 7                
00110                 for icol in range(0, 3):
00111                     icol += 1
00112                     ipmt = ipmt+1
00113                     coln = (ladn - 1)*3 + icol
00114                     pmtid = self.pmtid(siteid,adn,coln,iring)
00115                     data = {
00116                         'site':site,
00117                         'siteid':siteid,
00118                         'adnum':adn,
00119                         'ladnum':ladn,
00120                         'ringnum':iring,
00121                         'columnnum':icol,
00122                         'glbcoln':coln,
00123                         'pmtid':pmtid
00124                         }
00125                     
00126                     de = DetElem('%(site)s-ad%(adnum)d-ring%(ringnum)d-column%(glbcoln)d'%data,
00127                                  self.lvname,
00128                                  npath="pvAdPmtArray/pvAdPmtLadder7/pvAdPmtLadderArrayRotated/pvAdPmtLadderArrayRow:%(ringnum)s/pvAdPmtInCol:%(columnnum)d/pvAdPmtUnit"%data,
00129                                  support="/dd/Structure/AD/%(site)s-oil%(adnum)d"%data)
00130                     
00131                     de.refs = [UserParameter("PmtID","int",['0x%x'%pmtid],desc="Packed PMT ID")]
00132                     
00133                     pmts.append(de)
00134                     continue
00135 
00136                 continue
00137 
00138             iring = 0      
00139             for icol in range(0,6):
00140                 icol += 1
00141                 ipmt = ipmt+1
00142                 pmtid = self.pmtid(siteid,adn,icol,iring)
00143                 data = {
00144                         'site':site,
00145                         'siteid':siteid,
00146                         'adnum':adn,
00147                         'ringnum':iring,
00148                         'columnnum':icol,
00149                         'pmtid':pmtid
00150                         }
00151                     
00152                 de = DetElem('%(site)s-ad%(adnum)d-ring%(ringnum)d-column%(columnnum)d'%data,
00153                              self.lvname2,
00154                              npath="pvAdCalibrationPmtArray/pvAd2inPmt:%(columnnum)d"%data,
00155                              support="/dd/Structure/AD/%(site)s-oil%(adnum)d"%data)
00156                     
00157                 de.refs = [UserParameter("PmtID","int",['0x%x'%pmtid],desc="Packed PMT ID")]
00158                     
00159                 pmts.append(de)
00160                 continue
00161 
00162             file = XmlFile()
00163             file.objects = pmts
00164             file.write(outdir+"/%s%d.xml"%(self.site,adn))
00165             continue
00166                              
if '__main__' == __name__:


Member Data Documentation

string gen::AdPmts::lvname = "/dd/Geometry/PMT/lvPmtHemiwPmtHolder" [static]

Definition at line 50 of file gen.py.

string gen::AdPmts::lvname2 = "/dd/Geometry/PMT/lvHeadonPmtFrame" [static]

Definition at line 51 of file gen.py.

list gen::AdPmts::siteids = [0x01,0x02,0x04] [static]

Definition at line 52 of file gen.py.

list gen::AdPmts::adcounts = [ 2, 2, 4] [static]

Definition at line 53 of file gen.py.

gen::AdPmts::site

Definition at line 56 of file gen.py.

gen::AdPmts::siteid

Definition at line 57 of file gen.py.

gen::AdPmts::adcount

Definition at line 58 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 Mon Apr 11 20:13:45 2011 for MiniDryRunXmlDetDesc by doxygen 1.4.7