ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
SCT_ServMatFactory Class Reference

#include <SCT_ServMatFactory.h>

Inheritance diagram for SCT_ServMatFactory:
Collaboration diagram for SCT_ServMatFactory:

Public Member Functions

 SCT_ServMatFactory (InDetDD::AthenaComps *athenaComps)
 
 ~SCT_ServMatFactory ()
 
void create (GeoPhysVol *mother)
 
StoreGateSvcdetStore ()
 
const IGeoDbTagSvcgeoDbTagSvc () const
 
IRDBAccessSvcrdbAccessSvc ()
 
const IGeometryDBSvcgeomDB () const
 
InDetMaterialManagermaterialManager ()
 
MsgStream & msg (MSG::Level lvl) const
 
bool msgLvl (MSG::Level lvl) const
 
InDetDD::AthenaCompsgetAthenaComps ()
 

Protected Attributes

InDetMaterialManagerm_materialManager
 
std::unique_ptr< InDetMaterialManagerm_materialManagerUnique
 

Private Member Functions

const SCT_ServMatFactoryoperator= (const SCT_ServMatFactory &right)
 
 SCT_ServMatFactory (const SCT_ServMatFactory &right)
 

Private Attributes

InDetDD::AthenaCompsm_athenaComps
 

Detailed Description

Definition at line 15 of file SCT_ServMatFactory.h.

Constructor & Destructor Documentation

◆ SCT_ServMatFactory() [1/2]

SCT_ServMatFactory::SCT_ServMatFactory ( InDetDD::AthenaComps athenaComps)

Definition at line 35 of file SCT_ServMatFactory.cxx.

36  : InDetDD::SubDetectorFactoryBase(athenaComps)
37 {
38 }

◆ ~SCT_ServMatFactory()

SCT_ServMatFactory::~SCT_ServMatFactory ( )

Definition at line 40 of file SCT_ServMatFactory.cxx.

41 {
42 }

◆ SCT_ServMatFactory() [2/2]

SCT_ServMatFactory::SCT_ServMatFactory ( const SCT_ServMatFactory right)
private

Member Function Documentation

◆ create()

void SCT_ServMatFactory::create ( GeoPhysVol *  mother)

Definition at line 47 of file SCT_ServMatFactory.cxx.

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 }

◆ detStore()

StoreGateSvc* InDetDD::SubDetectorFactoryBase::detStore ( )
inlineinherited

Definition at line 39 of file InDetSubDetectorFactoryBase.h.

39 {return m_athenaComps->detStore();}

◆ geoDbTagSvc()

const IGeoDbTagSvc* InDetDD::SubDetectorFactoryBase::geoDbTagSvc ( ) const
inlineinherited

Definition at line 41 of file InDetSubDetectorFactoryBase.h.

41 {return std::as_const(*m_athenaComps).geoDbTagSvc();}

◆ geomDB()

const IGeometryDBSvc* InDetDD::SubDetectorFactoryBase::geomDB ( ) const
inlineinherited

Definition at line 45 of file InDetSubDetectorFactoryBase.h.

45 {return m_athenaComps->geomDB();}

◆ getAthenaComps()

InDetDD::AthenaComps* InDetDD::SubDetectorFactoryBase::getAthenaComps ( )
inlineinherited

Definition at line 55 of file InDetSubDetectorFactoryBase.h.

55 {return m_athenaComps;}

◆ materialManager()

InDetMaterialManager* InDetDD::SubDetectorFactoryBase::materialManager ( )
inlineinherited

Definition at line 47 of file InDetSubDetectorFactoryBase.h.

47 {return m_materialManager;}

◆ msg()

MsgStream& InDetDD::SubDetectorFactoryBase::msg ( MSG::Level  lvl) const
inlineinherited

Definition at line 50 of file InDetSubDetectorFactoryBase.h.

50 { return m_athenaComps->msg(lvl); }

◆ msgLvl()

