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

List of all members.

Public Member Functions

def __init__
def param_fullname
def param_diffname
def parameters
def logical_volume
def physical_volume

Public Attributes

 name
 nick
 thickness
 material
 parent
 child
 params
 logvol
 physvol

Detailed Description

Definition at line 21 of file gen.py.


Constructor & Destructor Documentation

def XmlDetDescGen::Pool::gen::Element::__init__ (   self,
  name,
  nick,
  material,
  thickness = "0*m",
  parent = None 
)

Definition at line 22 of file gen.py.

00023                                                                      :
00024         self.name=name
00025         self.nick=nick
00026         self.thickness=thickness
00027         self.material=material
00028         self.parent=parent
00029         self.child=None
00030         if parent: parent.child = self
00031         self.params = {}
00032         self.logvol = {}
00033         self.physvol = {}
00034         return


Member Function Documentation

def XmlDetDescGen::Pool::gen::Element::param_fullname (   self,
  param_name,
  site = "" 
)

Definition at line 35 of file gen.py.

00036                                                :
00037         if self.name == 'HallBot':
00038             return "%s%s%s"%(site,self.name,param_name)
00039         return "%sPool%s%s"%(site,self.name,param_name)

def XmlDetDescGen::Pool::gen::Element::param_diffname (   self,
  diffname,
  param_name,
  site = "" 
)

Definition at line 40 of file gen.py.

00041                                                         :
00042         return "%sPool%s%s"%(site,diffname,param_name)
00043 

def XmlDetDescGen::Pool::gen::Element::parameters (   self)

Definition at line 44 of file gen.py.

00045                         :
00046         from XmlDetDescGen.parameter import Parameter
00047 
00048         if self.params: return self.params
00049 
00050         p = Parameter(self.param_fullname("Thickness"),self.thickness,"Thickness of %s"%self.nick)
00051         self.params[self.param_fullname("Thickness")] = p
00052         
00053 
00054         if self.parent.name == 'HallBot':
00055             parentThickness = "0*m"
00056         else:
00057             parentThickness = self.parent.param_fullname('Thickness')
00058         for site in ["Near","Far"]:
00059             for dim in ["X","Y"]:
00060                 pname = "Size"+dim
00061                 self.params[self.param_fullname(pname,site)] = \
00062                     Parameter(self.param_fullname(pname,site),
00063                               self.parent.param_fullname(pname,site)+"-2*"+parentThickness)
00064                 continue
00065             continue
00066 
00067         self.params[self.param_fullname('SizeZ')] = \
00068             Parameter(self.param_fullname('SizeZ'),
00069                       self.parent.param_fullname('SizeZ')+"-"+parentThickness)
00070 
00071         self.params[self.param_fullname('LiftSizeZ')] = \
00072             Parameter(self.param_fullname('LiftSizeZ'),"0.5*"+parentThickness)
00073 
00074         bevel = []
00075         elem = self
00076         while elem:
00077             bevel.append(elem.param_fullname('Thickness'))
00078             elem = elem.child
00079             continue
00080         self.params[self.param_fullname('BevelSize')] = \
00081             Parameter(self.param_fullname('BevelSize'),
00082                       "2*(sqrt(2)-1)*(%s)"%"+".join(bevel))
00083 
00084         return self.params
    
def XmlDetDescGen::Pool::gen::Element::logical_volume (   self,
  site 
)

Definition at line 85 of file gen.py.

