261{
262
264
265 for (
int iRing = 0; iRing <
m_numRings; iRing++){
266
268 id.setEtaModule(
ring->identifier());
270
271 }
272 return nullptr;
273
274 }
275
276 GeoFullPhysVol * wheel=
new GeoFullPhysVol(
m_logVolume);
277
278
279
281
282
283
284
286 double powerTapeZMinusMax = -0.5 *
m_discSupport->thickness();
287
288 double maxZOfRingsFront = 0;
289
290 for (
int iRing = 0; iRing <
m_numRings; iRing++){
291
293
294
295 double ringZpos =
ring->ringSide() *
ring->ringOffset();
296 double ringOuterZ =
ring->ringOffset() +
ring->thicknessOuter();
297 maxZOfRingsFront = std::max(maxZOfRingsFront, ringOuterZ);
298
300 wheel->add(new GeoNameTag(ringNameTag));
301 wheel->add(
new GeoIdentifierTag(
ring->identifier()));
302 wheel->add(new GeoTransform(GeoTrf::Translate3D(0, 0, ringZpos)));
303 id.setEtaModule(
ring->identifier());
304 wheel->add(
ring->build(
id));
305
306
307
310 double coolingZpos =
ring->ringSide() * (0.5*(
m_discSupport->thickness() + cooling.thickness()));
311 wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(coolingZpos)));
312 wheel->add(cooling.getVolume());
313
314
315
319
320 double powerTapeZpos =
ring->ringSide() * (0.5*(
m_discSupport->thickness() + powerTape.thickness()) +
321 cooling.thickness());
322
323
324
325 if (
ring->ringSide() > 0) {
326 double powerTapeZstart = powerTapeZpos - 0.5 * powerTape.thickness();
327 if (powerTapeZstart < powerTapeZPlusMax) {
328 powerTapeZpos = powerTapeZPlusMax + 0.5 * powerTape.thickness();
329 }
330 powerTapeZPlusMax = powerTapeZpos + 0.5 * powerTape.thickness();
331 } else {
332 double powerTapeZstart = powerTapeZpos + 0.5 * powerTape.thickness();
333 if (powerTapeZstart > powerTapeZMinusMax) {
334 powerTapeZpos = powerTapeZMinusMax - 0.5 * powerTape.thickness();
335 }
336 powerTapeZMinusMax = powerTapeZpos - 0.5 * powerTape.thickness();
337 }
338 if ((std::abs(powerTapeZpos)+0.5*powerTape.thickness()) > (std::abs(ringZpos) - 0.5*
ring->thicknessInner())) {
339 std::cout << "ERROR: Power tapes clash with modules!!!" << std::endl;
340 }
341 wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(powerTapeZpos)));
342 wheel->add(powerTape.getVolume());
343
344
345 }
346
347
348
349
350
351
353
354
355
356
357 double powerTapeZMax = 0;
358 if (patchPanelSide > 0) {
359 powerTapeZMax = powerTapeZPlusMax;
360 } else {
361 powerTapeZMax = -powerTapeZMinusMax;
362 }
363
364
365
366
368
369
370 int numRepeat = 1;
373 if (ppType >=
m_numPatchPanelTypes) std::cout <<
"ERROR: Patch Panel type number out of range!" << std::endl;
374 for (int iRepeat = 0; iRepeat < numRepeat; iRepeat++) {
375
376
378 double patchPanelZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_patchPanel[ppType]->thickness() +
m_safety);
380
381
383 std::cout << "ERROR: Patch Panel clashes with middle ring" << std::endl;
384 std::cout <<
" PatchPanel inner radius: " <<
m_patchPanel[ppType]->innerRadius() << std::endl;
385 std::cout <<
" Ring outer radius: " <<
m_rings[1]->outerRadius() << std::endl;
386 }
387
388
389 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(patchPanelR)*GeoTrf::TranslateZ3D(patchPanelZpos)));
391
392
393
395 double ppConnectorZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_pPConnector->thickness() +
m_safety);
397
399 std::cout << "ERROR: Patch Panel Connector clashes outside wheel" << std::endl;
400 std::cout <<
" PatchPanel Connector outer radius: " << ppConnectorR + 0.5*
m_pPConnector->deltaR() << std::endl;
401 std::cout <<
" Wheel outer radius: " <<
m_outerRadius << std::endl;
402 }
403
404 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(ppConnectorR)*GeoTrf::TranslateZ3D(ppConnectorZpos)));
406 }
407
408
409
411 double ppCoolingZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_pPCooling->thickness() +
m_safety);
413
415 std::cout << "ERROR: Patch Panel Cooling clashes outside wheel" << std::endl;
416 std::cout <<
" PatchPanel Cooling outer radius: " << ppCoolingR + 0.5*
m_pPCooling->deltaR() << std::endl;
417 std::cout <<
" Wheel outer radius: " <<
m_outerRadius << std::endl;
418 }
419
420 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(ppCoolingR)*GeoTrf::TranslateZ3D(ppCoolingZpos)));
422 }
423 }
424
425 }
426
427
428
429
432 std::string optoharnessName = "OptoHarnessO";
438 wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(optoHarnessZpos)));
439 wheel->add(optoharness.getVolume());
440 optoHarnessZMax = optoHarnessZpos + 0.5*optoharness.thickness();
441 }
442
443
444 for (
unsigned int iFSI = 0; iFSI <
m_fsiVector->size(); iFSI++) {
445 int type = (*m_fsiVector)[iFSI]->simType();
446 double fsiRadius = (*m_fsiVector)[iFSI]->location().radius();
447 double fsiPhi = (*m_fsiVector)[iFSI]->location().phi();
448 int fsiUsualSide = (*m_fsiVector)[iFSI]->location().side();
451
452
453 if (fsiUsualSide < 0) {
454 double zMin = std::abs(fsiZpos) - 0.5*
m_fsiType[
type]->thickness();
455 if (maxZOfRingsFront > zMin) {
456 std::cout << "WARNING: FSI probably clashes with ring" << std::endl;
457 std::cout << " maxZOfRingsFront = " << maxZOfRingsFront << std::endl;
458 std::cout << " fsiZMin = " << zMin << std::endl;
459 }
460 } else {
461
462
463
465 double servicesZMax = (fsiRadius > diskMidRadius) ? powerTapeZMax : optoHarnessZMax;
466 double zMin = std::abs(fsiZpos) - 0.5*
m_fsiType[
type]->thickness();
467 if (servicesZMax > zMin) {
468 std::cout << "WARNING: FSI probably clashes with disc services" << std::endl;
469 std::cout << " servicesZMax = " << servicesZMax << std::endl;
470 std::cout << " fsiZMin = " << zMin << std::endl;
471 std::cout << " fsiRadius = " << fsiRadius << std::endl;
472 }
473 }
474
475 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(fsiPhi)*GeoTrf::TranslateX3D(fsiRadius)*GeoTrf::TranslateZ3D(fsiZpos)));
476 wheel->add(
m_fsiType[type]->getVolume());
477
478
479 }
480
481
484
485 for (int iRepeat = 0; iRepeat < 4; iRepeat++) {
486
489
491 std::cout << "ERROR: Disc Fixation outside wheel" << std::endl;
492 std::cout <<
"Disc fixation outer radius: " << discFixationR + 0.5*
m_discFixation->thickness() << std::endl;
493 std::cout <<
" Wheel outer radius: " <<
m_outerRadius << std::endl;
494 }
495
496 wheel->add(new GeoTransform(GeoTrf::RotateY3D(90.*Gaudi::Units::degree)*GeoTrf::RotateX3D(discFixationAngle)*GeoTrf::TranslateZ3D(discFixationR)));
498 }
499 }
500 }
501
502
504 xMat.add(wheel, "SCTDisc");
507 xMat.add(wheel, "SCTDiscA");
509 } else {
510 xMat.add(wheel, "SCTDiscC");
512 }
513
514
515
516 return wheel;
517
518}
std::string intToString(int i) const
InDetDD::SCT_DetectorManager * m_detectorManager
SCT_GeometryManager * m_geometryManager
SCT_MaterialManager * m_materials
std::vector< std::unique_ptr< SCT_FwdRing > > m_rings
std::vector< std::unique_ptr< SCT_FwdPatchPanel > > m_patchPanel
std::unique_ptr< SCT_FwdPPCooling > m_pPCooling
std::unique_ptr< SCT_FwdPPConnector > m_pPConnector
double innerRadius() const
bool m_optoHarnessPresent
std::vector< int > m_patchPanelType
std::vector< bool > m_patchPanelRepeatQuadrant
std::vector< std::unique_ptr< SCT_FwdFSI > > m_fsiType
bool m_pPConnectorPresent
std::unique_ptr< SCT_FwdDiscSupport > m_discSupport
std::unique_ptr< SCT_FwdDiscFixation > m_discFixation
const SCT_FwdRing * ring(int i)
std::vector< double > m_discFixationLocAngle
std::vector< double > m_patchPanelLocAngle
const std::vector< const FSIDetails * > * m_fsiVector
bool m_discFixationPresent
double outerRadius() const
GeoModelIO::ReadGeoModel * m_sqliteReader