ATLAS Offline Software
SquirrelCageFactory.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "SquirrelCageFactory.h"
6 
7 // GeoModel includes
9 #include "GeoModelKernel/GeoDefinitions.h"
10 #include "GeoModelKernel/GeoPhysVol.h"
11 #include "GeoModelKernel/GeoLogVol.h"
12 #include "GeoModelKernel/GeoTube.h"
13 #include "GeoModelKernel/GeoTubs.h"
14 #include "GeoModelKernel/GeoMaterial.h"
15 #include "GeoModelKernel/GeoTransform.h"
16 #include "GeoModelKernel/GeoBox.h"
17 
19 
23 #include "RDBAccessSvc/IRDBQuery.h"
26 #include "GaudiKernel/PhysicalConstants.h"
27 
29 
30 #include <iostream>
31 
32 
34  InDetMaterialManager * matManager)
35  : InDetDD::SubDetectorFactoryBase(athenaComps, matManager)
36 {
37 }
38 
39 
41 {
42 }
43 
44 
45 
46 //## Other Operations (implementation)
47 void SquirrelCageFactory::create(GeoPhysVol *mother)
48 {
49 
50  DecodeVersionKey indetVersionKey(geoDbTagSvc(),"InnerDetector");
51  std::string railversion = rdbAccessSvc()->getChildTag("IDDetailedRail",indetVersionKey.tag(),indetVersionKey.node());
52  if(!railversion.empty()) {
53  // ______________________________________________________________________________________________________________________
54  // Geometry with ID rail
55 
56  IRDBRecordset_ptr cage = rdbAccessSvc()->getRecordsetPtr("SquirrelCage", indetVersionKey.tag(), indetVersionKey.node());
57  //It is need for "U" shape support
58  IRDBRecordset_ptr sctGenServices = rdbAccessSvc()->getRecordsetPtr("SCTGenServices", indetVersionKey.tag(), indetVersionKey.node());
59 
60  // Get table version
61  // This is a work around to allow running with older DB releases.
62  std::string sqversionStr = rdbAccessSvc()->getChildTag("SquirrelCage", indetVersionKey.tag(), indetVersionKey.node());
63  size_t pos = sqversionStr.find('-');
64  int sqversion = 0;
65  if (pos != std::string::npos && pos+1 != sqversionStr.size()) {
66  std::istringstream tmpStr(sqversionStr.substr(pos+1));
67  tmpStr >> sqversion;
68  }
69  msg(MSG::DEBUG) << sqversionStr << " : " << sqversion << endmsg;
70 
71 
72 //----------------------------------------------------------------------------------
73 // Squirrel cage rings
74 // Default (initial) ring parameters
75 //
76 // double rminInt = 1074.0*Gaudi::Units::mm;
77 // double ringThick = 4.0*Gaudi::Units::mm;
78 // double ringGap = 20.*Gaudi::Units::mm;
79 // double ringWid = 40.*Gaudi::Units::mm;
80 //
81  double rminInt = (*cage)[0]->getDouble("RINGRMIN")*Gaudi::Units::mm;
82  double ringThick = (*cage)[0]->getDouble("RINGTHICK")*Gaudi::Units::mm;
83  double ringGap = (*cage)[0]->getDouble("RINGGAP")*Gaudi::Units::mm;
84  double ringWid = (*cage)[0]->getDouble("RINGWIDTH")*Gaudi::Units::mm;
85 //
86 //--- Default (initial) z positions
87 // double zposFirstRing = 805.0*Gaudi::Units::mm+161.0*Gaudi::Units::mm;
88 // double zposGap1 = 390.*Gaudi::Units::mm;
89 // double zposGap2 = 402.*Gaudi::Units::mm;
90 // double zposGap3 = 446.*Gaudi::Units::mm;
91 // double zposGap4 = 331.*Gaudi::Units::mm;
92 //
93  double zposFirstRing = (*cage)[0]->getDouble("ZBASE")*Gaudi::Units::mm;
94  double zposGap1 = (*cage)[0]->getDouble("ZGAP1")*Gaudi::Units::mm;
95  double zposGap2 = (*cage)[0]->getDouble("ZGAP2")*Gaudi::Units::mm;
96  double zposGap3 = (*cage)[0]->getDouble("ZGAP3")*Gaudi::Units::mm;
97  double zposGap4 = (*cage)[0]->getDouble("ZGAP4")*Gaudi::Units::mm;
98 //
99 // Now support ring
100 // double rminSup = 830.0*Gaudi::Units::mm;
101 // double supThick = 90.0*Gaudi::Units::mm;
102 // double supWid = 12.0*Gaudi::Units::mm;
103 //
104  double rminSup = (*cage)[0]->getDouble("SUPRMIN")*Gaudi::Units::mm;
105  double supThick = (*cage)[0]->getDouble("SUPTHICK")*Gaudi::Units::mm;
106  double supWid = (*cage)[0]->getDouble("SUPWIDTH")*Gaudi::Units::mm;
107 //
108  double zposSupRing = zposFirstRing+ringWid*5. + zposGap1 + zposGap2 + zposGap3 + zposGap4;
109 
110 
111 
112  const GeoMaterial* ringMat = materialManager()->getMaterial((*cage)[0]->getString("MATERIAL"));
113 
114  IRDBRecordset_ptr commonParameters = rdbAccessSvc()->getRecordsetPtr("IDDetRailCommon",indetVersionKey.tag(), indetVersionKey.node());
115  if(commonParameters->size()==0)
116  commonParameters = rdbAccessSvc()->getRecordsetPtr("IDDetRailCommon","IDDetRailCommon-00");
117 
118 
119  double yRailSup = (*commonParameters)[0]->getDouble("YRAILSUP");
120  double yRailSupPart3 = (*commonParameters)[0]->getDouble("YRAILSUPPART3");
121  double gapOfRSF = (*commonParameters)[0]->getDouble("GAPOFRSF");
122 
123 
124 //Parameters of "U shape" support - these parameters aren`t in database
125 // ___________
126 // |_____2_____|
127 // | |
128 // | |
129 // |1|
130 // | |
131 // |_|_________
132 // |_____2_____|
133 //
134 
135  //double zLengthUS = 1992;
136 
137  double bUSS = 0.; double eUSS = 0.;
138  for (unsigned int i = 0; i < sctGenServices->size(); i++)
139  {
140  if ((*sctGenServices)[i]->getString("NAME") == "HSP")
141  {
142  bUSS = (*sctGenServices)[i]->getDouble("ZMAX");
143  }
144  if ((*sctGenServices)[i]->getString("NAME") == "FwdRadialServ")
145  {
146  eUSS = (*sctGenServices)[i]->getDouble("ZMIN");
147  }
148  }
149 
150  double zLengthUS = eUSS - bUSS;
151 
152  std::unique_ptr<IRDBQuery> queryUSP = rdbAccessSvc()->getQuery("IDDetRailUSP",indetVersionKey.tag(), indetVersionKey.node());
153  if(!queryUSP)
154  queryUSP = rdbAccessSvc()->getQuery("IDDetRailUSP","IDDetRailUSP-00");
155 
156  queryUSP->setOrder("USP_ID");
157  queryUSP->execute();
158 
159  queryUSP->next();
160  double xDepthUSP1 = queryUSP->data<double>("IDDETRAILUSP_DATA.XDEPTH");
161  double yWidthUSP1 = queryUSP->data<double>("IDDETRAILUSP_DATA.YWIDTH");
162 
163  queryUSP->next();
164  double xDepthUSP2 = queryUSP->data<double>("IDDETRAILUSP_DATA.XDEPTH");
165  double yWidthUSP2 = queryUSP->data<double>("IDDETRAILUSP_DATA.YWIDTH");
166 
167  queryUSP->next();
168  double xDepthUSP3 = queryUSP->data<double>("IDDETRAILUSP_DATA.XDEPTH");
169  double yWidthUSP3 = queryUSP->data<double>("IDDETRAILUSP_DATA.YWIDTH");
170 
171  queryUSP->finalize();
172 //Definition of "U shape" support
173 
174  GeoBox* UShapePart1 = new GeoBox(xDepthUSP1/2., yWidthUSP1/2., zLengthUS/2.);
175  GeoBox* UShapePart2 = new GeoBox(xDepthUSP2/2., yWidthUSP2/2., zLengthUS/2.);
176  GeoBox* UShapePart3 = new GeoBox(xDepthUSP3/2., yWidthUSP3/2., zLengthUS/2.);
177 
178  GeoTrf::Vector3D trans1UShapeP2(xDepthUSP2/2. - xDepthUSP1/2., yWidthUSP1/2. + yWidthUSP2/2., 0.);
179  GeoTrf::Vector3D trans2UShapeP2(- xDepthUSP2/2. + xDepthUSP1/2., yWidthUSP1/2. + yWidthUSP2/2., 0.);
180 
181  GeoTrf::Vector3D trans1UShapeP3(xDepthUSP3/2. - xDepthUSP1/2., - yWidthUSP1/2. - yWidthUSP3/2., 0.);
182  GeoTrf::Vector3D trans2UShapeP3(- xDepthUSP3/2. + xDepthUSP1/2., - yWidthUSP1/2. - yWidthUSP3/2., 0.);
183 
184 //Determining the exact place of "U" Shape support
185 
186  double coordY = yWidthUSP1/2. - yRailSup + (yRailSupPart3 - gapOfRSF/2.);
187 
188 //Logical Volume
189  const GeoLogVol* UShapeLP1 = new GeoLogVol("UShapeSupport1", UShapePart1, ringMat);
190  const GeoLogVol* UShapeLP2 = new GeoLogVol("UShapeSupport2", UShapePart2, ringMat);
191  const GeoLogVol* UShapeLP3 = new GeoLogVol("UShapeSupport3", UShapePart3, ringMat);
192 
193 //Physical Volume
194  GeoVPhysVol* UShapePP1 = new GeoPhysVol(UShapeLP1);
195  GeoVPhysVol* UShapePP2 = new GeoPhysVol(UShapeLP2);
196  GeoVPhysVol* UShapePP3 = new GeoPhysVol(UShapeLP3);
197 
198 //Squirrel Cage Rings
199 //Inner
200 
201  double phiICRT = asin((yWidthUSP1/2. + yWidthUSP2 + coordY) / rminInt);
202  double DphiICRT = Gaudi::Units::pi - 2*phiICRT;
203 
204  double phiICRB = asin((yWidthUSP1/2. + yWidthUSP2 - coordY) / rminInt);
205  double DphiICRB = Gaudi::Units::pi - 2*phiICRB;
206 
207  GeoTubs* ICRT = new GeoTubs(rminInt, rminInt + ringThick, ringWid/2., phiICRT, DphiICRT);
208 
209  GeoTubs* ICRB = new GeoTubs(rminInt, rminInt + ringThick, ringWid/2., Gaudi::Units::pi + phiICRB, DphiICRB);
210 
211 
212  const GeoLogVol* ICRTLog = new GeoLogVol("SQringIntTop", ICRT, ringMat);
213  GeoVPhysVol* ICRTPhys = new GeoPhysVol(ICRTLog);
214 
215  const GeoLogVol* ICRBLog = new GeoLogVol("SQringIntBottom", ICRB, ringMat);
216  GeoVPhysVol* ICRBPhys = new GeoPhysVol(ICRBLog);
217 
218 //Outer
219 
220  double phiECRT = asin((yWidthUSP1/2. + yWidthUSP2 + coordY) / (rminInt+ringGap+ringThick));
221  double DphiECRT = Gaudi::Units::pi - 2*phiECRT;
222 
223  double phiECRB = asin((yWidthUSP1/2. + yWidthUSP2 - coordY) / (rminInt+ringGap+ringThick));
224  double DphiECRB = Gaudi::Units::pi - 2*phiECRB;
225 
226 // std::cerr << "phiET: " << phiECRT << ", DphiET: " << DphiECRT << std::endl;
227 // std::cerr << "phiIT: " << phiICRT << ", DphiIT: " << DphiICRT << std::endl;
228 // std::cerr << "phiEB: " << phiECRB << ", DphiEB: " << DphiECRB << std::endl;
229 // std::cerr << "phiIB: " << phiICRB << ", DphiIB: " << DphiICRB << std::endl;
230 
231  GeoTubs* ECRT = new GeoTubs(rminInt+ringGap+ringThick, rminInt+2.*ringThick+ringGap, ringWid/2., phiECRT, DphiECRT);
232  GeoTubs* ECRB = new GeoTubs(rminInt+ringGap+ringThick, rminInt+2.*ringThick+ringGap, ringWid/2., Gaudi::Units::pi + phiECRB, DphiECRB);
233 
234  const GeoLogVol* ECRTLog = new GeoLogVol("SQringExtTop", ECRT, ringMat);
235  GeoVPhysVol* ECRTPhys = new GeoPhysVol(ECRTLog);
236 
237  const GeoLogVol* ECRBLog = new GeoLogVol("SQringExtBottom", ECRB, ringMat);
238  GeoVPhysVol* ECRBPhys = new GeoPhysVol(ECRBLog);
239 
240 //SupportRing
241  GeoTube* ringSup = new GeoTube( rminSup, rminSup+supThick, supWid/2.);
242 
243  const GeoLogVol* ringLogSup = new GeoLogVol("SQringSup",ringSup,ringMat);
244  GeoVPhysVol* ringPhysSup = new GeoPhysVol(ringLogSup);
245 
246 //Positioning and adding to geometry
247 //Rings
248 
249  GeoTrf::Translate3D servpos1(0.,0., zposFirstRing+ringWid/2.);
250  GeoTrf::Translate3D servpos2(0.,0.,-zposFirstRing-ringWid/2.);
251  GeoTrf::Translate3D servpos3(0.,0., zposFirstRing+ringWid*3./2. + zposGap1);
252  GeoTrf::Translate3D servpos4(0.,0.,-zposFirstRing-ringWid*3./2. - zposGap1);
253  GeoTrf::Translate3D servpos5(0.,0., zposFirstRing+ringWid*5./2. + zposGap1 + zposGap2);
254  GeoTrf::Translate3D servpos6(0.,0.,-zposFirstRing-ringWid*5./2. - zposGap1 - zposGap2);
255  GeoTrf::Translate3D servpos7(0.,0., zposFirstRing+ringWid*7./2. + zposGap1 + zposGap2 + zposGap3);
256  GeoTrf::Translate3D servpos8(0.,0.,-zposFirstRing-ringWid*7./2. - zposGap1 - zposGap2 - zposGap3);
257  GeoTrf::Translate3D servpos9(0.,0., zposFirstRing+ringWid*9./2. + zposGap1 + zposGap2 + zposGap3 + zposGap4);
258  GeoTrf::Translate3D servpos10(0.,0.,-zposFirstRing-ringWid*9./2. - zposGap1 - zposGap2 - zposGap3 - zposGap4);
259  GeoTransform *xform1 = new GeoTransform(servpos1);
260  GeoTransform *xform2 = new GeoTransform(servpos2);
261  GeoTransform *xform3 = new GeoTransform(servpos3);
262  GeoTransform *xform4 = new GeoTransform(servpos4);
263  GeoTransform *xform5 = new GeoTransform(servpos5);
264  GeoTransform *xform6 = new GeoTransform(servpos6);
265  GeoTransform *xform7 = new GeoTransform(servpos7);
266  GeoTransform *xform8 = new GeoTransform(servpos8);
267  GeoTransform *xform9 = new GeoTransform(servpos9);
268  GeoTransform *xform10 = new GeoTransform(servpos10);
269 
270  mother->add(xform1); mother->add(ICRTPhys); mother->add(xform1); mother->add(ECRTPhys);
271  mother->add(xform2); mother->add(ICRTPhys); mother->add(xform2); mother->add(ECRTPhys);
272  mother->add(xform3); mother->add(ICRTPhys); mother->add(xform3); mother->add(ECRTPhys);
273  mother->add(xform4); mother->add(ICRTPhys); mother->add(xform4); mother->add(ECRTPhys);
274  mother->add(xform5); mother->add(ICRTPhys); mother->add(xform5); mother->add(ECRTPhys);
275  mother->add(xform6); mother->add(ICRTPhys); mother->add(xform6); mother->add(ECRTPhys);
276  mother->add(xform7); mother->add(ICRTPhys); mother->add(xform7); mother->add(ECRTPhys);
277  mother->add(xform8); mother->add(ICRTPhys); mother->add(xform8); mother->add(ECRTPhys);
278  mother->add(xform9); mother->add(ICRTPhys); mother->add(xform9); mother->add(ECRTPhys);
279  mother->add(xform10); mother->add(ICRTPhys); mother->add(xform10); mother->add(ECRTPhys);
280 
281  mother->add(xform1); mother->add(ICRBPhys); mother->add(xform1); mother->add(ECRBPhys);
282  mother->add(xform2); mother->add(ICRBPhys); mother->add(xform2); mother->add(ECRBPhys);
283  mother->add(xform3); mother->add(ICRBPhys); mother->add(xform3); mother->add(ECRBPhys);
284  mother->add(xform4); mother->add(ICRBPhys); mother->add(xform4); mother->add(ECRBPhys);
285  mother->add(xform5); mother->add(ICRBPhys); mother->add(xform5); mother->add(ECRBPhys);
286  mother->add(xform6); mother->add(ICRBPhys); mother->add(xform6); mother->add(ECRBPhys);
287  mother->add(xform7); mother->add(ICRBPhys); mother->add(xform7); mother->add(ECRBPhys);
288  mother->add(xform8); mother->add(ICRBPhys); mother->add(xform8); mother->add(ECRBPhys);
289  mother->add(xform9); mother->add(ICRBPhys); mother->add(xform9); mother->add(ECRBPhys);
290  mother->add(xform10); mother->add(ICRBPhys); mother->add(xform10); mother->add(ECRBPhys);
291 
292 // "U Shape" support
293 
294  GeoTrf::Vector3D USSupCoordX(rminInt + xDepthUSP1/2., 0, 0);
295 
296  GeoTransform* transUSS{nullptr};
297  GeoTrf::Vector3D tmpVec(0,0,0);
298  tmpVec = USSupCoordX + GeoTrf::Vector3D(0, coordY, bUSS + zLengthUS/2.);
299  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
300  mother->add(transUSS); mother->add(UShapePP1);
301  tmpVec = USSupCoordX + GeoTrf::Vector3D(0, coordY, bUSS + zLengthUS/2.) + trans1UShapeP2;
302  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
303  mother->add(transUSS); mother->add(UShapePP2);
304  tmpVec = USSupCoordX + GeoTrf::Vector3D(0, coordY, bUSS + zLengthUS/2.) + trans1UShapeP3 ;
305  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
306  mother->add(transUSS); mother->add(UShapePP3);
307 
308  tmpVec = -USSupCoordX + GeoTrf::Vector3D(0, coordY, bUSS + zLengthUS/2.);
309  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
310  mother->add(transUSS); mother->add(UShapePP1);
311  tmpVec = -USSupCoordX + GeoTrf::Vector3D(0, coordY, bUSS + zLengthUS/2.) + trans2UShapeP2;
312  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
313  mother->add(transUSS); mother->add(UShapePP2);
314  tmpVec = -USSupCoordX + GeoTrf::Vector3D(0, coordY, bUSS + zLengthUS/2.) + trans2UShapeP3;
315  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
316  mother->add(transUSS); mother->add(UShapePP3);
317 
318  tmpVec = USSupCoordX - GeoTrf::Vector3D(0, - coordY, bUSS + zLengthUS/2.);
319  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
320  mother->add(transUSS); mother->add(UShapePP1);
321  tmpVec = USSupCoordX - GeoTrf::Vector3D(0, - coordY, bUSS + zLengthUS/2.) + trans1UShapeP2;
322  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
323  mother->add(transUSS); mother->add(UShapePP2);
324  tmpVec = USSupCoordX - GeoTrf::Vector3D(0, - coordY, bUSS + zLengthUS/2.) + trans1UShapeP3;
325  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
326  mother->add(transUSS); mother->add(UShapePP3);
327 
328  tmpVec = - USSupCoordX - GeoTrf::Vector3D(0, - coordY, bUSS + zLengthUS/2.);
329  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
330  mother->add(transUSS); mother->add(UShapePP1);
331  tmpVec = - USSupCoordX - GeoTrf::Vector3D(0, - coordY, bUSS + zLengthUS/2.) + trans2UShapeP2;
332  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
333  mother->add(transUSS); mother->add(UShapePP2);
334  tmpVec = - USSupCoordX - GeoTrf::Vector3D(0, - coordY, bUSS + zLengthUS/2.) + trans2UShapeP3;
335  transUSS = new GeoTransform(GeoTrf::Translate3D(tmpVec.x(),tmpVec.y(),tmpVec.z()));
336  mother->add(transUSS); mother->add(UShapePP3);
337 
338 
339 
340 //Support ring positioning
341 
342  GeoTrf::Translate3D suppos1(0.,0., zposSupRing+supWid/2.);
343  GeoTrf::Vector3D suppos2(0.,0.,-zposSupRing-supWid/2.);
344  GeoTransform *sform1 = new GeoTransform(suppos1);
345  GeoTransform *sform2 = new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(0,-M_PI,0),suppos2));
346  mother->add(sform1);
347  mother->add(ringPhysSup);
348  mother->add(sform2);
349  mother->add(ringPhysSup);
350  }
351  else {
352  // ______________________________________________________________________________________________________________________
353  // Geometry without ID rail
354  IRDBRecordset_ptr cage = rdbAccessSvc()->getRecordsetPtr("SquirrelCage", indetVersionKey.tag(), indetVersionKey.node());
355 
356  // Get table version
357  // This is a work around to allow running with older DB releases.
358  std::string sqversionStr = rdbAccessSvc()->getChildTag("SquirrelCage", indetVersionKey.tag(), indetVersionKey.node());
359  size_t pos = sqversionStr.find('-');
360  int sqversion = 0;
361  if (pos != std::string::npos && pos+1 != sqversionStr.size()) {
362  std::istringstream tmpStr(sqversionStr.substr(pos+1));
363  tmpStr >> sqversion;
364  }
365  msg(MSG::DEBUG) << sqversionStr << " : " << sqversion << endmsg;
366 
367 
368 //----------------------------------------------------------------------------------
369 // Squirrel cage rings
370 // Default (initial) ring parameters
371 //
372  double rminInt = 1074.0*Gaudi::Units::mm;
373  double ringThick = 4.0*Gaudi::Units::mm;
374  double ringGap = 20.*Gaudi::Units::mm;
375  double ringWid = 40.*Gaudi::Units::mm;
376 //
377  rminInt = (*cage)[0]->getDouble("RINGRMIN")*Gaudi::Units::mm;
378  ringThick = (*cage)[0]->getDouble("RINGTHICK")*Gaudi::Units::mm;
379  ringGap = (*cage)[0]->getDouble("RINGGAP")*Gaudi::Units::mm;
380  ringWid = (*cage)[0]->getDouble("RINGWIDTH")*Gaudi::Units::mm;
381 //
382 //--- Default (initial) z positions
383  double zposFirstRing = 805.0*Gaudi::Units::mm+161.0*Gaudi::Units::mm;
384  double zposGap1 = 390.*Gaudi::Units::mm;
385  double zposGap2 = 402.*Gaudi::Units::mm;
386  double zposGap3 = 446.*Gaudi::Units::mm;
387  double zposGap4 = 331.*Gaudi::Units::mm;
388 //
389  zposFirstRing = (*cage)[0]->getDouble("ZBASE")*Gaudi::Units::mm;
390  zposGap1 = (*cage)[0]->getDouble("ZGAP1")*Gaudi::Units::mm;
391  zposGap2 = (*cage)[0]->getDouble("ZGAP2")*Gaudi::Units::mm;
392  zposGap3 = (*cage)[0]->getDouble("ZGAP3")*Gaudi::Units::mm;
393  zposGap4 = (*cage)[0]->getDouble("ZGAP4")*Gaudi::Units::mm;
394 //
395 // Now support ring
396  double rminSup = 830.0*Gaudi::Units::mm;
397  double supThick = 90.0*Gaudi::Units::mm;
398  double supWid = 12.0*Gaudi::Units::mm;
399 //
400  rminSup = (*cage)[0]->getDouble("SUPRMIN")*Gaudi::Units::mm;
401  supThick = (*cage)[0]->getDouble("SUPTHICK")*Gaudi::Units::mm;
402  supWid = (*cage)[0]->getDouble("SUPWIDTH")*Gaudi::Units::mm;
403 //
404  double zposSupRing = zposFirstRing+ringWid*5. + zposGap1 + zposGap2 + zposGap3 + zposGap4;
405 //
406 // Now support ribbon
407  double ribWid = 68.0*Gaudi::Units::mm ;
408  ribWid = (*cage)[0]->getDouble("RIBWIDTH")*Gaudi::Units::mm;
409  double ribLeng = ringWid*5. + zposGap1 + zposGap2 + zposGap3 + zposGap4;
410  double ribThick = 0;
411  if (sqversion >= 3) ribThick = (*cage)[0]->getDouble("RIBTHICK")*Gaudi::Units::mm;
412  double safety =0.01;
413  double ribThickMax = ringGap - 2*safety;
414  if (ribThick == 0 || ribThick > ribThickMax) {
415  ribThick = ribThickMax;
416  }
417  double rmidRib = rminInt+ringThick+0.5*ringGap; // Place rib midway between internal and external support.
418 
419  GeoTube* ringInt = new GeoTube( rminInt, rminInt+ringThick, ringWid/2.);
420  GeoTube* ringExt = new GeoTube( rminInt+ringGap+ringThick, rminInt+2.*ringThick+ringGap, ringWid/2.);
421  GeoTube* ringSup = new GeoTube( rminSup, rminSup+supThick, supWid/2.);
422 // To avoid clashes
423 //
424 // GeoBox* ribSup = new GeoBox( ribThick/2, ribWid/2, ribLeng/2.);
425 //
426  double phiWid=ribWid/(rminInt+ringThick+ringGap/2.);
427  //GeoTubs* ribSup = new GeoTubs( rminInt+ringThick+safety, rminInt+ringGap+ringThick-safety,
428  // ribLeng/2., -phiWid/2.,phiWid);
429  GeoTubs* ribSup = new GeoTubs( rmidRib-0.5*ribThick, rmidRib+0.5*ribThick,
430  ribLeng/2., -phiWid/2.,phiWid);
431 
432 // Build the Phys Vol
433 // const GeoMaterial* ringMat = materialManager()->getMaterial("std::Aluminium");
434  const GeoMaterial* ringMat = materialManager()->getMaterial((*cage)[0]->getString("MATERIAL"));
435 // std::cout << "Squirrel cage density="<<ringMat->getDensity()<<" Rad.length="<<ringMat->getRadLength()<<'\n';
436 
437  const GeoLogVol* ringLogInt = new GeoLogVol("SQringInt",ringInt,ringMat);
438  const GeoLogVol* ringLogExt = new GeoLogVol("SQringExt",ringExt,ringMat);
439  const GeoLogVol* ringLogSup = new GeoLogVol("SQringSup",ringSup,ringMat);
440  const GeoLogVol* ribLogSup = new GeoLogVol("SQribSup" ,ribSup ,ringMat);
441  GeoVPhysVol* ringPhysInt = new GeoPhysVol(ringLogInt);
442  GeoVPhysVol* ringPhysExt = new GeoPhysVol(ringLogExt);
443  GeoVPhysVol* ringPhysSup = new GeoPhysVol(ringLogSup);
444  GeoVPhysVol* ribPhysSup = new GeoPhysVol(ribLogSup);
445 
446  GeoTrf::Translate3D servpos1(0.,0., zposFirstRing+ringWid/2.);
447  GeoTrf::Translation3D servpos2(0.,0.,-zposFirstRing-ringWid/2.);
448  GeoTrf::Translate3D servpos3(0.,0., zposFirstRing+ringWid*3./2. + zposGap1);
449  GeoTrf::Translation3D servpos4(0.,0.,-zposFirstRing-ringWid*3./2. - zposGap1);
450  GeoTrf::Translate3D servpos5(0.,0., zposFirstRing+ringWid*5./2. + zposGap1 + zposGap2);
451  GeoTrf::Translation3D servpos6(0.,0.,-zposFirstRing-ringWid*5./2. - zposGap1 - zposGap2);
452  GeoTrf::Translate3D servpos7(0.,0., zposFirstRing+ringWid*7./2. + zposGap1 + zposGap2 + zposGap3);
453  GeoTrf::Translation3D servpos8(0.,0.,-zposFirstRing-ringWid*7./2. - zposGap1 - zposGap2 - zposGap3);
454  GeoTrf::Translate3D servpos9(0.,0., zposFirstRing+ringWid*9./2. + zposGap1 + zposGap2 + zposGap3 + zposGap4);
455  GeoTrf::Translation3D servpos10(0.,0.,-zposFirstRing-ringWid*9./2. - zposGap1 - zposGap2 - zposGap3 - zposGap4);
456  GeoTransform *xform1 = new GeoTransform(servpos1);
457  GeoTransform *xform2 = new GeoTransform(GeoTrf::Transform3D(servpos2*GeoTrf::RotateY3D(M_PI)));
458  GeoTransform *xform3 = new GeoTransform(servpos3);
459  GeoTransform *xform4 = new GeoTransform(GeoTrf::Transform3D(servpos4*GeoTrf::RotateY3D(M_PI)));
460  GeoTransform *xform5 = new GeoTransform(servpos5);
461  GeoTransform *xform6 = new GeoTransform(GeoTrf::Transform3D(servpos6*GeoTrf::RotateY3D(M_PI)));
462  GeoTransform *xform7 = new GeoTransform(servpos7);
463  GeoTransform *xform8 = new GeoTransform(GeoTrf::Transform3D(servpos8*GeoTrf::RotateY3D(M_PI)));
464  GeoTransform *xform9 = new GeoTransform(servpos9);
465  GeoTransform *xform10 = new GeoTransform(GeoTrf::Transform3D(servpos10*GeoTrf::RotateY3D(M_PI)));
466  mother->add(xform1);
467  mother->add(ringPhysInt);
468  mother->add(xform1);
469  mother->add(ringPhysExt);
470  mother->add(xform2);
471  mother->add(ringPhysInt);
472  mother->add(xform2);
473  mother->add(ringPhysExt);
474  mother->add(xform3);
475  mother->add(ringPhysInt);
476  mother->add(xform3);
477  mother->add(ringPhysExt);
478  mother->add(xform4);
479  mother->add(ringPhysInt);
480  mother->add(xform4);
481  mother->add(ringPhysExt);
482  mother->add(xform5);
483  mother->add(ringPhysInt);
484  mother->add(xform5);
485  mother->add(ringPhysExt);
486  mother->add(xform6);
487  mother->add(ringPhysInt);
488  mother->add(xform6);
489  mother->add(ringPhysExt);
490  mother->add(xform7);
491  mother->add(ringPhysInt);
492  mother->add(xform7);
493  mother->add(ringPhysExt);
494  mother->add(xform8);
495  mother->add(ringPhysInt);
496  mother->add(xform8);
497  mother->add(ringPhysExt);
498  mother->add(xform9);
499  mother->add(ringPhysInt);
500  mother->add(xform9);
501  mother->add(ringPhysExt);
502  mother->add(xform10);
503  mother->add(ringPhysInt);
504  mother->add(xform10);
505  mother->add(ringPhysExt);
506 
507 //Support ring positioning
508 
509  GeoTrf::Translate3D suppos1(0.,0., zposSupRing+supWid/2.);
510  GeoTrf::Translation3D suppos2(0.,0.,-zposSupRing-supWid/2.);
511  GeoTransform *sform1 = new GeoTransform(suppos1);
512  GeoTransform *sform2 = new GeoTransform(GeoTrf::Transform3D(suppos2*GeoTrf::RotateY3D(M_PI)));
513  mother->add(sform1);
514  mother->add(ringPhysSup);
515  mother->add(sform2);
516  mother->add(ringPhysSup);
517 
518 //Support ribbon positioning
519 
520 
521  GeoTrf::Translate3D ribpos1( 0., 0., zposFirstRing+ribLeng/2.);
522  GeoTrf::Translate3D ribpos2( 0., 0.,-zposFirstRing-ribLeng/2.);
523  GeoTransform *rform1 = new GeoTransform(ribpos1);
524  GeoTransform *rform2 = new GeoTransform(ribpos1*GeoTrf::RotateZ3D(M_PI));
525  GeoTransform *rform3 = new GeoTransform(ribpos2);
526  GeoTransform *rform4 = new GeoTransform(ribpos2*GeoTrf::RotateZ3D(M_PI));
527 
528 
529  mother->add(rform1);
530  mother->add(ribPhysSup);
531  mother->add(rform2);
532  mother->add(ribPhysSup);
533  mother->add(rform3);
534  mother->add(ribPhysSup);
535  mother->add(rform4);
536  mother->add(ribPhysSup);
537 
538 // std::cout << "End of SquirrelCage building !!!" << zposFirstRing<< '\n';
539 //----------------------------------------------------------------------------------
540 
541  }
542 }
543 
544 
IRDBQuery::setOrder
virtual void setOrder(const std::string &)=0
IRDBAccessSvc::getQuery
virtual std::unique_ptr< IRDBQuery > getQuery(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
InDetDD::AthenaComps
Class to hold various Athena components.
Definition: InDetDDAthenaComps.h:21
SquirrelCageFactory::~SquirrelCageFactory
~SquirrelCageFactory()
Definition: SquirrelCageFactory.cxx:40
M_PI
#define M_PI
Definition: ActiveFraction.h:11
DecodeVersionKey::node
const std::string & node() const
Return the version node.
Definition: DecodeVersionKey.cxx:97
pi
#define pi
Definition: TileMuonFitter.cxx:65
IRDBQuery.h
GeoPrimitives.h
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
IRDBAccessSvc::getChildTag
virtual std::string getChildTag(const std::string &childNode, const std::string &parentTag, const std::string &parentNode, const std::string &connName="ATLASDD")=0
Gets the tag name for the node by giving its parent node tag.
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
DecodeVersionKey::tag
const std::string & tag() const
Return version tag.
Definition: DecodeVersionKey.cxx:91
SquirrelCageFactory::SquirrelCageFactory
SquirrelCageFactory(InDetDD::AthenaComps *athenaComps, InDetMaterialManager *matManager)
Definition: SquirrelCageFactory.cxx:33
InDetDD::SubDetectorFactoryBase::rdbAccessSvc
IRDBAccessSvc * rdbAccessSvc()
Definition: InDetSubDetectorFactoryBase.h:43
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
InDetMaterialManager
InDetMaterialManager.
Definition: InDetMaterialManager.h:34
InDetMaterialManager.h
InDetDD::SubDetectorFactoryBase::geoDbTagSvc
const IGeoDbTagSvc * geoDbTagSvc() const
Definition: InDetSubDetectorFactoryBase.h:41
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
DecodeVersionKey.h
IRDBQuery::finalize
virtual void finalize()=0
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
InDetDD::SubDetectorFactoryBase::msg
MsgStream & msg(MSG::Level lvl) const
Definition: InDetSubDetectorFactoryBase.h:50
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
SquirrelCageFactory::create
void create(GeoPhysVol *mother)
Definition: SquirrelCageFactory.cxx:47
IRDBQuery::data
const T & data(const std::string &)
Definition: IRDBQuery.h:35
DEBUG
#define DEBUG
Definition: page_access.h:11
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
InDetDD::SubDetectorFactoryBase::materialManager
InDetMaterialManager * materialManager()
Definition: InDetSubDetectorFactoryBase.h:47
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
IRDBQuery::next
virtual bool next()=0
InDetMaterialManager::getMaterial
const GeoMaterial * getMaterial(const std::string &materialName)
Get material. First looks for locally defined material and if not found looks in GeoModel material ma...
Definition: InDetMaterialManager.cxx:96
checker_macros.h
Define macros for attributes used to control the static checker.
IRDBQuery::execute
virtual void execute()=0
IGeoDbTagSvc.h
SquirrelCageFactory.h