00086                                  :
00087         try:
00088             return self.logvol[site]
00089         except KeyError:
00090             pass
00091              
00092         from XmlDetDescGen.geometry import Box,Boolean,BooleanSecondary,Logvol,PosXYZ,RotXYZ
00093 
00094         # Make the subtracted ones first
00095         subtracted = []
00096         signX = ['0.5*%s', '0.5*%s','-0.5*%s','-0.5*%s']
00097         signY = ['0.5*%s','-0.5*%s', '0.5*%s','-0.5*%s']
00098         signX2 = ['0.5*%s', '0.5*%s','-0.5*%s','-0.5*%s']
00099         signY2 = ['0*%s', '0.5*%s','-0.5*%s', '0.5*%s','-0.5*%s']
00100         signR = ['0*%s', '0.5*%s','-0.5*%s', '0.5*%s','-0.5*%s']
00101 
00102         if self.name=="OWS":
00103             
00104             for ind in range(0,4):
00105                 subtracted.append(BooleanSecondary(
00106                     Box(site.lower()+'_pool_'+self.name.lower()+'_sub%d'%ind,
00107                         sizeX=self.param_diffname('Liner','BevelSize'),
00108                         sizeY=self.param_diffname('Liner','BevelSize'),
00109                         sizeZ="SubShift+" + self.param_fullname('SizeZ')),
00110                     PosXYZ(X=signX[ind]%self.param_diffname('Liner','SizeX',site),
00111                            Y=signY[ind]%self.param_diffname('Liner','SizeY',site),
00112                            Z="0*m"),
00113                     RotXYZ(rotZ="45*degree")))
00114 
00115             for ind in range(4,8):
00116                 subtracted.append(BooleanSecondary(
00117                     Box(site.lower()+'_pool_'+self.name.lower()+'_sub%d'%ind,
00118                         sizeX=self.param_fullname('BevelSize'),
00119                         sizeY=self.param_fullname('BevelSize'),
00120                         sizeZ=self.param_fullname('SizeZ')),
00121                     PosXYZ(X=signX[ind-4]%self.param_fullname('SizeX',site),
00122                            Y=signY[ind-4]%self.param_fullname('SizeY',site),
00123                            Z="-TopGapThickness"),
00124                     RotXYZ(rotZ="45*degree")))
00125                 
00126             subtracted.append(BooleanSecondary(
00127                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub8',
00128                     sizeX=self.param_fullname('SizeX',site),
00129                     sizeY="SubShift",
00130                     sizeZ=self.param_fullname('SizeZ')),
00131                 PosXYZ(X="0*cm",
00132                        Y=self.param_fullname('SizeY',site)+"/2."+"+SubShift/2.-PoolLinerThickness",
00133                        Z="-TopGapThickness"),
00134                 RotXYZ(rotZ="0*degree")))
00135 
00136             subtracted.append(BooleanSecondary(
00137                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub9',
00138                     sizeX=self.param_fullname('SizeX',site),
00139                     sizeY="SubShift",
00140                     sizeZ=self.param_fullname('SizeZ')),
00141                 PosXYZ(X="0*cm",
00142                        Y=self.param_fullname('SizeY',site)+"/(-2.)"+"-SubShift/2.+PoolLinerThickness",
00143                        Z="-TopGapThickness"),
00144                 RotXYZ(rotZ="0*degree")))
00145 
00146             subtracted.append(BooleanSecondary(
00147                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub10',
00148                     sizeX=self.param_fullname('SizeX',site),
00149                     sizeY="SubShift",
00150                     sizeZ=self.param_fullname('SizeZ')),
00151                 PosXYZ(X=self.param_fullname('SizeX',site)+"/2."+"+SubShift/2.-PoolLinerThickness",
00152                        Y="0*cm",
00153                        Z="-TopGapThickness"),
00154                 RotXYZ(rotZ="90*degree")))
00155 
00156             subtracted.append(BooleanSecondary(
00157                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub11',
00158                     sizeX=self.param_fullname('SizeX',site),
00159                     sizeY="SubShift",
00160                     sizeZ=self.param_fullname('SizeZ')),
00161                 PosXYZ(X=self.param_fullname('SizeX',site)+"/(-2.)"+"-SubShift/2.+PoolLinerThickness",
00162                        Y="0*cm",
00163                        Z="-TopGapThickness"),
00164                 RotXYZ(rotZ="90*degree")))
00165 
00166 
00167 
00168             # Make the subtraction
00169             sub = Boolean("subtraction",site.lower()+'_pool_'+self.name.lower()+'_box',
00170                           Box(site.lower()+'_pool_'+self.name.lower(),
00171                               sizeX=self.param_diffname('Liner','SizeX',site),
00172                               sizeY=self.param_diffname('Liner','SizeY',site),
00173                               sizeZ=self.param_fullname('SizeZ')),
00174                           subtracted)
00175 
00176         elif self.name=="IWS":
00177 
00178             for ind in range(0,4):
00179                 subtracted.append(BooleanSecondary(
00180                     Box(site.lower()+'_pool_'+self.name.lower()+'_sub%d'%ind,
00181                         sizeX=self.param_diffname('Curtain','BevelSize'),
00182                         sizeY=self.param_diffname('Curtain','BevelSize'),
00183                         sizeZ="SubShift+" + self.param_fullname('SizeZ')),
00184                     PosXYZ(X=signX[ind]%self.param_diffname('Curtain','SizeX',site),
00185                            Y=signY[ind]%self.param_diffname('Curtain','SizeY',site),
00186                            Z="0*m"),
00187                     RotXYZ(rotZ="45*degree")))
00188 
00189             for ind in range(4,8):
00190                 subtracted.append(BooleanSecondary(
00191                     Box(site.lower()+'_pool_'+self.name.lower()+'_sub%d'%ind,
00192                         sizeX=self.param_fullname('BevelSize'),
00193                         sizeY=self.param_fullname('BevelSize'),
00194                         sizeZ=self.param_fullname('SizeZ')),
00195                     PosXYZ(X=signX[ind-4]%self.param_fullname('SizeX',site),
00196                            Y=signY[ind-4]%self.param_fullname('SizeY',site),
00197                            Z="-TopGapThickness"),
00198                     RotXYZ(rotZ="45*degree")))
00199                 
00200             subtracted.append(BooleanSecondary(
00201                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub8',
00202                     sizeX=self.param_fullname('SizeX',site),
00203                     sizeY="SubShift",
00204                     sizeZ=self.param_fullname('SizeZ')),
00205                 PosXYZ(X="0*cm",
00206                        Y=self.param_fullname('SizeY',site)+"/2."+"+SubShift/2.-PoolCurtainThickness",
00207                        Z="-TopGapThickness"),
00208                 RotXYZ(rotZ="0*degree")))
00209 
00210             subtracted.append(BooleanSecondary(
00211                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub9',
00212                     sizeX=self.param_fullname('SizeX',site),
00213                     sizeY="SubShift",
00214                     sizeZ=self.param_fullname('SizeZ')),
00215                 PosXYZ(X="0*cm",
00216                        Y=self.param_fullname('SizeY',site)+"/(-2.)"+"-SubShift/2.+PoolCurtainThickness",
00217                        Z="-TopGapThickness"),
00218                 RotXYZ(rotZ="0*degree")))
00219 
00220             subtracted.append(BooleanSecondary(
00221                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub10',
00222                     sizeX=self.param_fullname('SizeX',site),
00223                     sizeY="SubShift",
00224                     sizeZ=self.param_fullname('SizeZ')),
00225                 PosXYZ(X=self.param_fullname('SizeX',site)+"/2."+"+SubShift/2.-PoolCurtainThickness",
00226                        Y="0*cm",
00227                        Z="-TopGapThickness"),
00228                 RotXYZ(rotZ="90*degree")))
00229 
00230             subtracted.append(BooleanSecondary(
00231                 Box(site.lower()+'_pool_'+self.name.lower()+'_sub11',
00232                     sizeX=self.param_fullname('SizeX',site),
00233                     sizeY="SubShift",
00234                     sizeZ=self.param_fullname('SizeZ')),
00235                 PosXYZ(X=self.param_fullname('SizeX',site)+"/(-2.)"+"-SubShift/2.+PoolCurtainThickness",
00236                        Y="0*cm",
00237                        Z="-TopGapThickness"),
00238                 RotXYZ(rotZ="90*degree")))
00239 
00240 
00241 
00242             # Make the subtraction
00243             sub = Boolean("subtraction",site.lower()+'_pool_'+self.name.lower()+'_box',
00244                           Box(site.lower()+'_pool_'+self.name.lower(),
00245                               sizeX=self.param_diffname('Curtain','SizeX',site),
00246                               sizeY=self.param_diffname('Curtain','SizeY',site),
00247                               sizeZ=self.param_fullname('SizeZ')),
00248                           subtracted)
00249 
00250         else:
00251             for ind in range(0,4):
00252                 subtracted.append(BooleanSecondary(
00253                     Box(site.lower()+'_pool_'+self.name.lower()+'_sub%d'%ind,
00254                         sizeX=self.param_fullname('BevelSize'),
00255                         sizeY=self.param_fullname('BevelSize'),
00256                         sizeZ="1*cm+"+self.param_fullname('SizeZ')),
00257                     PosXYZ(X=signX[ind]%self.param_fullname('SizeX',site),
00258                            Y=signY[ind]%self.param_fullname('SizeY',site),
00259                            Z="0*m"),
00260                     RotXYZ(rotZ="45*degree")))
00261 
00262             # Make the subtraction
00263             sub = Boolean("subtraction",site.lower()+'_pool_'+self.name.lower()+'_box',
00264                           Box(site.lower()+'_pool_'+self.name.lower(),
00265                               sizeX=self.param_fullname('SizeX',site),
00266                               sizeY=self.param_fullname('SizeY',site),
00267                               sizeZ=self.param_fullname('SizeZ')),
00268                           subtracted)
00269                 
00270 
00271         if self.child: 
00272             from XmlDetDescGen.geometry import Physvol
00273 
00274             pvs = self.child.physical_volume(site)
00275             if gen_pool_pmts and site=="Far" and self.name == "OWS":
00276                 pvs.append(Physvol("pv%sOutPTE"%site,"/dd/Geometry/PmtPanel/lv%sOutPTE"%site))
00277             if gen_pool_pmts and site=="Near" and self.name == "OWS":
00278                 pvs.append(Physvol("pvVetoPmt%sOutFacein"%site,"/dd/Geometry/PmtPanel/lvVetoPmt%sOutFacein"%site, PosXYZ(Z="-PoolOWSSizeZ/2.")))
00279                 pvs.append(Physvol("pvVetoPmt%sOutFaceout"%site,"/dd/Geometry/PmtPanel/lvVetoPmt%sOutFaceout"%site, PosXYZ(Z="-PoolOWSSizeZ/2.")))
00280             
00281         else:                   # must be OWS, add ADEs
00282             #from XmlDetDescGen.util import ExternalEntity
00283             #pvs = [ ExternalEntity('AD%sPlacements'%site) ]
00284 
00285             from XmlDetDescGen.geometry import Physvol, PosXYZ, RotXYZ
00286 
00287             import sys
00288             print sys.argv[0],'Configuring for',style
00289 
00290             
00291             pvs = []
00292             ade_rotation = RotXYZ(rotZ="ADrotation")
00293             if site == 'Near':
00294                 pvs.append(Physvol("pvNearADE1","/dd/Geometry/AD/lvADE",
00295                                    PosXYZ(X="1*(0.5*NearPoolIWSSizeX-PoolIWSThickness)",
00296                                           Z="ADadeZplace"),
00297                                    ade_rotation));
00298                 if Eight :
00299                     pvs.append(Physvol("pvNearADE2","/dd/Geometry/AD/lvADE",
00300                                        PosXYZ(X="-1*(0.5*NearPoolIWSSizeX-PoolIWSThickness)",
00301                                               Z="ADadeZplace"),
00302                                        ade_rotation));
00303                 else:
00304                     print 'WARNING. Did not install NearADE2. Configuring for',style
00305             else:
00306                 # 5dec11 djaffe: swap ad1,ad2 to reflect actual deployment
00307                 pvs.append(Physvol("pvFarADE1","/dd/Geometry/AD/lvADE",
00308                                    PosXYZ(X="-1*(0.5*FarPoolIWSSizeX-PoolIWSThickness)",
00309                                           Y="1*(0.5*FarPoolIWSSizeY-PoolIWSThickness)",
00310                                           Z="ADadeZplace"),
00311                                    ade_rotation));
00312                 pvs.append(Physvol("pvFarADE2","/dd/Geometry/AD/lvADE",
00313                                    PosXYZ(X="1*(0.5*FarPoolIWSSizeX-PoolIWSThickness)",
00314                                           Y="1*(0.5*FarPoolIWSSizeY-PoolIWSThickness)",
00315                                           Z="ADadeZplace"),
00316                                    ade_rotation));
00317                 pvs.append(Physvol("pvFarADE3","/dd/Geometry/AD/lvADE",
00318                                    PosXYZ(X="-1*(0.5*FarPoolIWSSizeX-PoolIWSThickness)",
00319                                           Y="-1*(0.5*FarPoolIWSSizeY-PoolIWSThickness)",
00320                                           Z="ADadeZplace"),
00321                                    ade_rotation));
00322                 if Eight :
00323                     pvs.append(Physvol("pvFarADE4","/dd/Geometry/AD/lvADE",
00324                                        PosXYZ(X="1*(0.5*FarPoolIWSSizeX-PoolIWSThickness)",
00325                                               Y="-1*(0.5*FarPoolIWSSizeY-PoolIWSThickness)",
00326                                               Z="ADadeZplace"),
00327                                        ade_rotation));
00328                 else:
00329                     print 'WARNING: Did not install FarADE4. Configuring for',style
00330 
00331             if gen_pool_pmts and site=="Far":
00332                 pvs.append(Physvol("pv%sInPTE"%site,"/dd/Geometry/PmtPanel/lv%sInPTE"%site))
00333             if gen_pool_pmts and site=="Near":
00334                 pvs.append(Physvol("pvVetoPmt%sInn"%site,"/dd/Geometry/PmtPanel/lvVetoPmt%sInn"%site, PosXYZ(Z="(PoolIWSSizeZ-PoolOWSSizeZ)/2.-PoolOWSSizeZ/2.")))
00335 
00336         from XmlDetDescGen.util import ExternalEntity
00337         pvs.append(ExternalEntity("%sHandWrittenPhysVols"%site))
00338 
00339         lv = Logvol('lv'+site+'Pool'+self.name,self.material,sub,pvs)
00340         self.logvol[site] = lv;
00341         return lv;

def XmlDetDescGen::Pool::gen::Element::physical_volume (   self,
  site 
)

Definition at line 342 of file gen.py.

00343                                   :
00344         try:
00345             return self.physvol[site]
00346         except KeyError:
00347             pass
00348 
00349         from XmlDetDescGen.geometry import Physvol,PosXYZ
00350             
00351         lv = self.logical_volume(site)
00352         #print site,self.name,lv.name
00353         pv = Physvol('pv'+site+'Pool'+self.name,lv,
00354                      PosXYZ(X="0*m",Y="0*m",Z=self.param_fullname('LiftSizeZ')))
00355         self.physvol[site] = [pv]
00356         return self.physvol[site]
00357     
00358 


Member Data Documentation

Definition at line 22 of file gen.py.

Definition at line 22 of file gen.py.

Definition at line 22 of file gen.py.

Definition at line 22 of file gen.py.

Definition at line 22 of file gen.py.

Definition at line 22 of file gen.py.

Definition at line 22 of file gen.py.

Definition at line 22 of file gen.py.

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