80 for (
int iRing = 0; iRing <
m_numRings; iRing++) {
115 for (
int iLoc = 0; iLoc < parameters->fwdNumCylinderServiceLocs(); iLoc++) {
117 if(parameters->fwdCylinderServiceLocName(iLoc) ==
"NPipe") {
135 for (
int iRing = 0; iRing <
m_numRings; iRing++){
136 std::string ringName = std::format(
"Ring{}For{}",iRing,
getName());
138 m_rings.push_back(std::make_unique<SCT_FwdRing>(ringName,
m_modules[
ringType],
m_iWheel, iRing,
m_endcap,
m_detectorManager,
m_geometryManager,
m_materials,
m_sqliteReader,
m_mapFPV,
m_mapAX));
145 for (
int iRing = 0; iRing <
m_numRings; iRing++){
155 m_patchPanel.push_back(std::make_unique<SCT_FwdPatchPanel>(std::format(
"PatchPanel{}",iPPType), iPPType,
161 m_pPConnector = std::make_unique<SCT_FwdPPConnector>(
"PPConnector",
165 m_pPCooling = std::make_unique<SCT_FwdPPCooling>(
"PPCooling",
169 m_discFixation = std::make_unique<SCT_FwdDiscFixation>(
"DiscFixation",
175 for (
unsigned int iFSI = 0; iFSI <
m_fsiVector->size(); iFSI++) {
176 int type = (*m_fsiVector)[iFSI]->simType();
187 double maxModuleThickness = 0.5 *
m_discSupport->thickness();
190 for (
int iRing = 0; iRing <
m_numRings; iRing++){
193 maxModuleThickness = std::max(maxModuleThickness,
m_rings[iRing]->thicknessOuter() +
m_rings[iRing]->ringOffset());
210 maxOuterRadius = std::max(ppCoolingOuterRadius, maxOuterRadius);
216 maxOuterRadius = std::max(discFixationOuterRadius, maxOuterRadius);
243 const GeoShape & fwdWheelEnvelopeShape = *tmpShape << GeoTrf::Translate3D(0, 0, envelopeShift);
245 const GeoLogVol * fwdWheelLog =
257 for (
int iRing = 0; iRing <
m_numRings; iRing++){
260 id.setEtaModule(
ring->identifier());
268 GeoFullPhysVol * wheel=
new GeoFullPhysVol(
m_logVolume);
278 double powerTapeZMinusMax = -0.5 *
m_discSupport->thickness();
280 double maxZOfRingsFront = 0;
282 for (
int iRing = 0; iRing <
m_numRings; iRing++){
287 double ringZpos =
ring->ringSide() *
ring->ringOffset();
288 double ringOuterZ =
ring->ringOffset() +
ring->thicknessOuter();
289 maxZOfRingsFront = std::max(maxZOfRingsFront, ringOuterZ);
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));
303 wheel->add(
new GeoTransform(GeoTrf::TranslateZ3D(coolingZpos)));
316 if (
ring->ringSide() > 0) {
317 double powerTapeZstart = powerTapeZpos - 0.5 * powerTape.
thickness();
318 if (powerTapeZstart < powerTapeZPlusMax) {
319 powerTapeZpos = powerTapeZPlusMax + 0.5 * powerTape.
thickness();
321 powerTapeZPlusMax = powerTapeZpos + 0.5 * powerTape.
thickness();
323 double powerTapeZstart = powerTapeZpos + 0.5 * powerTape.
thickness();
324 if (powerTapeZstart > powerTapeZMinusMax) {
325 powerTapeZpos = powerTapeZMinusMax - 0.5 * powerTape.
thickness();
327 powerTapeZMinusMax = powerTapeZpos - 0.5 * powerTape.
thickness();
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;
332 wheel->add(
new GeoTransform(GeoTrf::TranslateZ3D(powerTapeZpos)));
348 double powerTapeZMax = 0;
349 if (patchPanelSide > 0) {
350 powerTapeZMax = powerTapeZPlusMax;
352 powerTapeZMax = -powerTapeZMinusMax;
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++) {
369 double patchPanelZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_patchPanel[ppType]->thickness() +
m_safety);
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;
380 wheel->add(
new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(patchPanelR)*GeoTrf::TranslateZ3D(patchPanelZpos)));
386 double ppConnectorZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_pPConnector->thickness() +
m_safety);
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;
395 wheel->add(
new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(ppConnectorR)*GeoTrf::TranslateZ3D(ppConnectorZpos)));
402 double ppCoolingZpos = patchPanelSide * (powerTapeZMax + 0.5*
m_pPCooling->thickness() +
m_safety);
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;
411 wheel->add(
new GeoTransform(GeoTrf::RotateZ3D(patchPanelAngle)*GeoTrf::TranslateX3D(ppCoolingR)*GeoTrf::TranslateZ3D(ppCoolingZpos)));
423 std::string optoharnessName =
"OptoHarnessO";
429 wheel->add(
new GeoTransform(GeoTrf::TranslateZ3D(optoHarnessZpos)));
431 optoHarnessZMax = optoHarnessZpos + 0.5*optoharness.
thickness();
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();
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;
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;
466 wheel->add(
new GeoTransform(GeoTrf::RotateZ3D(fsiPhi)*GeoTrf::TranslateX3D(fsiRadius)*GeoTrf::TranslateZ3D(fsiZpos)));
476 for (
int iRepeat = 0; iRepeat < 4; iRepeat++) {
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;
487 wheel->add(
new GeoTransform(GeoTrf::RotateY3D(90.*Gaudi::Units::degree)*GeoTrf::RotateX3D(discFixationAngle)*GeoTrf::TranslateZ3D(discFixationR)));
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));
502 xMat.
add(wheel,
"SCTDiscC");
503 xMat.
add(wheel, std::format(
"SCTDiscC{}",
m_iWheel));
SCT_FwdWheel(const std::string &name, int iWheel, const std::vector< SCT_FwdModule * > &modules, int ec, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX)
SCT_UniqueComponentFactory(const std::string &name, InDetDD::SCT_DetectorManager *detectorManager, SCT_GeometryManager *geometryManager, SCT_MaterialManager *materials=nullptr, GeoModelIO::ReadGeoModel *sqliteReader=nullptr, std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > mapFPV=nullptr, std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > mapAX=nullptr)