Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001 #include "MuonGeoModel/ShieldBuilderRDB.h"
002 #include "AthenaKernel/getMessageSvc.h"
003 
004 #include "RDBAccessSvc/IRDBRecord.h"
005 #include "RDBAccessSvc/IRDBRecordset.h"
006 #include "RDBAccessSvc/IRDBAccessSvc.h"
007 
008 #include "MuonGeoModel/ArrayFunction.h"
009 
010 #include "GeoModelKernel/GeoBox.h"
011 #include "GeoModelKernel/GeoCons.h"
012 #include "GeoModelKernel/GeoTube.h"
013 #include "GeoModelKernel/GeoPcon.h"
014 #include "GeoModelKernel/GeoTrd.h"
015 #include "GeoModelKernel/GeoTrap.h"
016 #include "GeoModelKernel/GeoPgon.h" 
017 #include "GeoModelKernel/GeoMaterial.h"
018 #include "GeoModelKernel/GeoLogVol.h" 
019 #include "GeoModelKernel/GeoPhysVol.h"
020 #include "GeoModelKernel/GeoFullPhysVol.h"
021 #include "GeoModelKernel/GeoTransform.h"
022 #include "GeoModelKernel/GeoAlignableTransform.h"
023 #include "GeoModelKernel/GeoNameTag.h"
024 #include "GeoModelKernel/GeoShapeShift.h"
025 #include "GeoModelKernel/GeoShapeUnion.h"
026 #include "GeoModelKernel/GeoShapeSubtraction.h"
027 #include "GeoModelKernel/GeoSerialTransformer.h" 
028 #include "GeoModelKernel/GeoIdentifierTag.h"
029 #include "GeoModelSvc/StoredMaterialManager.h"
030 
031 #include "StoreGate/StoreGateSvc.h"
032 
033 #include "CLHEP/GenericFunctions/Variable.hh"
034 
035 #include <stdexcept>
036 #include <vector>
037 #include <iomanip>
038 
039 typedef std::stringstream  my_sstream;
040 typedef std::ostringstream my_osstream;
041 using namespace Genfun;
042 using namespace GeoXF;
043 
044 
045 namespace MuonGM {
046 
047 
048 ShieldBuilderRDB::ShieldBuilderRDB( StoreGateSvc  *pDetStore,
049                                     IRDBAccessSvc *pRDBAccess, 
050                                     std::string    geoTag,
051                                     std::string    geoNode)     :
052     m_pRDBAccess(pRDBAccess), 
053     m_pDetStore (pDetStore)
054 {
055   m_msgSvc = Athena::getMessageSvc();
056   MsgStream log(m_msgSvc, "MuGM:ShieldBuildRDB" );
057   log  <<  MSG::INFO  <<  "Fetching data with tag <"  <<  geoTag  <<"> node <"<<geoNode<<">" <<  endreq;
058   m_Jdsh = pRDBAccess->getRecordset( "JDSH",geoTag, geoNode);
059   if (m_Jdsh->size() == 0 ) 
060   {
061       log<<MSG::WARNING<<"Table JDSH not found in tag <"  <<  geoTag <<  ">"  <<" reading table JDSH-00" <<endreq;
062       m_Jdsh = pRDBAccess->getRecordset( "JDSH","JDSH-00" );
063   }
064   m_Jfsh = pRDBAccess->getRecordset( "JFSH",geoTag, geoNode);
065   if (m_Jfsh->size() == 0)
066   {
067       log<<MSG::WARNING<<"Table JFSH not found in tag <"  <<  geoTag <<  ">"  <<" reading table JFSH-00" <<endreq;
068       m_Jfsh = pRDBAccess->getRecordset( "JFSH","JFSH-00" );
069   }
070   m_Jtsh = pRDBAccess->getRecordset( "JTSH",geoTag, geoNode);
071   if (m_Jtsh->size() == 0)
072   {
073       log<<MSG::WARNING<<"Table JTSH not found in tag <"  <<  geoTag <<  ">"  <<" reading table JTSH-00" <<endreq;
074       m_Jtsh = pRDBAccess->getRecordset( "JTSH","JTSH-00" );
075   }
076   
077 
078 }
079 
080 void ShieldBuilderRDB::buildDiskShielding( GeoPhysVol* container ) 
081 {
082   //------------------------------------------------------------------------------------------
083   //  Builds Disk Shielding JD (after the LAr end-cap)
084   //  References: drawings
085   //    - ATLJD___0038, ATLJT___0044, ATLJT___0046 (back and front disks)
086   //    - ATLJD___0076, ATLJT___0080-81            (plugs, tube)
087   //    - ATLJD___0063, ATLJD___0066, ATLJD___0069 (cone segments - brass, poly, lead)
088   //    - ATLJD___0035, ATLJT___0085-88            (hub and hub cladding)
089   //------------------------------------------------------------------------------------------
090 
091   const StoredMaterialManager*  theMaterialManager;
092   if ( StatusCode::SUCCESS != m_pDetStore->retrieve( theMaterialManager, "MATERIALS" ) ) 
093   {
094     return;
095   } 
096 
097 //---------- JD Parameters from AMDB Q -------------------------------------------------------
098    const double FDinnRad = (*m_Jdsh)[0]->getFloat("FDINNRAD") * mm;
099    const double FDoutRad = (*m_Jdsh)[0]->getFloat("FDOUTRAD") * mm;
100    const double FDthickn = (*m_Jdsh)[0]->getFloat("FDTHICKN") * mm;
101    const double BDinnRad = (*m_Jdsh)[0]->getFloat("BDINNRAD") * mm;
102    const double BDoutRad = (*m_Jdsh)[0]->getFloat("BDOUTRAD") * mm;
103    const double BDthickn = (*m_Jdsh)[0]->getFloat("BDTHICKN") * mm;
104    const double NomiZpos = (*m_Jdsh)[0]->getFloat("NOMIZPOS") * mm;
105    const double CABCinRa = (*m_Jdsh)[0]->getFloat("CABCINRA") * mm;
106    const double CABCouRa = (*m_Jdsh)[0]->getFloat("CABCOURA") * mm;
107    const double CABCthi1 = (*m_Jdsh)[0]->getFloat("CABCTHI1") * mm;
108    const double CABCthic = (*m_Jdsh)[0]->getFloat("CABCTHIC") * mm;
109    const double CABCslAn = (*m_Jdsh)[0]->getFloat("CABCSLAN") * deg;
110    const double CABCslLe = (*m_Jdsh)[0]->getFloat("CABCSLLE") * mm;
111    const double CALCthic = (*m_Jdsh)[0]->getFloat("CALCTHIC") * mm;
112    const double CALCleng = (*m_Jdsh)[0]->getFloat("CALCLENG") * mm;
113    const double CALCwidt = (*m_Jdsh)[0]->getFloat("CALCWIDT") * mm;
114    const double CAPCthic = (*m_Jdsh)[0]->getFloat("CAPCTHIC") * mm;
115    const double CAPCleng = (*m_Jdsh)[0]->getFloat("CAPCLENG") * mm;
116    const double CAPCwidt = (*m_Jdsh)[0]->getFloat("CAPCWIDT") * mm;
117    const double CACOprAn = (*m_Jdsh)[0]->getFloat("CACOPRAN") * deg;
118    //const double TUBEinRa = (*m_Jdsh)[0]->getFloat("TUBEINRA") * mm;
119    const double TUBEOuR1 = (*m_Jdsh)[0]->getFloat("TUBEOUR1") * mm;
120    const double TUBEOuR2 = (*m_Jdsh)[0]->getFloat("TUBEOUR2") * mm;
121    const double TUBEslen = (*m_Jdsh)[0]->getFloat("TUBESLEN") * mm;
122    const double TUBEleng = (*m_Jdsh)[0]->getFloat("TUBELENG") * mm;
123    const double JDSH_Tube_BackDisk_innerRadius               =  275.0  * mm;
124    const double PLUGinR1 = (*m_Jdsh)[0]->getFloat("PLUGINR1") * mm;
125    const double PLUGouRa = (*m_Jdsh)[0]->getFloat("PLUGOURA") * mm;
126    const double PLUGleng = (*m_Jdsh)[0]->getFloat("PLUGLENG") * mm;
127    const double PLUGtiAn = (*m_Jdsh)[0]->getFloat("PLUGTIAN") * deg;
128    const double SWHinnRa = (*m_Jdsh)[0]->getFloat("SWHINNRA") * mm;
129    const double SWHoutR1 = (*m_Jdsh)[0]->getFloat("SWHOUTR1") * mm;
130    const double SWHoutR2 = (*m_Jdsh)[0]->getFloat("SWHOUTR2") * mm;
131    const double SWHlengt = (*m_Jdsh)[0]->getFloat("SWHLENGT") * mm;
132                                                                             
133    const std::string materialShieldSteel = getMaterial( "ShieldSteel" );    
134    const std::string materialShieldBrass = getMaterial( "ShieldBrass" );    
135    const std::string materialPolyboron   = getMaterial( "Polyboron" );      
136    const std::string materialLead        = getMaterial( "Lead" );           
137 //                                                                          
138 //--------------------------------------------------------------------------------------------
139 
140   const double tolerance = 0.5 * mm;
141   
142   const int nZPos = 2;
143 
144   // array of rotation angles and generating function to produce mirror images
145   double rotAngle[nZPos] = { 0, M_PI };
146   GENFUNCTION fRot = ArrayFunction( rotAngle, rotAngle + nZPos ); 
147 
148   // array of phi values (centres of phi sectors)
149   const double phi0Cone = CACOprAn;
150   const int nPhiSectors = 16;
151   double phiVal[nPhiSectors];
152   for ( int i = 0; i < nPhiSectors; i++ )  phiVal[i] = 2 * i * phi0Cone;  
153 
154   // auxiliary arrays to store phi values, positions, rotation angles for all volumes to be replicated 
155   double phiAux[ nPhiSectors * nZPos ], posAux[ nPhiSectors * nZPos ], rotAux[ nPhiSectors * nZPos ];
156   
157   
158   // JD Shielding properties
159 //  const double rInTube               = JDSH_Tube_innerRadius; 
160 //  const double lengthTube            = JDSH_Tube_length;
161   const double rInTubeBackDisk       = JDSH_Tube_BackDisk_innerRadius;
162                                                               
163   const double alpha    = CABCslAn;
164   const double sinAlpha = sin(alpha);
165   const double cosAlpha = cos(alpha);
166   //const double tanAlpha = sinAlpha / cosAlpha;
167   
168   const double tanPhi0 = tan(phi0Cone);
169    
170   //------------------------------------------------------------------------------------------
171   //  Build JD Front and Back Disks as cylindrical tubes
172   //------------------------------------------------------------------------------------------
173   // Front Disk
174   GeoTube*    sFrontDisk = new GeoTube( FDinnRad, FDoutRad, FDthickn/2 ); 
175   GeoLogVol*  lFrontDisk = new GeoLogVol( "DiskShieldingFrontDisk", 
176                                           sFrontDisk, 
177                                           theMaterialManager->getMaterial(materialShieldSteel) );
178   GeoPhysVol* pFrontDisk = new GeoPhysVol(lFrontDisk);
179 
180   // Back Disk
181   GeoTube*    sBackDisk = new GeoTube( BDinnRad,  BDoutRad, BDthickn/2 ); 
182   GeoLogVol*  lBackDisk = new GeoLogVol( "DiskShieldingBackDisk", 
183                                          sBackDisk, 
184                                          theMaterialManager->getMaterial(materialShieldSteel) );
185   GeoPhysVol* pBackDisk = new GeoPhysVol(lBackDisk);
186 
187   // replicate and position
188   //------------------------------------------------------------------------------------------
189   // Front Disk
190   // array of z positions  
191   double zPosFrontDisk[nZPos] = { -NomiZpos - FDthickn/2,
192                                    NomiZpos + FDthickn/2 };
193 
194   GENFUNCTION   fFrontDisk  = ArrayFunction( zPosFrontDisk, zPosFrontDisk + nZPos ); 
195   TRANSFUNCTION XFFrontDisk = Pow( HepTranslateZ3D(1.0), fFrontDisk );
196   
197   GeoSerialTransformer* sxFrontDisk = new GeoSerialTransformer( pFrontDisk, &XFFrontDisk, nZPos );
198   container->add(sxFrontDisk);
199   // std::cout<<" 1  "<<std::endl;
200 
201   // Back Disk
202   // array of z positions  
203   double zPosBackDisk[nZPos] = { -NomiZpos - FDthickn - BDthickn/2,
204                                   NomiZpos + FDthickn + BDthickn/2 };
205 
206   GENFUNCTION   fBackDisk  = ArrayFunction( zPosBackDisk, zPosBackDisk + nZPos ); 
207   TRANSFUNCTION XFBackDisk = Pow( HepTranslateZ3D(1.0), fBackDisk );
208   
209   GeoSerialTransformer* sxBackDisk = new GeoSerialTransformer( pBackDisk, &XFBackDisk, nZPos );
210   container->add(sxBackDisk);
211   // std::cout<<" 2  "<<std::endl;
212 
213   //------------------------------------------------------------------------------------------
214   //  Build JD Plugs and Tube 
215   //------------------------------------------------------------------------------------------
216       
217   //------------------------------------------------------------------------------------------
218   //  Build JD Plugs (i.e., brass core of JD Central Tube) as a tube with conical cut-out,
219   //  together with a small tube-shaped extension (within the clearing of the Central Tube 
220   //  back disk; cf. drawing ATLJD___0081).
221   //------------------------------------------------------------------------------------------
222   // tube-shaped plugs extension
223   GeoTube*    sPlugsExt = new GeoTube( PLUGinR1, rInTubeBackDisk, TUBEslen/2 - tolerance );
224   GeoLogVol*  lPlugsExt = new GeoLogVol( "DiskShieldingPlugsExtension", 
225                                          sPlugsExt, 
226                                          theMaterialManager->getMaterial(materialShieldBrass) );
227   GeoPhysVol* pPlugsExt = new GeoPhysVol(lPlugsExt);
228 
229   // tube-shaped core with conical cut-out  
230   GeoTube* sCylinder = new GeoTube( 0, PLUGouRa, PLUGleng/2 - tolerance );
231 
232   // empty cone to cut out additional central clearing 
233   const double tanBeta       = tan(PLUGtiAn);
234   const double dzEmptyCone   = PLUGleng + 2 * PLUGinR1/tanBeta;
235   const double rMaxEmptyCone = dzEmptyCone * tanBeta;
236   GeoCons* sEmptyCone = new GeoCons( 0, 0, tolerance, rMaxEmptyCone, dzEmptyCone/2, 0, 2*M_PI ); 
237 
238   // perform cut-out
239   HepTransform3D xfEmptyCone = HepRotateX3D(M_PI);
240   const GeoShape& sPlugs = sCylinder->subtract( (*sEmptyCone) << xfEmptyCone );
241 
242   GeoLogVol*  lPlugs = new GeoLogVol( "DiskShieldingPlugs", 
243                                       &sPlugs, 
244                                       theMaterialManager->getMaterial(materialShieldBrass) );
245   GeoPhysVol* pPlugs = new GeoPhysVol(lPlugs);
246 
247   // replicate and position both volumes
248   //------------------------------------------------------------------------------------------
249   // arrays of z positions
250   double zPosPlugsExt[nZPos] = { -NomiZpos - TUBEslen/2,
251                                   NomiZpos + TUBEslen/2  };
252   double zPosPlugs[nZPos]    = { -NomiZpos - TUBEslen - PLUGleng/2,
253                                   NomiZpos + TUBEslen + PLUGleng/2 };
254 
255   GENFUNCTION   fTrlPlugsExt = ArrayFunction( zPosPlugsExt, zPosPlugsExt + nZPos ); 
256   TRANSFUNCTION XFPlugsExt   = Pow( HepTranslateZ3D(1.0), fTrlPlugsExt );
257 
258   GeoSerialTransformer* sxPlugsExt = new GeoSerialTransformer( pPlugsExt, &XFPlugsExt, nZPos );
259   container->add(sxPlugsExt);
260   // std::cout<<" 3  "<<std::endl;
261 
262   GENFUNCTION   fTrlPlugs = ArrayFunction( zPosPlugs, zPosPlugs + nZPos ); 
263   TRANSFUNCTION XFPlugs   = Pow( HepTranslateZ3D(1.0), fTrlPlugs ) * 
264                             Pow( HepRotateX3D(1.0), fRot );
265   
266   GeoSerialTransformer* sxPlugs = new GeoSerialTransformer( pPlugs, &XFPlugs, nZPos );
267   container->add(sxPlugs);
268   // std::cout<<" 4  "<<std::endl;
269       
270   //------------------------------------------------------------------------------------------
271   //  Build JD steel Tube, consisting of back disk and main tube; don't build front disk 
272   //  for the time being (cf. drawings ATLJD___0076, ATLJD___0081) 
273   //------------------------------------------------------------------------------------------
274   // back disk
275   GeoTube*    sTubeBackDisk = new GeoTube( rInTubeBackDisk, TUBEOuR1, TUBEslen/2 );
276   GeoLogVol*  lTubeBackDisk = new GeoLogVol( "DiskShieldingTubeBackDisk", 
277                                              sTubeBackDisk, 
278                                              theMaterialManager->getMaterial(materialShieldSteel) );
279   GeoPhysVol* pTubeBackDisk = new GeoPhysVol(lTubeBackDisk);
280 
281   // main tube
282   GeoTube*    sMainTube = new GeoTube( PLUGouRa, TUBEOuR2, TUBEleng/2 );
283   GeoLogVol*  lMainTube = new GeoLogVol( "DiskShieldingMainTube", 
284                                          sMainTube, 
285                                          theMaterialManager->getMaterial(materialShieldSteel) );
286   GeoPhysVol* pMainTube = new GeoPhysVol(lMainTube);
287 
288   // replicate and position both volumes
289   //------------------------------------------------------------------------------------------
290   // arrays of z positions
291   double zPosTubeBackDisk[nZPos] = { -NomiZpos - TUBEslen/2,
292                                       NomiZpos + TUBEslen/2  };
293   double zPosMainTube[nZPos]     = { -NomiZpos - TUBEslen - TUBEleng/2,
294                                       NomiZpos + TUBEslen + TUBEleng/2 };
295 
296   GENFUNCTION   fTrlTubeBackDisk = ArrayFunction( zPosTubeBackDisk, zPosTubeBackDisk + nZPos ); 
297   TRANSFUNCTION XFTubeBackDisk   = Pow( HepTranslateZ3D(1.0), fTrlTubeBackDisk );
298 
299   GeoSerialTransformer* sxTubeBackDisk = new GeoSerialTransformer( pTubeBackDisk, &XFTubeBackDisk, nZPos );
300   container->add(sxTubeBackDisk);
301   // std::cout<<" 5  "<<std::endl;
302 
303   GENFUNCTION   fTrlMainTube = ArrayFunction( zPosMainTube, zPosMainTube + nZPos ); 
304   TRANSFUNCTION XFMainTube   = Pow( HepTranslateZ3D(1.0), fTrlMainTube );
305   
306   GeoSerialTransformer* sxMainTube = new GeoSerialTransformer( pMainTube, &XFMainTube, nZPos );
307   container->add(sxMainTube);
308   // std::cout<<" 6  "<<std::endl;
309 
310   //------------------------------------------------------------------------------------------
311   //  Build JD Cone, consisting of three layers (brass, polyboron, lead), where each layer 
312   //  consists of 16 phi segments. 
313   //------------------------------------------------------------------------------------------
314       
315   //------------------------------------------------------------------------------------------
316   //  Build JD Brass Cone 
317   //  A single Brass Cone segment is built from a trapezoidal base shape, where 
318   //  a box  cuts out the space for the poly and lead cones.
319   //------------------------------------------------------------------------------------------
320  const double dRBrassCone = CABCouRa - CABCinRa;
321   GeoTrd* sBrassConeTrd = new GeoTrd( CABCthic/2, CABCthic/2,
322                                       CAPCwidt/2 - dRBrassCone * tanPhi0, CAPCwidt/2, 
323                                       dRBrassCone/2 );
324 
325   // empty box to cut out the space for the poly and lead cones
326   const double dThickness = CABCthic - CABCthi1;
327   const double dXEmptyBox = dThickness * cosAlpha;
328   const double dZEmptyBox = CABCslLe - dThickness * sinAlpha;
329   GeoBox* sEmptyBox = new GeoBox( dXEmptyBox, CAPCwidt, dZEmptyBox );
330 
331   // perform cut-out 
332   //------------------------------------------------------------------------------------------
333   HepTransform3D xfEmptyBox   = HepTranslate3D( CABCthic/2, 0, dRBrassCone/2 ) * 
334                                 HepRotateY3D( -alpha );
335   const GeoShape& sBrassCone = sBrassConeTrd->subtract( (*sEmptyBox)  << xfEmptyBox );
336 
337   GeoLogVol*  lBrassCone = new GeoLogVol( "DiskShieldingBrassCone", 
338                                           &sBrassCone, 
339                                           theMaterialManager->getMaterial(materialShieldBrass) );
340   GeoPhysVol* pBrassCone = new GeoPhysVol(lBrassCone);
341 
342   //  replicate and position
343   //------------------------------------------------------------------------------------------
344   // array of z-positions
345   const double zValBrassCone = NomiZpos + FDthickn + BDthickn + CABCthic/2;
346   double zPosBrassCone[nZPos] = { -zValBrassCone, zValBrassCone };
347     
348   // fill auxiliary arrays 
349   for ( int i = 0; i < nPhiSectors * nZPos; i++ )  
350   {
351      int ii = i % nPhiSectors, 
352          jj = i / nPhiSectors;
353      phiAux[i] = phiVal[ii];         // can be used for all JD Cone volumes in common
354      posAux[i] = zPosBrassCone[jj];
355      rotAux[i] = rotAngle[jj];       // can be used for all JD Cone volumes in common
356   }
357 
358   GENFUNCTION fPhiReplication = ArrayFunction( phiAux, phiAux + nPhiSectors * nZPos ); 
359   GENFUNCTION fRotCone        = ArrayFunction( rotAux, rotAux + nPhiSectors * nZPos ); 
360   GENFUNCTION fTrlBrassCone   = ArrayFunction( posAux, posAux + nPhiSectors * nZPos ); 
361 
362   TRANSFUNCTION XFBrassCone = Pow( HepRotateZ3D(1.0), fPhiReplication ) * 
363                               Pow( HepTranslateZ3D(1.0), fTrlBrassCone ) *
364                               Pow( HepRotateY3D(1.0), fRotCone ) *
365                               HepTranslateY3D( CABCinRa + dRBrassCone/2 ) * 
366                               HepRotateZ3D( M_PI/2 ) *  
367                               HepRotateY3D( M_PI/2 ); 
368   GeoSerialTransformer* sxBrassCone = new GeoSerialTransformer( pBrassCone, 
369                                                                 &XFBrassCone, 
370                                                                 nPhiSectors * nZPos );
371   container->add(sxBrassCone);
372   // std::cout<<" 7  "<<std::endl;
373 
374   //------------------------------------------------------------------------------------------
375   //  Build JD Poly Cone, consisting of trapezoidal segments 
376   //------------------------------------------------------------------------------------------
377   const double dZPolyCone = CAPCleng;
378   GeoTrd* sPolyCone = new GeoTrd( CAPCthic/2, CAPCthic/2,
379                                   CAPCwidt/2 - dZPolyCone * tanPhi0, CAPCwidt/2, 
380                                   dZPolyCone/2 );
381 
382   GeoLogVol*  lPolyCone = new GeoLogVol( "DiskShieldingPolyCone", 
383                                          sPolyCone, 
384                                          theMaterialManager->getMaterial(materialPolyboron) );
385   GeoPhysVol* pPolyCone = new GeoPhysVol(lPolyCone);
386 
387   //  replicate and position
388   //------------------------------------------------------------------------------------------
389   // array of z-positions
390   const double zOffsetAfterDisks = zValBrassCone - CABCthic/2 + CABCthi1;
391   const double zValPolyCone   = zOffsetAfterDisks + 
392                                 0.5 * ( CAPCthic * cosAlpha + dZPolyCone * sinAlpha );
393   double zPosPolyCone[nZPos]  = { -zValPolyCone,  zValPolyCone };
394     
395   // re-define auxiliary array posAux 
396   for ( int i = 0; i < nPhiSectors * nZPos; i++ )  
397   {
398      int jj = i / nPhiSectors;
399      posAux[i] = zPosPolyCone[jj];
400   }
401 
402   GENFUNCTION fTrlPolyCone = ArrayFunction( posAux, posAux + nPhiSectors * nZPos ); 
403 
404   const double yOffsetPolyCone = CABCouRa - 
405                                  0.5 * ( -CAPCthic * sinAlpha + dZPolyCone * cosAlpha );
406   TRANSFUNCTION XFPolyCone = Pow( HepRotateZ3D(1.0), fPhiReplication ) * 
407                              Pow( HepTranslateZ3D(1.0), fTrlPolyCone ) *
408                              Pow( HepRotateY3D(1.0), fRotCone ) *
409                              HepTranslateY3D(yOffsetPolyCone) * 
410                              HepRotateZ3D( M_PI/2 ) *  
411                              HepRotateY3D( M_PI/2 - alpha ); 
412   GeoSerialTransformer* sxPolyCone = new GeoSerialTransformer( pPolyCone, 
413                                                                &XFPolyCone, 
414                                                                nPhiSectors * nZPos );
415   container->add(sxPolyCone);
416   // std::cout<<" 8  "<<std::endl;
417 
418   //------------------------------------------------------------------------------------------
419   //  Build JD Lead Cone, consisting of trapezoidal segments 
420   //------------------------------------------------------------------------------------------
421   const double dZLeadCone = CALCleng;
422   GeoTrd* sLeadCone = new GeoTrd( CALCthic/2, CALCthic/2,
423                                   CALCwidt/2 - dZLeadCone * tanPhi0, CALCwidt/2, 
424                                   dZLeadCone/2 );
425 
426   GeoLogVol*  lLeadCone = new GeoLogVol( "DiskShieldingLeadCone", 
427                                          sLeadCone, 
428                                          theMaterialManager->getMaterial(materialLead) );
429   GeoPhysVol* pLeadCone = new GeoPhysVol(lLeadCone);
430 
431   //  replicate and position
432   //------------------------------------------------------------------------------------------
433   // array of z-positions
434   const double zValLeadCone  = zOffsetAfterDisks + CAPCthic * cosAlpha + 
435                                0.5 * ( CALCthic * cosAlpha + dZLeadCone * sinAlpha ) + 
436                                ( dZPolyCone - dZLeadCone ) * sinAlpha;
437   double zPosLeadCone[nZPos] = { -zValLeadCone,  zValLeadCone };
438     
439   // re-define auxiliary array posAux 
440   for ( int i = 0; i < nPhiSectors * nZPos; i++ )  
441   {
442      int jj = i / nPhiSectors;
443      posAux[i] = zPosLeadCone[jj];
444   }
445 
446   GENFUNCTION fTrlLeadCone = ArrayFunction( posAux, posAux + nPhiSectors * nZPos ); 
447 
448   const double yOffsetLeadCone = CABCouRa - 
449                                  0.5 * ( -CALCthic * sinAlpha + dZLeadCone * cosAlpha ) -
450                                  ( dZPolyCone - dZLeadCone ) * cosAlpha + 
451                                  CAPCthic * sinAlpha;
452   TRANSFUNCTION XFLeadCone = Pow( HepRotateZ3D(1.0), fPhiReplication ) * 
453                              Pow( HepTranslateZ3D(1.0), fTrlLeadCone ) *
454                              Pow( HepRotateY3D(1.0), fRotCone ) *
455                              HepTranslateY3D(yOffsetLeadCone) * 
456                              HepRotateZ3D( M_PI/2 ) *  
457                              HepRotateY3D( M_PI/2 - alpha ); 
458   GeoSerialTransformer* sxLeadCone = new GeoSerialTransformer( pLeadCone, 
459                                                                &XFLeadCone, 
460                                                                nPhiSectors * nZPos );
461   container->add(sxLeadCone);
462   // std::cout<<" 9  "<<std::endl;
463 
464   //------------------------------------------------------------------------------------------
465   //  Build JD Small Wheel Hub, consisting of cone-shaped brass core and two layers of 
466   //  cladding (polyboron, lead)
467   //  Approximate as three concentric GeoCons's.
468   //------------------------------------------------------------------------------------------
469       
470   //------------------------------------------------------------------------------------------
471   //  Build JD Small Wheel Hub brass cone as a GeoCons
472   //------------------------------------------------------------------------------------------
473   GeoCons* sHubBrassCone = new GeoCons( SWHinnRa,   SWHinnRa, 
474                                         SWHoutR2, SWHoutR1, SWHlengt/2, 
475                                         0, 2*M_PI );
476 
477   GeoLogVol*  lHubBrassCone = new GeoLogVol( "DiskShieldingHubBrassCone", 
478                                              sHubBrassCone, 
479                                              theMaterialManager->getMaterial(materialShieldBrass) );
480   GeoPhysVol* pHubBrassCone = new GeoPhysVol(lHubBrassCone);
481       
482   //------------------------------------------------------------------------------------------
483   //  Build JD Small Wheel Hub polyboron cladding as a GeoCons  
484   //------------------------------------------------------------------------------------------
485   const double rOut1PolyCladding = SWHoutR1 + CAPCthic;
486   const double rOut2PolyCladding = SWHoutR2 + CAPCthic;
487   
488   GeoCons* sPolyCladding = new GeoCons( SWHoutR2, SWHoutR1, 
489                                         rOut2PolyCladding,  rOut1PolyCladding, SWHlengt/2, 
490                                         0, 2*M_PI );
491 
492   GeoLogVol*  lPolyCladding = new GeoLogVol( "DiskShieldingPolyCladding", 
493                                              sPolyCladding, 
494                                              theMaterialManager->getMaterial(materialPolyboron) );
495   GeoPhysVol* pPolyCladding = new GeoPhysVol(lPolyCladding);
496       
497   //------------------------------------------------------------------------------------------
498   //  Build JD Small Wheel Hub lead cladding as a GeoCons 
499   //------------------------------------------------------------------------------------------
500   const double rOut1LeadCladding = rOut1PolyCladding + CALCthic;
501   const double rOut2LeadCladding = rOut2PolyCladding + CALCthic;
502   
503   GeoCons* sLeadCladding = new GeoCons( rOut2PolyCladding, rOut1PolyCladding, 
504                                         rOut2LeadCladding, rOut1LeadCladding, SWHlengt/2, 
505                                         0, 2*M_PI );
506 
507   GeoLogVol*  lLeadCladding = new GeoLogVol( "DiskShieldingLeadCladding", 
508                                              sLeadCladding, 
509                                              theMaterialManager->getMaterial(materialLead) );
510   GeoPhysVol* pLeadCladding = new GeoPhysVol(lLeadCladding);
511 
512   //------------------------------------------------------------------------------------------
513   //  Replicate and position all JD Small Wheel Hub volumes
514   //------------------------------------------------------------------------------------------
515   // array of z-positions
516   const double zValSmallWheelHub  = NomiZpos + FDthickn + BDthickn + 
517                                     CABCthic + SWHlengt/2;
518   double zPosSmallWheelHub[nZPos] = { -zValSmallWheelHub, zValSmallWheelHub };
519     
520   GENFUNCTION   fTrlSmallWheelHub = ArrayFunction( zPosSmallWheelHub, zPosSmallWheelHub + nZPos ); 
521   TRANSFUNCTION XFSmallWheelHub   = Pow( HepTranslateZ3D(1.0), fTrlSmallWheelHub ) *
522                                     Pow( HepRotateX3D(1.0), fRot ); 
523 
524   GeoSerialTransformer* sxSmallWheelHub = new GeoSerialTransformer( pHubBrassCone, &XFSmallWheelHub, nZPos );
525   GeoSerialTransformer* sxPolyCladding  = new GeoSerialTransformer( pPolyCladding, &XFSmallWheelHub, nZPos );
526   GeoSerialTransformer* sxLeadCladding  = new GeoSerialTransformer( pLeadCladding, &XFSmallWheelHub, nZPos );
527 
528   container->add(sxSmallWheelHub);
529   container->add(sxPolyCladding);
530   container->add(sxLeadCladding);
531   // std::cout<<" 10  "<<std::endl;
532 
533 }
534 
535 void ShieldBuilderRDB::buildForwardShielding( GeoPhysVol* container ) 
536 {
537   //------------------------------------------------------------------------------------------
538   //  Builds JF Shielding (JF main cylinder and plug, JF octogon; TX1STM parts)
539   //------------------------------------------------------------------------------------------
540 
541   const StoredMaterialManager*  theMaterialManager;
542   if ( StatusCode::SUCCESS != m_pDetStore->retrieve( theMaterialManager, "MATERIALS" ) ) 
543   {
544     return;
545   } 
546 
547 //---------- JF Parameters from AMDB Q -------------------------------------------------------
548    const double JFCMClen = (*m_Jfsh)[0]->getFloat("JFCMCLEN") * mm;           
549    //const double JFCMCir1 = (*m_Jfsh)[0]->getFloat("JFCMCIR1") * mm;           
550    const double JFCMCouR = (*m_Jfsh)[0]->getFloat("JFCMCOUR") * mm;           
551    const double JFCMChSl = (*m_Jfsh)[0]->getFloat("JFCMCHSL") * deg;          
552    const double JFCMCzof = (*m_Jfsh)[0]->getFloat("JFCMCZOF") * mm;           
553    const double PLUGleng = (*m_Jfsh)[0]->getFloat("PLUGLENG") * mm;           
554    const double PLUGinRa = (*m_Jfsh)[0]->getFloat("PLUGINRA") * mm;           
555    const double PLUGouRa = (*m_Jfsh)[0]->getFloat("PLUGOURA") * mm;           
556    const double JFSOCmRa = (*m_Jfsh)[0]->getFloat("JFSOCMRA") * mm;           
557    const double JFSOClen = (*m_Jfsh)[0]->getFloat("JFSOCLEN") * mm;           
558    const double JFSOCzof = (*m_Jfsh)[0]->getFloat("JFSOCZOF") * mm;           
559    const double TX1e1oRa = (*m_Jfsh)[0]->getFloat("TX1E1ORA") * mm;           
560    const double TX1e1iRa = (*m_Jfsh)[0]->getFloat("TX1E1IRA") * mm;           
561    const double TX1e1iLe = (*m_Jfsh)[0]->getFloat("TX1E1ILE") * mm;           
562    const double JFSH_tx1stm_element2_outerRadius1 =  1400.0 * mm;           
563    const double TX1e2oRa = (*m_Jfsh)[0]->getFloat("TX1E2ORA") * mm;           
564    const double TX1e2iRa = (*m_Jfsh)[0]->getFloat("TX1E2IRA") * mm;           
565    const double TX1e2iLe = (*m_Jfsh)[0]->getFloat("TX1E2ILE") * mm;           
566    const double TX1STzof = (*m_Jfsh)[0]->getFloat("TX1STZOF") * mm;           
567                                                                             
568    const std::string materialJFShield = getMaterial( "ShieldIron" );        
569 
570 //---------- -- ECT Vacuum Vessel Parameters --------------------------------------------
571    const double zMaxECTVessel = 12906 * mm;
572   
573   const double phi0      = M_PI/8; 
574   const double cosPhi0   = cos(phi0);
575   const double tolerance = 1.0 * mm;
576   
577   const int nZPos = 2;
578   
579   // array of rotation angles and generating function to produce mirror images
580   double rotAngle[nZPos] = { 0, M_PI };
581   GENFUNCTION fRot = ArrayFunction( rotAngle, rotAngle + nZPos ); 
582   
583   // JF Shielding properties
584   // const double rInner1JFC2MainCylinder = JFSH_JFCMainCylinder_innerRadius1;
585   const double rOuter1TX1STMElem2      = JFSH_tx1stm_element2_outerRadius1;
586 
587   //------------------------------------------------------------------------------------------
588   //  Build JF Main Cylinder Plug 
589   //------------------------------------------------------------------------------------------
590   GeoTube* sPlug = new GeoTube( PLUGinRa, PLUGouRa, PLUGleng/2 ); 
591   
592   GeoLogVol*  lPlug = new GeoLogVol( "ForwardShieldingPlug", 
593                                      sPlug, 
594                                      theMaterialManager->getMaterial(materialJFShield) );
595   GeoPhysVol* pPlug = new GeoPhysVol(lPlug);
596 
597   // replicate and position
598   //------------------------------------------------------------------------------------------
599   // array of z positions
600   double zPosPlug[nZPos] = { -zMaxECTVessel - JFCMCzof + PLUGleng/2,
601                               zMaxECTVessel + JFCMCzof - PLUGleng/2 };
602 
603   GENFUNCTION   fPlug  = ArrayFunction( zPosPlug, zPosPlug + nZPos ); 
604   TRANSFUNCTION XFPlug = Pow( HepTranslateZ3D(1.0), fPlug );
605   
606   GeoSerialTransformer* sxPlug = new GeoSerialTransformer( pPlug, &XFPlug, nZPos );
607   container->add(sxPlug);
608   // std::cout<<" 11  "<<std::endl;
609 
610   //------------------------------------------------------------------------------------------
611   //  Build JF 'extended' Main Cylinder as a tube with conical cut-out.
612   //  Consists of parts JFC1, JFC2, JFC3 (cf. drawings ATLJF___0006, ATLJF___0003, and 
613   //  ATLJF___0004) together with the part of TX1STM within the JF Octogon (cf. ATLJF___0010).
614   //------------------------------------------------------------------------------------------
615   double lengthExtCylinder = JFCMClen + JFSOClen;
616   GeoTube* sCylinder = new GeoTube( PLUGinRa, JFCMCouR, lengthExtCylinder/2 - tolerance );
617 
618   // empty cone to cut out additional central clearing 
619   const double tanAlpha      = tan(JFCMChSl);
620   const double dzEmptyCone   = lengthExtCylinder + 2 * PLUGinRa/tanAlpha;
621   const double rMaxEmptyCone = dzEmptyCone * tanAlpha;
622   GeoCons* sEmptyCone = new GeoCons( 0, 0, tolerance, rMaxEmptyCone, dzEmptyCone/2, 0, 2*M_PI ); 
623 
624   // perform cut-out
625   HepTransform3D xfEmptyCone = HepRotateX3D(M_PI);
626   const GeoShape& sExtCylinder = sCylinder->subtract( (*sEmptyCone) << xfEmptyCone );
627 
628   GeoLogVol*  lExtCylinder = new GeoLogVol( "ForwardShieldingMainCylinder", 
629                                             &sExtCylinder, 
630                                             theMaterialManager->getMaterial(materialJFShield) );
631   GeoPhysVol* pExtCylinder = new GeoPhysVol(lExtCylinder);
632 
633   // replicate and position
634   //------------------------------------------------------------------------------------------
635   // array of z positions
636   double zPosExtCylinder[nZPos] = { -zMaxECTVessel - JFCMCzof - lengthExtCylinder/2,
637                                      zMaxECTVessel + JFCMCzof + lengthExtCylinder/2 };
638 
639   GENFUNCTION   fTrlExtCylinder = ArrayFunction( zPosExtCylinder, zPosExtCylinder + nZPos ); 
640   TRANSFUNCTION XFExtCylinder   = Pow( HepTranslateZ3D(1.0), fTrlExtCylinder ) * 
641                                   Pow( HepRotateX3D(1.0), fRot );
642   
643   GeoSerialTransformer* sxExtCylinder = new GeoSerialTransformer( pExtCylinder, &XFExtCylinder, nZPos );
644   container->add(sxExtCylinder);
645   // std::cout<<" 12  "<<std::endl;
646 
647   //------------------------------------------------------------------------------------------
648   //  Build Main JF Octogon as an octogon with cylindrical cut-out.
649   //------------------------------------------------------------------------------------------
650   GeoPgon* sOctogon = new GeoPgon( phi0, 2*M_PI, 8 );
651   sOctogon->addPlane( -JFSOClen/2, JFCMCouR/2, JFSOCmRa/cosPhi0 );
652   sOctogon->addPlane(  JFSOClen/2, JFCMCouR/2, JFSOCmRa/cosPhi0 );
653 
654   // empty tube to cut out the central clearing
655   GeoTube* sEmptyTube = new GeoTube( 0, JFCMCouR + tolerance, JFSOClen ); 
656   
657   // perform cut-out
658   const GeoShape& sJFOctogon = sOctogon->subtract( *sEmptyTube );
659   GeoLogVol*  lJFOctogon = new GeoLogVol( "ForwardShieldingOctogon", 
660                                           &sJFOctogon, 
661                                           theMaterialManager->getMaterial(materialJFShield) );
662   GeoPhysVol* pJFOctogon = new GeoPhysVol(lJFOctogon);
663 
664   // replicate and position
665   //------------------------------------------------------------------------------------------
666   // array of z positions
667   double zPosJFOctogon[nZPos] = { -zMaxECTVessel - JFSOCzof - JFSOClen/2,
668                                    zMaxECTVessel + JFSOCzof + JFSOClen/2 };
669 
670   GENFUNCTION   fTrlJFOctogon = ArrayFunction( zPosJFOctogon, zPosJFOctogon + nZPos ); 
671   TRANSFUNCTION XFJFOctogon   = Pow( HepTranslateZ3D(1.0), fTrlJFOctogon );
672   
673   GeoSerialTransformer* sxJFOctogon = new GeoSerialTransformer( pJFOctogon, &XFJFOctogon, nZPos );
674   container->add(sxJFOctogon);
675   // std::cout<<" 13  "<<std::endl;
676 
677   //------------------------------------------------------------------------------------------
678   //  Build TX1STM part outside the JF Octogon as a tube and a cone.
679   //------------------------------------------------------------------------------------------
680 
681   //------------------------------------------------------------------------------------------
682   //  Build TX1STM tube-shaped part 
683   //------------------------------------------------------------------------------------------
684   GeoTube* sTX1STMTube = new GeoTube( TX1e1iRa, TX1e1oRa, TX1e1iLe/2 ); 
685   
686   GeoLogVol*  lTX1STMTube = new GeoLogVol( "ForwardShieldingTX1STMTube", 
687                                            sTX1STMTube, 
688                                            theMaterialManager->getMaterial(materialJFShield) );
689   GeoPhysVol* pTX1STMTube = new GeoPhysVol(lTX1STMTube);
690 
691   // replicate and position
692   //------------------------------------------------------------------------------------------
693   // array of z positions
694   double zPosTX1STMTube[nZPos] = { -zMaxECTVessel - TX1STzof - TX1e1iLe/2,
695                                     zMaxECTVessel + TX1STzof + TX1e1iLe/2 };
696 
697   GENFUNCTION   fTX1STMTube  = ArrayFunction( zPosTX1STMTube, zPosTX1STMTube + nZPos ); 
698   TRANSFUNCTION XFTX1STMTube = Pow( HepTranslateZ3D(1.0), fTX1STMTube );
699   
700   GeoSerialTransformer* sxTX1STMTube = new GeoSerialTransformer( pTX1STMTube, &XFTX1STMTube, nZPos );
701   container->add(sxTX1STMTube);
702   // std::cout<<" 14  "<<std::endl;
703 
704   //------------------------------------------------------------------------------------------
705   //  Build TX1STM cone-shaped part 
706   //------------------------------------------------------------------------------------------
707   GeoCons* sTX1STMCone = new GeoCons( TX1e2iRa,  TX1e2iRa, 
708                                       TX1e2oRa, rOuter1TX1STMElem2, 
709                                       TX1e2iLe/2, 
710                                       0, 2*M_PI ); 
711                                       
712   GeoLogVol*  lTX1STMCone = new GeoLogVol( "ForwardShieldingTX1STMCone", 
713                                            sTX1STMCone, 
714                                            theMaterialManager->getMaterial(materialJFShield) );
715   GeoPhysVol* pTX1STMCone = new GeoPhysVol(lTX1STMCone);
716 
717   // replicate and position
718   //------------------------------------------------------------------------------------------
719   // array of z positions
720   const double zOffsetTX1STMCone = TX1STzof + TX1e1iLe;
721   double zPosTX1STMCone[nZPos]   = { -zMaxECTVessel - zOffsetTX1STMCone - TX1e2iLe/2,
722                                       zMaxECTVessel + zOffsetTX1STMCone + TX1e2iLe/2 };
723 
724   GENFUNCTION   fTrlTX1STMCone = ArrayFunction( zPosTX1STMCone, zPosTX1STMCone + nZPos ); 
725   TRANSFUNCTION XFTX1STMCone   = Pow( HepTranslateZ3D(1.0), fTrlTX1STMCone ) * 
726                                  Pow( HepRotateX3D(1.0), fRot );
727   
728   GeoSerialTransformer* sxTX1STMCone = new GeoSerialTransformer( pTX1STMCone, &XFTX1STMCone, nZPos );
729   container->add(sxTX1STMCone);
730   // std::cout<<" 15  "<<std::endl;
731 
732 }
733 
734 void ShieldBuilderRDB::buildToroidShielding( GeoPhysVol* container ) 
735 {
736   //------------------------------------------------------------------------------------------
737   //  Builds JTT Shielding (within the ECT Central Tube)
738   //  References: drawings ATLJT___0001, ATLJT___0014-16, ATLJT___0018-19
739   //------------------------------------------------------------------------------------------
740 
741   const StoredMaterialManager*  theMaterialManager;
742   if ( StatusCode::SUCCESS != m_pDetStore->retrieve( theMaterialManager, "MATERIALS" ) ) 
743   {
744     return;
745   } 
746 
747 //---------- JT Parameters from AMDB Q -------------------------------------------------------
748 //                                                                          
749    const double OPlength = (*m_Jtsh)[0]->getFloat("OPLENGTH") * mm;          
750    const double OPinnRad = (*m_Jtsh)[0]->getFloat("OPINNRAD") * mm;          
751    const double OPoutRad = (*m_Jtsh)[0]->getFloat("OPOUTRAD") * mm;          
752    const double IPlength = (*m_Jtsh)[0]->getFloat("IPLENGTH") * mm;          
753    const double IPinnRa1 = (*m_Jtsh)[0]->getFloat("IPINNRA1") * mm;          
754    const double IPoutRad = (*m_Jtsh)[0]->getFloat("IPOUTRAD") * mm;          
755    const double IPtiltAn = (*m_Jtsh)[0]->getFloat("IPTILTAN") * deg;         
756    const double IPzoffse = (*m_Jtsh)[0]->getFloat("IPZOFFSE") * mm;          
757    const double PRlength = (*m_Jtsh)[0]->getFloat("PRLENGTH") * mm;          
758    const double PRinnRad = (*m_Jtsh)[0]->getFloat("PRINNRAD") * mm;          
759    const double PRoutRad = (*m_Jtsh)[0]->getFloat("PROUTRAD") * mm;          
760    const double PRexttAn = (*m_Jtsh)[0]->getFloat("PREXTTAN") * deg;         
761    const double PRipexle = (*m_Jtsh)[0]->getFloat("PRIPEXLE") * mm;          
762    const double zpositio = (*m_Jtsh)[0]->getFloat("ZPOSITIO") * mm;          
763                                                                             
764    const std::string materialJTPlugs = getMaterial( "ShieldBrass" );        
765    const std::string materialJTRings = getMaterial( "Polyboron" );          
766 //                                                                          
767 //--------------------------------------------------------------------------------------------
768   
769   const double tolerance = 0.5 * mm; 
770   
771   const int nZPos = 2;
772 
773   // array of rotation angles and generating function to produce mirror images
774   double rotAngle[nZPos] = { 0, M_PI };
775   GENFUNCTION fRot = ArrayFunction( rotAngle, rotAngle + nZPos ); 
776   
777   // JT Shielding properties
778   const double zPosJTOuterPlugs      = zpositio + PRipexle; 
779    
780   //------------------------------------------------------------------------------------------
781   //  Build JTT Outer Plugs as cylindrical tube 
782   //------------------------------------------------------------------------------------------
783   GeoTube* sOuterPlugs = new GeoTube( OPinnRad, OPoutRad, OPlength/2 ); 
784   
785   GeoLogVol*  lOuterPlugs = new GeoLogVol( "ToroidShieldingOuterPlugs", 
786                                            sOuterPlugs, 
787                                            theMaterialManager->getMaterial(materialJTPlugs) );
788   GeoPhysVol* pOuterPlugs = new GeoPhysVol(lOuterPlugs);
789 
790   // replicate and position
791   //------------------------------------------------------------------------------------------
792   // array of z positions
793   double zPosOuterPlugs[nZPos] = { -zPosJTOuterPlugs - OPlength/2,
794                                     zPosJTOuterPlugs + OPlength/2 };
795 
796   GENFUNCTION   fOuterPlugs  = ArrayFunction( zPosOuterPlugs, zPosOuterPlugs + nZPos ); 
797   TRANSFUNCTION XFOuterPlugs = Pow( HepTranslateZ3D(1.0), fOuterPlugs );
798   
799   GeoSerialTransformer* sxOuterPlugs = new GeoSerialTransformer( pOuterPlugs, &XFOuterPlugs, nZPos );
800   container->add(sxOuterPlugs);
801   // std::cout<<" 16  "<<std::endl;
802  
803   //------------------------------------------------------------------------------------------
804   //  Build JTT Inner Plugs as cylindrical tube with conical cut-out 
805   //------------------------------------------------------------------------------------------
806   GeoTube* sInnerTube = new GeoTube( 0, IPoutRad, IPlength/2 - tolerance );
807 
808   // empty cone to cut out additional central clearing 
809   const double tanAlpha      = tan(IPtiltAn);
810   const double dzEmptyCone   = IPlength + 2 * IPinnRa1/tanAlpha;
811   const double rMaxEmptyCone = dzEmptyCone * tanAlpha;
812   GeoCons* sEmptyCone = new GeoCons( 0, 0, tolerance, rMaxEmptyCone, dzEmptyCone/2, 0, 2*M_PI ); 
813 
814   // perform cut-out
815   HepTransform3D xfEmptyCone = HepRotateX3D(M_PI);
816   const GeoShape& sInnerPlugs = sInnerTube->subtract( (*sEmptyCone) << xfEmptyCone );
817 
818   GeoLogVol*  lInnerPlugs = new GeoLogVol( "ToroidShieldingInnerPlugs", 
819                                            &sInnerPlugs, 
820                                            theMaterialManager->getMaterial(materialJTPlugs) );
821   GeoPhysVol* pInnerPlugs = new GeoPhysVol(lInnerPlugs);
822 
823   // replicate and position
824   //------------------------------------------------------------------------------------------
825   // array of z positions
826 
827   //.xu +-40.
828   double zPosInnerPlugs[nZPos] = { -zpositio - IPzoffse - IPlength/2 - 40.,
829                                     zpositio + IPzoffse + IPlength/2 + 40.};
830 
831   MsgStream log(m_msgSvc, "MuGM:ShieldBuildRDB" ); //log  <<  MSG::INFO << endreq;
832 
833   GENFUNCTION   fInnerPlugs  = ArrayFunction( zPosInnerPlugs, zPosInnerPlugs + nZPos ); 
834   TRANSFUNCTION XFInnerPlugs = Pow( HepTranslateZ3D(1.0), fInnerPlugs ) * 
835                                Pow( HepRotateX3D(1.0), fRot );
836   
837   GeoSerialTransformer* sxInnerPlugs = new GeoSerialTransformer( pInnerPlugs, &XFInnerPlugs, nZPos );
838   container->add(sxInnerPlugs);
839   // std::cout<<" 17  "<<std::endl;
840 
841   //------------------------------------------------------------------------------------------
842   //  Build JTT Poly Rings as a tube and a cone.
843   //------------------------------------------------------------------------------------------
844   //------------------------------------------------------------------------------------------
845   //  Build Poly Rings tube-shaped part 
846   //------------------------------------------------------------------------------------------
847   GeoTube*    sPolyRingsTube = new GeoTube( PRinnRad, PRoutRad, PRlength/2 ); 
848   GeoLogVol*  lPolyRingsTube = new GeoLogVol( "ToroidShieldingPolyRingsTube", 
849                                               sPolyRingsTube, 
850                                               theMaterialManager->getMaterial(materialJTRings) );
851   GeoPhysVol* pPolyRingsTube = new GeoPhysVol(lPolyRingsTube);
852 
853   // replicate and position
854   //------------------------------------------------------------------------------------------
855   // array of z positions
856   const double zOffsetPolyRingsTube = OPlength - PRlength;
857   double zPosPolyRingsTube[nZPos]   = { -zPosJTOuterPlugs - zOffsetPolyRingsTube - PRlength/2,
858                                          zPosJTOuterPlugs + zOffsetPolyRingsTube + PRlength/2 };
859 
860   GENFUNCTION   fPolyRingsTube  = ArrayFunction( zPosPolyRingsTube, zPosPolyRingsTube + nZPos ); 
861   TRANSFUNCTION XFPolyRingsTube = Pow( HepTranslateZ3D(1.0), fPolyRingsTube );
862   
863   GeoSerialTransformer* sxPolyRingsTube = new GeoSerialTransformer( pPolyRingsTube, &XFPolyRingsTube, nZPos );
864   container->add(sxPolyRingsTube);
865   // std::cout<<" 18  "<<std::endl;
866 
867   //------------------------------------------------------------------------------------------
868   //  Build Poly Rings cone-shaped part 
869   //------------------------------------------------------------------------------------------
870   const double tanBeta = tan(PRexttAn);
871   const double deltaZ  = ( PRoutRad - PRinnRad ) / tanBeta;
872   GeoCons* sPolyRingsCone = new GeoCons( PRinnRad,  PRinnRad, 
873                                          PRoutRad, PRinnRad + tolerance, 
874                                          deltaZ/2, 
875                                          0, 2*M_PI ); 
876                                       
877   GeoLogVol*  lPolyRingsCone = new GeoLogVol( "ToroidShieldingPolyRingsCone", 
878                                               sPolyRingsCone, 
879                                               theMaterialManager->getMaterial(materialJTRings) );
880   GeoPhysVol* pPolyRingsCone = new GeoPhysVol(lPolyRingsCone);
881 
882   // replicate and position
883   //------------------------------------------------------------------------------------------
884   // array of z positions
885   double zPosPolyRingsCone[nZPos] = { -zPosJTOuterPlugs - zOffsetPolyRingsTube + deltaZ/2,
886                                        zPosJTOuterPlugs + zOffsetPolyRingsTube - deltaZ/2 };
887 
888   GENFUNCTION   fTrlPolyRingsCone = ArrayFunction( zPosPolyRingsCone, zPosPolyRingsCone + nZPos ); 
889   TRANSFUNCTION XFPolyRingsCone   = Pow( HepTranslateZ3D(1.0), fTrlPolyRingsCone ) * 
890                                     Pow( HepRotateX3D(1.0), fRot );
891   
892   GeoSerialTransformer* sxPolyRingsCone = new GeoSerialTransformer( pPolyRingsCone, &XFPolyRingsCone, nZPos );
893   container->add(sxPolyRingsCone);
894   // std::cout<<" 19  "<<std::endl;
895 
896 }
897 
898 std::string ShieldBuilderRDB::getMaterial( std::string materialName ) 
899 {
900   MsgStream log(m_msgSvc, "MuonGeoModel" );
901    
902   if ( materialName == "Lead" )   
903   {
904     return "std::Lead";
905   }
906   else if ( materialName == "ShieldSteel"  ||  materialName == "ShieldIron"   ||  
907             materialName == "ShieldBrass"  ||  materialName == "Polylithium"  || materialName == "Polyboron" )   
908   {
909     return "shield::" + materialName;
910   }
911   else 
912   {
913     log  <<  MSG::WARNING
914          <<  " ShieldBuilderRDB::getMaterial: Material "  <<  materialName  <<  " not defined! "  
915          <<  " Take Iron instead." 
916          <<  endreq;
917     return "std::Iron";           
918   }  
919 }   
920 
921 } // namespace MuonGM
922 

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!