ATLAS Offline Software
SCT_ServMatFactory.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 "SCT_ServMatFactory.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/GeoShapeSubtraction.h"
17 
21 
25 
28 #include "GaudiKernel/SystemOfUnits.h"
29 
31 
32 #include <sstream>
33 #include <iostream>
34 
36  : InDetDD::SubDetectorFactoryBase(athenaComps)
37 {
38 }
39 
41 {
42 }
43 
44 
45 
46 //## Other Operations (implementation)
47 void SCT_ServMatFactory::create(GeoPhysVol *mother)
48 {
49 
50  msg(MSG::DEBUG) << "Building SCT Service Material" << endmsg;
51 
52  DecodeVersionKey atlasVersionKey(geoDbTagSvc(),"ATLAS");
53  DecodeVersionKey indetVersionKey(geoDbTagSvc(),"InnerDetector");
54  DecodeVersionKey sctVersionKey(geoDbTagSvc(),"SCT");
55 
56  std::string railversion = rdbAccessSvc()->getChildTag("IDDetailedRail",indetVersionKey.tag(),indetVersionKey.node());
57  if(!railversion.empty()) {
58  // ______________________________________________________________________________________________________________________
59  // Geometry with ID rail
60 
61  IRDBRecordset_ptr atls = rdbAccessSvc()->getRecordsetPtr("AtlasMother", atlasVersionKey.tag(), atlasVersionKey.node());
62  IRDBRecordset_ptr sctGenServices = rdbAccessSvc()->getRecordsetPtr("SCTGenServices", indetVersionKey.tag(), indetVersionKey.node());
63  IRDBRecordset_ptr sctsup = rdbAccessSvc()->getRecordsetPtr("SCTSupport", indetVersionKey.tag(), indetVersionKey.node());
64  IRDBRecordset_ptr weightTable = rdbAccessSvc()->getRecordsetPtr("SctWeights", sctVersionKey.tag(), sctVersionKey.node());
65  IRDBRecordset_ptr scalingTable = rdbAccessSvc()->getRecordsetPtr("InDetServMatScaling", indetVersionKey.tag(), indetVersionKey.node());
66  IRDBRecordset_ptr cage = rdbAccessSvc()->getRecordsetPtr("SquirrelCage", atlasVersionKey.tag(), atlasVersionKey.node());
67 
68  // Get the InDet material manager. This is a wrapper around the geomodel one with some extra functionality to deal
69  // with weights table.
70  m_materialManagerUnique = std::make_unique<InDetMaterialManager>("SCT_MaterialManager", getAthenaComps());
72  m_materialManager->addWeightTable(weightTable, "sct");
73  m_materialManager->addScalingTable(scalingTable);
74 
75  //------------------------------------------
76  //VK 10/09/2005 Construct a gap for rails
77  double outROfIDet = (*atls)[0]->getDouble("IDETOR")*Gaudi::Units::cm;
78  double endZOfIDet = (*atls)[0]->getDouble("IDETZMX")*Gaudi::Units::cm;
79  // double minRofGap = 1050.0*Gaudi::Units::mm;
80  // double minRofGap = 1110.0*Gaudi::Units::mm;
81  double minRofGap = 1089.0*Gaudi::Units::mm;
82  double phiWid=(70.*Gaudi::Units::mm)/outROfIDet;
83  // std::cout << "Gap phiWid = " << phiWid << std::endl;
84  double safetyGap=1.*Gaudi::Units::mm;
85 
86  //created by Adam Agocs
87 
88  double rminInt = (*cage)[0]->getDouble("RINGRMIN");
89 
90  IRDBRecordset_ptr commonParameters = rdbAccessSvc()->getRecordsetPtr("IDDetRailCommon",indetVersionKey.tag(), indetVersionKey.node());
91  if(commonParameters->size()==0)
92  commonParameters = rdbAccessSvc()->getRecordsetPtr("IDDetRailCommon","IDDetRailCommon-00");
93 
94  double yWidthUSP1 = (*commonParameters)[0]->getDouble("YWIDTHUSP1");
95  double yRailSup = (*commonParameters)[0]->getDouble("YRAILSUP");
96  double yRailSupPart3 = (*commonParameters)[0]->getDouble("YRAILSUPPART3");
97  double gapOfRSF = (*commonParameters)[0]->getDouble("GAPOFRSF");
98  double yWidthTRSB = (*commonParameters)[0]->getDouble("YWIDTHTRSB");
99 
100  double coordY = yWidthUSP1/2. - yRailSup + (yRailSupPart3 - gapOfRSF/2.);
101 
102  double phiTop = asin((yWidthTRSB + coordY) / (rminInt));
103  double phiBot = asin((yWidthTRSB/2. - coordY) / (rminInt));
104 
105  GeoIntrusivePtr<const GeoShape> railGap1{new GeoTubs( rminInt, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
106  -phiBot, phiBot + phiTop)};
107  GeoIntrusivePtr<const GeoShape> railGap2{new GeoTubs( rminInt, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
108  -phiTop + M_PI, phiBot + phiTop)};
109  GeoIntrusivePtr<const GeoShape> railGap12{new GeoTubs( rminInt, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
110  -phiTop, phiBot + phiTop)}; //because of asymmetry
111 
112  // Build general services:
113  //
114  std::string NameOfService;
115  for (unsigned int ii =0; ii < sctGenServices->size(); ii++) {
116 
117  NameOfService = (*sctGenServices)[ii]->getString("NAME");
118  InDetDD::GenericTubeMaker tubeHelper((*sctGenServices)[ii]);
119 
120  const GeoShape * serviceTubeTmp = tubeHelper.buildShape();
121 
122  std::string logName = tubeHelper.name();
123  if (logName.empty()) {
124  std::ostringstream o; o << ii;
125  logName = "ServMat"+o.str();
126  }
127  logName = "Sct" + logName;
128 
129  double volumeCut = 0;
130  const GeoShape* serviceTube = serviceTubeTmp;
131  const GeoShape* serviceTube2 = serviceTubeTmp; //because of asymmetry
132  if( tubeHelper.volData().maxRadius() > minRofGap && tubeHelper.volData().phiStart()*Gaudi::Units::radian < phiTop) {
133  // Subtract RailGap out of services
134  if (NameOfService == "PPB1EFEG" || NameOfService == "CableTrayEFEG")
135  {
136  serviceTube = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap1);
137  serviceTube2 = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap12);
138  }
139  else
140  serviceTube = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap2).subtract(*railGap1);
141 
142  // GeoModel doesn't calculate volume correctly so we calculate the cutout volume.
143  // This is only correct for tube volumes. The only non tube volume currently is the HSP
144  // which is a radial volume. The cut out for this though is not very significant so we ignore it.
145  if ( tubeHelper.volData().shape() == InDetDD::TubeVolData::TUBE || tubeHelper.volData().shape() == InDetDD::TubeVolData::TUBS) {
146  double rminCut = std::max(minRofGap, tubeHelper.volData().rmin());
147  double rmaxCut = tubeHelper.volData().maxRadius();
148  volumeCut = 0.5*phiWid*(rmaxCut+rminCut)*(rmaxCut-rminCut) * tubeHelper.volData().length();
149  if( tubeHelper.volData().shape() == InDetDD::TubeVolData::TUBE) {volumeCut *= 2.;}
150  }
151  }
152 
153  std::string materialName = tubeHelper.materialName();
154  // std::cout<< "logName " << logName << std::endl;
155  // std::cout << " serviceTube->volume() " << serviceTube->volume() << std::endl;
156  // std::cout << " serviceTubeTmp->volume() " << serviceTubeTmp->volume() << std::endl;
157  // std::cout << " serviceTubeTmp->volume() - volumeCut = " << serviceTubeTmp->volume() - volumeCut << std::endl;
158  //const GeoMaterial* material = m_materialManager->getMaterialForVolume(materialName, serviceTube->volume());
159  const GeoMaterial* material = m_materialManager->getMaterialForVolume(materialName, serviceTubeTmp->volume()-volumeCut);
160 
161  const GeoLogVol* servLog = new GeoLogVol(logName,serviceTube,material);
162  GeoVPhysVol* servPhys = new GeoPhysVol(servLog);
163 
164  if (NameOfService == "PPB1EFEG" || NameOfService == "CableTrayEFEG")
165  {
166  const GeoLogVol* serv2Log = new GeoLogVol(logName,serviceTube2,material);
167  GeoVPhysVol* serv2Phys = new GeoPhysVol(serv2Log);
168 
169  GeoTrf::TranslateZ3D trans(tubeHelper.volData().zMid());
170  GeoTrf::TranslateZ3D trans2(-tubeHelper.volData().zMid());
171 
172  GeoTransform * xform1 = new GeoTransform(trans);
173  GeoTransform * xform1Neg = new GeoTransform(trans2);
174  GeoTransform * xform2 = new GeoTransform(GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*trans);
175  GeoTransform * xform2Neg = new GeoTransform(GeoTrf::RotateZ3D(180*Gaudi::Units::deg)*trans2);
176 
177 // std::cerr << xform1 << std::endl << xform1Neg << std::endl << xform2 << std::endl << xform2Neg << std::endl;
178 
179  mother->add(xform1); mother->add(servPhys); mother->add(xform1Neg); mother->add(servPhys);
180  mother->add(xform2); mother->add(serv2Phys); mother->add(xform2Neg); mother->add(serv2Phys);
181  }
182  else
183  tubeHelper.placeVolume(mother, servPhys);
184 
185  }
186 
187  //-------------------------------------------------------------------------------------------
188  // SCT supports (wings,mechanisms)
189 
190  // Variable: NameOfMaterial is created by Adam Agocs
191  // if (NameOfMaterial != "sct::FwdMechanism") statment is creadted by Adam Agocs to
192  // avoid overlapping with "U" shape support - SupportRailFactory.cxx
193  {
194  double RMinW, RMaxW, ZHalfLengthW, ZStartW, WidI, WidO, DPhi;
195  std::string matName,logName;
196 
197  std::string NameOfMaterial;
198 
199  for (unsigned int ii =0; ii < sctsup->size(); ii++) {
200 
201  RMinW = (*sctsup)[ii]->getFloat("RMIN")*Gaudi::Units::mm;
202  RMaxW = (*sctsup)[ii]->getFloat("RMAX")*Gaudi::Units::mm;
203  ZHalfLengthW = (*sctsup)[ii]->getFloat("THICK")/2.*Gaudi::Units::mm;
204  WidI = (*sctsup)[ii]->getFloat("WIDTHINNER")*Gaudi::Units::mm;
205  WidO = (*sctsup)[ii]->getFloat("WIDTHOUTER")*Gaudi::Units::mm;
206  ZStartW = (*sctsup)[ii]->getFloat("ZSTART")*Gaudi::Units::mm;
207  NameOfMaterial = (*sctsup)[ii]->getString("MATERIAL");
208  DPhi = asin(WidI/2./RMinW);
209 
210  if (NameOfMaterial != "sct::FwdMechanism")
211  {
212  const GeoShape* pTub1 = new GeoTubs(RMinW, RMaxW, ZHalfLengthW, 0.-DPhi, 2.*DPhi); //Basic shape
213  const GeoShape* wing = pTub1;
214 
215  double wingVolume = -1;
216  if (WidI > WidO) { // Subtraction for wings
217  double H1=sqrt(RMinW*RMinW - WidI*WidI/4.);
218  double H2=sqrt(RMaxW*RMaxW - WidO*WidO/4.);
219  double Shift = H1 + (H2-H1)*WidI/(WidI-WidO);
220  double RMaxDop = sqrt(WidI*WidI/4. + (Shift-H1)*(Shift-H1));
221  // double DPhiDop = asin(WidI/2./(Shift-H1));
222  double DPhiDop = atan(WidI/2./(Shift-H1));
223  const GeoShape* pTub2 = new GeoTubs(0., RMaxDop, ZHalfLengthW, M_PI-DPhiDop, 2.*DPhiDop);
224  const GeoShape* pTub3 = (GeoShape*) & ((*pTub2) << GeoTrf::TranslateX3D(Shift));
225  wing = (GeoShape*) & (*pTub1).intersect(*pTub3);
226 
227  // GeoModel calculates the volume incorrectly so we calculate it here.
228  // Volume can be calculated as a trapezoid with an upper circle segment added and a lower one subtracted
229  double trapArea = 0.5 * (H2-H1)*(WidI+WidO);
230  double upperSeg = atan(0.5*WidO/H2)*RMaxW*RMaxW - 0.5*H2*WidO;
231  double lowerSeg = atan(0.5*WidI/H1)*RMinW*RMinW - 0.5*H1*WidI;
232  wingVolume = (trapArea + upperSeg - lowerSeg) * 2 * ZHalfLengthW;
233  // std::cout << "New wing volume = " << wingVolume << std::endl;
234  }
235 
236  matName = (*sctsup)[ii]->getString("MATERIAL");
237  logName = "SctSupportGeneral";
238  std::string newMatName; // If newMatName is empty, will not rename.
239  std::ostringstream o; o << ii;
240  if(matName.find("rWing") != std::string::npos) logName="FwdRearWing";
241  if(matName.find("tWing") != std::string::npos) logName="FwdFrontWing";
242  if(matName.find("Mech") != std::string::npos) {
243  logName="FwdMechanism"+o.str();
244  newMatName = matName + o.str(); // There are two FwdMechanism volumes with different volumes so we need to rename material.
245  }
246 
247  if (wingVolume < 0) wingVolume = wing->volume();
248  //std::cout << " wing->volume() " << wing->volume() << std::endl;
249  //std::cout << " New wing volume = " << wingVolume << std::endl;
250 
251  const GeoMaterial* wingMat = m_materialManager->getMaterialForVolume(matName, wingVolume, newMatName);
252 
253  //std::cout<<logName<<", "<<matName<<", "<<wingMat->getName()<<'\n';
254 
255  const GeoLogVol* wingLog = new GeoLogVol(logName,wing,wingMat);
256  GeoVPhysVol* wingPhys = new GeoPhysVol(wingLog);
257  GeoTransform* wPos1 = new GeoTransform(GeoTrf::Translate3D(0.,0., ZStartW+ZHalfLengthW));
258  GeoTransform* wPos2 = new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(-M_PI,0,0),GeoTrf::Vector3D(0.,0., ZStartW+ZHalfLengthW)));
259  GeoTransform* wPos3 = new GeoTransform(GeoTrf::Translate3D(0.,0.,-ZStartW-ZHalfLengthW));
260  GeoTransform* wPos4 = new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(-M_PI,0,0),GeoTrf::Vector3D(0.,0.,-ZStartW-ZHalfLengthW)));
261  mother->add(wPos1);
262  mother->add(wingPhys);
263  mother->add(wPos2);
264  mother->add(wingPhys);
265  mother->add(wPos3);
266  mother->add(wingPhys);
267  mother->add(wPos4);
268  mother->add(wingPhys);
269  }
270  }
271  }
272  }
273  else {
274  // ______________________________________________________________________________________________________________________
275  // Geometry without ID rail
276  IRDBRecordset_ptr atls = rdbAccessSvc()->getRecordsetPtr("AtlasMother", atlasVersionKey.tag(), atlasVersionKey.node());
277  IRDBRecordset_ptr sctGenServices = rdbAccessSvc()->getRecordsetPtr("SCTGenServices", indetVersionKey.tag(), indetVersionKey.node());
278  IRDBRecordset_ptr sctsup = rdbAccessSvc()->getRecordsetPtr("SCTSupport", indetVersionKey.tag(), indetVersionKey.node());
279  IRDBRecordset_ptr weightTable = rdbAccessSvc()->getRecordsetPtr("SctWeights", sctVersionKey.tag(), sctVersionKey.node());
280  IRDBRecordset_ptr scalingTable = rdbAccessSvc()->getRecordsetPtr("InDetServMatScaling", indetVersionKey.tag(), indetVersionKey.node());
281 
282  // Get the InDet material manager. This is a wrapper around the geomodel one with some extra functionality to deal
283  // with weights table.
284  m_materialManager = new InDetMaterialManager("SCT_MaterialManager", getAthenaComps());
285  m_materialManager->addWeightTable(weightTable, "sct");
286  m_materialManager->addScalingTable(scalingTable);
287 
288  //------------------------------------------
289  //VK 10/09/2005 Construct a gap for rails
290  double outROfIDet = (*atls)[0]->getDouble("IDETOR")*Gaudi::Units::cm;
291  double endZOfIDet = (*atls)[0]->getDouble("IDETZMX")*Gaudi::Units::cm;
292  // double minRofGap = 1050.0*Gaudi::Units::mm;
293  // double minRofGap = 1110.0*Gaudi::Units::mm;
294  double minRofGap = 1089.0*Gaudi::Units::mm;
295  double phiWid=(70.*Gaudi::Units::mm)/outROfIDet;
296  // std::cout << "Gap phiWid = " << phiWid << std::endl;
297  double safetyGap=1.*Gaudi::Units::mm;
298  GeoIntrusivePtr<const GeoShape> railGap1{new GeoTubs( minRofGap, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
299  -phiWid/2.,phiWid)};
300  GeoIntrusivePtr<const GeoShape> railGap2{new GeoTubs( minRofGap, outROfIDet+safetyGap ,endZOfIDet+safetyGap ,
301  -phiWid/2.+M_PI,phiWid)};
302 
303 
304  // Build general services:
305  //
306  for (unsigned int ii =0; ii < sctGenServices->size(); ii++) {
307 
308  InDetDD::GenericTubeMaker tubeHelper((*sctGenServices)[ii]);
309  const GeoShape * serviceTubeTmp = tubeHelper.buildShape();
310 
311  std::string logName = tubeHelper.name();
312  if (logName.empty()) {
313  std::ostringstream o; o << ii;
314  logName = "ServMat"+o.str();
315  }
316  logName = "Sct" + logName;
317 
318  double volumeCut = 0;
319  const GeoShape* serviceTube = serviceTubeTmp;
320  if( tubeHelper.volData().maxRadius() > minRofGap && tubeHelper.volData().phiStart() < phiWid/2.) {
321  // Subtract RailGap out of services
322  serviceTube = (GeoShape*) & (*serviceTubeTmp).subtract(*railGap2).subtract(*railGap1);
323 
324  // GeoModel doesn't calculate volume correctly so we calculate the cutout volume.
325  // This is only correct for tube volumes. The only non tube volume currently is the HSP
326  // which is a radial volume. The cut out for this though is not very significant so we ignore it.
327  if ( tubeHelper.volData().shape() == InDetDD::TubeVolData::TUBE || tubeHelper.volData().shape() == InDetDD::TubeVolData::TUBS) {
328  double rminCut = std::max(minRofGap, tubeHelper.volData().rmin());
329  double rmaxCut = tubeHelper.volData().maxRadius();
330  volumeCut = 0.5*phiWid*(rmaxCut+rminCut)*(rmaxCut-rminCut) * tubeHelper.volData().length();
331  if( tubeHelper.volData().shape() == InDetDD::TubeVolData::TUBE) {volumeCut *= 2.;}
332  }
333  }
334 
335  std::string materialName = tubeHelper.materialName();
336  // std::cout<< "logName " << logName << std::endl;
337  // std::cout << " serviceTube->volume() " << serviceTube->volume() << std::endl;
338  // std::cout << " serviceTubeTmp->volume() " << serviceTubeTmp->volume() << std::endl;
339  // std::cout << " serviceTubeTmp->volume() - volumeCut = " << serviceTubeTmp->volume() - volumeCut << std::endl;
340  //const GeoMaterial* material = materialManager()->getMaterialForVolume(materialName, serviceTube->volume());
341  const GeoMaterial* material = materialManager()->getMaterialForVolume(materialName, serviceTubeTmp->volume()-volumeCut);
342 
343  const GeoLogVol* servLog = new GeoLogVol(logName,serviceTube,material);
344  GeoVPhysVol* servPhys = new GeoPhysVol(servLog);
345 
346  tubeHelper.placeVolume(mother, servPhys);
347 
348  }
349  //-------------------------------------------------------------------------------------------
350  // SCT supports (wings,mechanisms)
351  {
352  double RMinW, RMaxW, ZHalfLengthW, ZStartW, WidI, WidO, DPhi;
353  std::string matName,logName;
354 
355  for (unsigned int ii =0; ii < sctsup->size(); ii++) {
356 
357  RMinW = (*sctsup)[ii]->getFloat("RMIN")*Gaudi::Units::mm;
358  RMaxW = (*sctsup)[ii]->getFloat("RMAX")*Gaudi::Units::mm;
359  ZHalfLengthW = (*sctsup)[ii]->getFloat("THICK")/2.*Gaudi::Units::mm;
360  WidI = (*sctsup)[ii]->getFloat("WIDTHINNER")*Gaudi::Units::mm;
361  WidO = (*sctsup)[ii]->getFloat("WIDTHOUTER")*Gaudi::Units::mm;
362  ZStartW = (*sctsup)[ii]->getFloat("ZSTART")*Gaudi::Units::mm;
363  DPhi = asin(WidI/2./RMinW);
364 
365  const GeoShape* pTub1 = new GeoTubs(RMinW, RMaxW, ZHalfLengthW, 0.-DPhi, 2.*DPhi); //Basic shape
366  const GeoShape* wing = pTub1;
367 
368  double wingVolume = -1;
369  if (WidI > WidO) { // Subtraction for wings
370  double H1=sqrt(RMinW*RMinW - WidI*WidI/4.);
371  double H2=sqrt(RMaxW*RMaxW - WidO*WidO/4.);
372  double Shift = H1 + (H2-H1)*WidI/(WidI-WidO);
373  double RMaxDop = sqrt(WidI*WidI/4. + (Shift-H1)*(Shift-H1));
374  // double DPhiDop = asin(WidI/2./(Shift-H1));
375  double DPhiDop = atan(WidI/2./(Shift-H1));
376  const GeoShape* pTub2 = new GeoTubs(0., RMaxDop, ZHalfLengthW, M_PI-DPhiDop, 2.*DPhiDop);
377  const GeoShape* pTub3 = (GeoShape*) & ((*pTub2) << GeoTrf::TranslateX3D(Shift));
378  wing = (GeoShape*) & (*pTub1).intersect(*pTub3);
379 
380  // GeoModel calculates the volume incorrectly so we calculate it here.
381  // Volume can be calculated as a trapezoid with an upper circle segment added and a lower one subtracted
382  double trapArea = 0.5 * (H2-H1)*(WidI+WidO);
383  double upperSeg = atan(0.5*WidO/H2)*RMaxW*RMaxW - 0.5*H2*WidO;
384  double lowerSeg = atan(0.5*WidI/H1)*RMinW*RMinW - 0.5*H1*WidI;
385  wingVolume = (trapArea + upperSeg - lowerSeg) * 2 * ZHalfLengthW;
386  // std::cout << "New wing volume = " << wingVolume << std::endl;
387  }
388 
389  matName = (*sctsup)[ii]->getString("MATERIAL");
390  logName = "SctSupportGeneral";
391  std::string newMatName; // If newMatName is empty, will not rename.
392  std::ostringstream o; o << ii;
393  if(matName.find("rWing") != std::string::npos) logName="FwdRearWing";
394  if(matName.find("tWing") != std::string::npos) logName="FwdFrontWing";
395  if(matName.find("Mech") != std::string::npos) {
396  logName="FwdMechanism"+o.str();
397  newMatName = matName + o.str(); // There are two FwdMechanism volumes with different volumes so we need to rename material.
398  }
399 
400  if (wingVolume < 0) wingVolume = wing->volume();
401  //std::cout << " wing->volume() " << wing->volume() << std::endl;
402  //std::cout << " New wing volume = " << wingVolume << std::endl;
403 
404  const GeoMaterial* wingMat = materialManager()->getMaterialForVolume(matName, wingVolume, newMatName);
405 
406  //std::cout<<logName<<", "<<matName<<", "<<wingMat->getName()<<'\n';
407 
408  const GeoLogVol* wingLog = new GeoLogVol(logName,wing,wingMat);
409  GeoVPhysVol* wingPhys = new GeoPhysVol(wingLog);
410  GeoTransform* wPos1 = new GeoTransform(GeoTrf::Translate3D(0.,0., ZStartW+ZHalfLengthW));
411  GeoTransform* wPos2 = new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translation3D(0.,0., ZStartW+ZHalfLengthW)*GeoTrf::RotateX3D(M_PI)));
412  GeoTransform* wPos3 = new GeoTransform(GeoTrf::Translate3D(0.,0.,-ZStartW-ZHalfLengthW));
413  GeoTransform* wPos4 = new GeoTransform(GeoTrf::Transform3D(GeoTrf::Translation3D(0.,0.,-ZStartW-ZHalfLengthW)*GeoTrf::RotateX3D(M_PI)));
414  mother->add(wPos1);
415  mother->add(wingPhys);
416  mother->add(wPos2);
417  mother->add(wingPhys);
418  mother->add(wPos3);
419  mother->add(wingPhys);
420  mother->add(wPos4);
421  mother->add(wingPhys);
422  }
423  }
424  }
425 }
InDetDD::GenericTubeMaker::buildShape
const GeoShape * buildShape()
Definition: GenericTubeMaker.cxx:37
InDetMaterialManager::addWeightTable
void addWeightTable(const IRDBRecordset_ptr &weightTable, const std::string &space="")
Definition: InDetMaterialManager.cxx:321
max
#define max(a, b)
Definition: cfImp.cxx:41
InDetDD::GenericTubeMaker
Definition: GenericTubeMaker.h:29
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
InDetDD::TubeVolData::TUBS
@ TUBS
Definition: TubeVolData.h:19
M_PI
#define M_PI
Definition: ActiveFraction.h:11
deg
#define deg
Definition: SbPolyhedron.cxx:17
InDetDD::SubDetectorFactoryBase::getAthenaComps
InDetDD::AthenaComps * getAthenaComps()
Definition: InDetSubDetectorFactoryBase.h:55
DecodeVersionKey::node
const std::string & node() const
Return the version node.
Definition: DecodeVersionKey.cxx:97
H2
#define H2(x, y, z)
Definition: MD5.cxx:115
InDetDD::GenericTubeMaker::materialName
std::string materialName() const
Definition: GenericTubeMaker.cxx:27
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
InDetDD::GenericTubeMaker::name
std::string name() const
Definition: GenericTubeMaker.cxx:32
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
GeoPrimitives.h
python.SystemOfUnits.radian
int radian
Definition: SystemOfUnits.py:104
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
InDetDD::SubDetectorFactoryBase::m_materialManager
InDetMaterialManager * m_materialManager
Definition: InDetSubDetectorFactoryBase.h:61
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.
InDetDD::TubeVolData::length
double length() const
Definition: TubeVolData.h:26
SCT_ServMatFactory::~SCT_ServMatFactory
~SCT_ServMatFactory()
Definition: SCT_ServMatFactory.cxx:40
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
InDetMaterialManager::getMaterialForVolume
const GeoMaterial * getMaterialForVolume(const std::string &materialName, double volume, const std::string &newName="")
Create and get material with a density calculated to give weight in predefined weight table.
Definition: InDetMaterialManager.cxx:460
DecodeVersionKey::tag
const std::string & tag() const
Return version tag.
Definition: DecodeVersionKey.cxx:91
InDetDD::SubDetectorFactoryBase::rdbAccessSvc
IRDBAccessSvc * rdbAccessSvc()
Definition: InDetSubDetectorFactoryBase.h:43
InDetDD::TubeVolData::TUBE
@ TUBE
Definition: TubeVolData.h:19
SCT_ServMatFactory::create
void create(GeoPhysVol *mother)
Definition: SCT_ServMatFactory.cxx:47
GenericTubeMaker.h
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
InDetDD::TubeVolData::phiStart
double phiStart() const
Definition: TubeVolData.h:28
InDetDD::GenericTubeMaker::volData
const TubeVolData & volData() const
Definition: GenericTubeMaker.h:32
InDetDD::SubDetectorFactoryBase::m_materialManagerUnique
std::unique_ptr< InDetMaterialManager > m_materialManagerUnique
Definition: InDetSubDetectorFactoryBase.h:63
InDetDD::TubeVolData::shape
VolShape shape() const
Definition: TubeVolData.h:35
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetMaterialManager::addScalingTable
void addScalingTable(const IRDBRecordset_ptr &scalingTable)
Definition: InDetMaterialManager.cxx:431
DecodeVersionKey.h
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
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
InDetDD::TubeVolData::rmin
double rmin() const
Definition: TubeVolData.h:22
SCT_ServMatFactory::SCT_ServMatFactory
SCT_ServMatFactory(InDetDD::AthenaComps *athenaComps)
Definition: SCT_ServMatFactory.cxx:35
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
SCT_ServMatFactory.h
checker_macros.h
Define macros for attributes used to control the static checker.
Shift
@ Shift
Definition: CMAparameters.h:19
InDetDD::GenericTubeMaker::placeVolume
void placeVolume(GeoPhysVol *parent, GeoVPhysVol *child, double zParent=0)
Definition: GenericTubeMaker.cxx:75
InDetDD::TubeVolData::maxRadius
double maxRadius() const
Definition: TubeVolData.cxx:20
TubeVolData.h
IGeoDbTagSvc.h
InDetDD::TubeVolData::zMid
double zMid() const
Definition: TubeVolData.h:27