253{
254
256
257 for (
int iRing = 0; iRing <
m_numRings; iRing++){
258
260 id.setEtaModule(
ring->identifier());
262
263 }
264 return nullptr;
265
266 }
267
268 GeoFullPhysVol * wheel=
new GeoFullPhysVol(
m_logVolume);
269
270
271
273
274
275
276
278 double powerTapeZMinusMax = -0.5 *
m_discSupport->thickness();
279
280 double maxZOfRingsFront = 0;
281
282 for (
int iRing = 0; iRing <
m_numRings; iRing++){
283
285
286
287 double ringZpos =
ring->ringSide() *
ring->ringOffset();
288 double ringOuterZ =
ring->ringOffset() +
ring->thicknessOuter();
289 maxZOfRingsFront = std::max(maxZOfRingsFront, ringOuterZ);
290
291 std::string ringNameTag = std::format(
"Ring#{}",
ring->identifier());
292 wheel->add(new GeoNameTag(ringNameTag));
293 wheel->add(
new GeoIdentifierTag(
ring->identifier()));
294 wheel->add(new GeoTransform(GeoTrf::Translate3D(0, 0, ringZpos)));
295 id.setEtaModule(
ring->identifier());
296 wheel->add(
ring->build(
id));
297
298
299
300 SCT_FwdRingCooling cooling(std::format(
"RingCoolingW{}R{}",
m_iWheel,iRing),
302 double coolingZpos =
ring->ringSide() * (0.5*(
m_discSupport->thickness() + cooling.thickness()));
303 wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(coolingZpos)));
304 wheel->add(cooling.getVolume());
305
306
307
308 SCT_FwdDiscPowerTape powerTape(std::format(
"PowerTapeW{}R{}",
m_iWheel,iRing), iRing,
310
311 double powerTapeZpos =
ring->ringSide() * (0.5*(
m_discSupport->thickness() + powerTape.thickness()) +
312 cooling.thickness());
313
314
315
316 if (
ring->ringSide() > 0) {
317 double powerTapeZstart = powerTapeZpos - 0.5 * powerTape.thickness();
318 if (powerTapeZstart < powerTapeZPlusMax) {
319 powerTapeZpos = powerTapeZPlusMax + 0.5 * powerTape.thickness();
320 }
321 powerTapeZPlusMax = powerTapeZpos + 0.5 * powerTape.thickness();
322 } else {
323 double powerTapeZstart = powerTapeZpos + 0.5 * powerTape.thickness();
324 if (powerTapeZstart > powerTapeZMinusMax) {
325 powerTapeZpos = powerTapeZMinusMax - 0.5 * powerTape.thickness();
326 }
327 powerTapeZMinusMax = powerTapeZpos - 0.5 * powerTape.thickness();
328 }
329 if ((std::abs(powerTapeZpos)+0.5*powerTape.thickness()) > (std::abs(ringZpos) - 0.5*
ring->thicknessInner())) {
330 std::cout << "ERROR: Power tapes clash with modules!!!" << std::endl;
331 }
332 wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(powerTapeZpos)));
333 wheel->add(powerTape.getVolume());
334
335
336 }
337
338
339
340
341
342
344
345
346
347
348 double powerTapeZMax = 0;
349 if (patchPanelSide > 0) {
350 powerTapeZMax = powerTapeZPlusMax;
351 } else {
352 powerTapeZMax = -powerTapeZMinusMax;
353 }
354
355
356
357
359
360
361 int numRepeat = 1;
364 if (ppType >=
m_numPatchPanelTypes) std::cout <<
"ERROR: Patch Panel type number out of range!" << std::endl;
365 for (int iRepeat = 0; iRepeat < numRepeat; iRepeat++) {
366
367
369 double patchPanelZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_patchPanel[ppType]->thickness() +
m_safety);
371
372
374 std::cout << "ERROR: Patch Panel clashes with middle ring" << std::endl;
375 std::cout <<
" PatchPanel inner radius: " <<
m_patchPanel[ppType]->innerRadius() << std::endl;
376 std::cout <<
" Ring outer radius: " <<
m_rings[1]->outerRadius() << std::endl;
377 }
378
379
380 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(patchPanelR)*GeoTrf::TranslateZ3D(patchPanelZpos)));
382
383
384
386 double ppConnectorZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_pPConnector->thickness() +
m_safety);
388
390 std::cout << "ERROR: Patch Panel Connector clashes outside wheel" << std::endl;
391 std::cout <<
" PatchPanel Connector outer radius: " << ppConnectorR + 0.5*
m_pPConnector->deltaR() << std::endl;
392 std::cout <<
" Wheel outer radius: " <<
m_outerRadius << std::endl;
393 }
394
395 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(ppConnectorR)*GeoTrf::TranslateZ3D(ppConnectorZpos)));
397 }
398
399
400
402 double ppCoolingZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_pPCooling->thickness() +
m_safety);
404
406 std::cout << "ERROR: Patch Panel Cooling clashes outside wheel" << std::endl;
407 std::cout <<
" PatchPanel Cooling outer radius: " << ppCoolingR + 0.5*
m_pPCooling->deltaR() << std::endl;
408 std::cout <<
" Wheel outer radius: " <<
m_outerRadius << std::endl;
409 }
410
411 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(ppCoolingR)*GeoTrf::TranslateZ3D(ppCoolingZpos)));
413 }
414 }
415
416 }
417
418
419
420
423 std::string optoharnessName = "OptoHarnessO";
426 SCT_FwdOptoHarness optoharness(std::format(
"{}W{}",optoharnessName,
m_iWheel),
m_numRings,
429 wheel->add(new GeoTransform(GeoTrf::TranslateZ3D(optoHarnessZpos)));
430 wheel->add(optoharness.getVolume());
431 optoHarnessZMax = optoHarnessZpos + 0.5*optoharness.thickness();
432 }
433
434
435 for (
unsigned int iFSI = 0; iFSI <
m_fsiVector->size(); iFSI++) {
436 int type = (*m_fsiVector)[iFSI]->simType();
437 double fsiRadius = (*m_fsiVector)[iFSI]->location().radius();
438 double fsiPhi = (*m_fsiVector)[iFSI]->location().phi();
439 int fsiUsualSide = (*m_fsiVector)[iFSI]->location().side();
442
443
444 if (fsiUsualSide < 0) {
445 double zMin = std::abs(fsiZpos) - 0.5*
m_fsiType[
type]->thickness();
446 if (maxZOfRingsFront > zMin) {
447 std::cout << "WARNING: FSI probably clashes with ring" << std::endl;
448 std::cout << " maxZOfRingsFront = " << maxZOfRingsFront << std::endl;
449 std::cout << " fsiZMin = " << zMin << std::endl;
450 }
451 } else {
452
453
454
456 double servicesZMax = (fsiRadius > diskMidRadius) ? powerTapeZMax : optoHarnessZMax;
457 double zMin = std::abs(fsiZpos) - 0.5*
m_fsiType[
type]->thickness();
458 if (servicesZMax > zMin) {
459 std::cout << "WARNING: FSI probably clashes with disc services" << std::endl;
460 std::cout << " servicesZMax = " << servicesZMax << std::endl;
461 std::cout << " fsiZMin = " << zMin << std::endl;
462 std::cout << " fsiRadius = " << fsiRadius << std::endl;
463 }
464 }
465
466 wheel->add(new GeoTransform(GeoTrf::RotateZ3D(fsiPhi)*GeoTrf::TranslateX3D(fsiRadius)*GeoTrf::TranslateZ3D(fsiZpos)));
467 wheel->add(
m_fsiType[type]->getVolume());
468
469
470 }
471
472
475
476 for (int iRepeat = 0; iRepeat < 4; iRepeat++) {
477
480
482 std::cout << "ERROR: Disc Fixation outside wheel" << std::endl;
483 std::cout <<
"Disc fixation outer radius: " << discFixationR + 0.5*
m_discFixation->thickness() << std::endl;
484 std::cout <<
" Wheel outer radius: " <<
m_outerRadius << std::endl;
485 }
486
487 wheel->add(new GeoTransform(GeoTrf::RotateY3D(90.*Gaudi::Units::degree)*GeoTrf::RotateX3D(discFixationAngle)*GeoTrf::TranslateZ3D(discFixationR)));
489 }
490 }
491 }
492
493
495 xMat.add(wheel, "SCTDisc");
496 xMat.add(wheel, std::format(
"SCTDisc{}",
m_iWheel));
498 xMat.add(wheel, "SCTDiscA");
499 xMat.add(wheel, std::format(
"SCTDiscA{}",
m_iWheel));
500 }
501 else {
502 xMat.add(wheel, "SCTDiscC");
503 xMat.add(wheel, std::format(
"SCTDiscC{}",
m_iWheel));
504 }
505
506 return wheel;
507}
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