bool InDetDD::SubDetectorFactoryBase::msgLvl ( MSG::Level  lvl) const
inlineinherited

Definition at line 53 of file InDetSubDetectorFactoryBase.h.

53 { return m_athenaComps->msgLvl(lvl); }

◆ operator=()

const SCT_ServMatFactory& SCT_ServMatFactory::operator= ( const SCT_ServMatFactory right)
private

◆ rdbAccessSvc()

IRDBAccessSvc* InDetDD::SubDetectorFactoryBase::rdbAccessSvc ( )
inlineinherited

Definition at line 43 of file InDetSubDetectorFactoryBase.h.

43 {return m_athenaComps->rdbAccessSvc();}

Member Data Documentation

◆ m_athenaComps

InDetDD::AthenaComps* InDetDD::SubDetectorFactoryBase::m_athenaComps
privateinherited

Definition at line 58 of file InDetSubDetectorFactoryBase.h.

◆ m_materialManager

InDetMaterialManager* InDetDD::SubDetectorFactoryBase::m_materialManager
protectedinherited

Definition at line 61 of file InDetSubDetectorFactoryBase.h.

◆ m_materialManagerUnique

std::unique_ptr<InDetMaterialManager> InDetDD::SubDetectorFactoryBase::m_materialManagerUnique
protectedinherited

Definition at line 63 of file InDetSubDetectorFactoryBase.h.


The documentation for this class was generated from the following files:
InDetMaterialManager::addWeightTable
void addWeightTable(const IRDBRecordset_ptr &weightTable, const std::string &space="")
Definition: InDetMaterialManager.cxx:321
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.
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
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
H2
#define H2(x, y, z)
Definition: MD5.cxx:115
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
python.SystemOfUnits.radian
int radian
Definition: SystemOfUnits.py:104
InDetDD::SubDetectorFactoryBase::m_materialManager
InDetMaterialManager * m_materialManager
Definition: InDetSubDetectorFactoryBase.h:61
AthMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level.
Definition: AthMessaging.h:151
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.
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
InDetDD::SubDetectorFactoryBase::rdbAccessSvc
IRDBAccessSvc * rdbAccessSvc()
Definition: InDetSubDetectorFactoryBase.h:43
InDetDD::TubeVolData::TUBE
@ TUBE
Definition: TubeVolData.h:19
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
InDetMaterialManager
InDetMaterialManager.
Definition: InDetMaterialManager.h:34
InDetDD::SubDetectorFactoryBase::geoDbTagSvc
const IGeoDbTagSvc * geoDbTagSvc() const
Definition: InDetSubDetectorFactoryBase.h:41
InDetDD::SubDetectorFactoryBase::m_materialManagerUnique
std::unique_ptr< InDetMaterialManager > m_materialManagerUnique
Definition: InDetSubDetectorFactoryBase.h:63
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetMaterialManager::addScalingTable
void addScalingTable(const IRDBRecordset_ptr &scalingTable)
Definition: InDetMaterialManager.cxx:431
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
InDetDD::SubDetectorFactoryBase
Definition: InDetSubDetectorFactoryBase.h:25
InDetDD::SubDetectorFactoryBase::msg
MsgStream & msg(MSG::Level lvl) const
Definition: InDetSubDetectorFactoryBase.h:50
InDetDD::AthenaComps::geomDB
const IGeometryDBSvc * geomDB() const
Definition: InDetDDAthenaComps.h:63
InDetDD::SubDetectorFactoryBase::m_athenaComps
InDetDD::AthenaComps * m_athenaComps
Definition: InDetSubDetectorFactoryBase.h:58
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::AthenaComps::detStore
const StoreGateSvc * detStore() const
Definition: InDetDDAthenaComps.h:53
InDetDD::AthenaComps::rdbAccessSvc
IRDBAccessSvc * rdbAccessSvc()
Definition: InDetDDAthenaComps.h:74
Shift
@ Shift
Definition: CMAparameters.h:19