140 ATH_MSG_DEBUG(
" Getting primary numbers from the Detector Description Database " );
142 m_data.reset(parameterInterface);
158 if (!
m_doArgon )
ATH_MSG_DEBUG(
"Tool setup will force to NOT to use ARGON. Ignore this warning if you are running RECONSTRUCTION or DIGI, but cross-check if you are running SIMULATION");
159 if (!
m_doKrypton)
ATH_MSG_DEBUG(
"Tool setup will force to NOT to use KRYPTON. Ignore this warning if you are running RECONSTRUCTION or DIGI, but cross-check if you are running SIMULATION");
167 const TRT_ID *idHelper =
nullptr;
183 std::string versionTag =
m_data->versionTag;
184 std::string versionName =
"DC2";
185 std::string layout =
"Final";
187 int versionMajorNumber = 2;
188 int versionMinorNumber = 1;
189 int versionPatchNumber = 0;
191 if (
m_data->initialLayout) layout =
"Initial";
196 versionMajorNumber = 3;
197 versionName =
"Rome";
201 if (
m_data->isCosmicRun) {
210 if (!
m_data->oldConfiguration) {
211 versionName =
m_data->versionName;
214 versionMajorNumber = 4;
215 versionMinorNumber = 1;
216 versionPatchNumber = 1;
231 ATH_MSG_INFO(
"In TRT Detector Factory (For DC2 and later geometries)" );
237 std::string barrelLabel =
"Barrel";
238 std::string endcapA_WheelAB_Label =
"EndcapA_WheelAB";
239 std::string endcapC_WheelAB_Label =
"EndcapC_WheelAB";
240 std::string endcapA_WheelC_Label =
"EndcapA_WheelC";
241 std::string endcapC_WheelC_Label =
"EndcapC_WheelC";
244 if (
m_data->partPresent(
"EndcapAB_Plus")) {
245 barrelLabel =
"Barrel";
246 endcapA_WheelAB_Label =
"EndcapAB_Plus";
247 endcapC_WheelAB_Label =
"EndcapAB_Minus";
248 endcapA_WheelC_Label =
"EndcapC_Plus";
249 endcapC_WheelC_Label =
"EndcapC_Minus";
253 bool barrelPresent =
m_data->partPresent(barrelLabel);
254 bool endcapABPlusPresent =
m_data->partPresent(endcapA_WheelAB_Label);
255 bool endcapABMinusPresent =
m_data->partPresent(endcapC_WheelAB_Label);
256 bool endcapCPlusPresent =
m_data->partPresent(endcapA_WheelC_Label);
257 bool endcapCMinusPresent =
m_data->partPresent(endcapC_WheelC_Label);
263 if (
m_data->oldConfiguration) {
264 if (
m_data->isCosmicRun) {
265 endcapABPlusPresent =
false;
266 endcapABMinusPresent =
false;
267 endcapCPlusPresent =
false;
268 endcapCMinusPresent =
false;
270 if (
m_data->initialLayout) {
271 endcapCPlusPresent =
false;
272 endcapCMinusPresent =
false;
284 const int AlignmentLevelSubWheel = 1;
285 const int AlignmentLevelModule = 2;
286 const int AlignmentLevelTop = 3;
300 if (endcapABPlusPresent) {
303 if (endcapABMinusPresent) {
321 if (endcapABPlusPresent) {
324 if (endcapABMinusPresent) {
343 ATH_MSG_INFO(
"Digversion overridden via joboptions from "
344 <<
m_data->digversion <<
" ('" <<
m_data->digversionname <<
"') to "
352 for (
unsigned int m=0;
m<
m_data->nBarrelRings;
m++) {
360 unsigned int nEndcapWheels = 0;
361 if (endcapABPlusPresent||endcapABMinusPresent) nEndcapWheels +=
m_data->endcapNumberOfAWheels +
m_data->endcapNumberOfBWheels;
362 if (endcapCPlusPresent||endcapCMinusPresent) nEndcapWheels +=
m_data->endcapNumberOfCWheels;
368 unsigned int nlayers;
369 if ( w < m_data->endcapNumberOfAWheels )
370 nlayers =
m_data->endCapNumberOfStrawLayersPerWheelA;
371 else if (
w < (
m_data->endcapNumberOfAWheels +
m_data->endcapNumberOfBWheels ) )
372 nlayers =
m_data->endCapNumberOfStrawLayersPerWheelB;
374 nlayers =
m_data->endCapNumberOfStrawLayersPerWheelC;
382 GeoFullPhysVol *pBarrelVol =
nullptr;
383 GeoFullPhysVol *pEndCapABPlus =
nullptr;
384 GeoFullPhysVol *pEndCapCPlus =
nullptr;
385 GeoFullPhysVol *pEndCapABMinus =
nullptr;
386 GeoFullPhysVol *pEndCapCMinus =
nullptr;
395 GeoTube* sBarrelVol =
new GeoTube(
m_data->virtualBarrelInnerRadius,
396 m_data->virtualBarrelOuterRadius,
397 m_data->virtualBarrelVolumeLength );
400 GeoLogVol *lBarrelVol =
new GeoLogVol(
"TRTBarrel", sBarrelVol,
m_materialManager->getMaterial(
"trt::CO2"));
401 pBarrelVol =
new GeoFullPhysVol(lBarrelVol);
403 ATH_MSG_DEBUG(
"Virtual TRT Barrel volume defined by RMin = "<<
m_data->virtualBarrelInnerRadius
404 <<
", Rmax = "<<
m_data->virtualBarrelOuterRadius<<
" Zmax = "<<
m_data->virtualBarrelVolumeLength );
409 GeoAlignableTransform * barrelTransform =
410 new GeoAlignableTransform(trtTransform *
m_data->partTransform(barrelLabel));
412 world->add(topLevelNameTag);
413 world->add(barrelTransform);
414 world->add(pBarrelVol);
425 GeoLogVol * lEndCapVolumeAB =
nullptr;
426 if (endcapABPlusPresent || endcapABMinusPresent) {
427 GeoTube * sEndCapVolumeAB_unshifted =
new GeoTube (
m_data->innerRadiusOfEndCapVolumeAB,
428 m_data->outerRadiusOfEndCapVolumeAB,
429 m_data->lengthOfEndCapVolumeAB/2.);
430 const GeoShape & sEndCapVolumeAB
431 = ( *sEndCapVolumeAB_unshifted << GeoTrf::TranslateZ3D(
m_data->positionOfEndCapVolumeAB));
433 lEndCapVolumeAB =
new GeoLogVol(
"TRTEndcapWheelAB", &sEndCapVolumeAB,
m_materialManager->getMaterial(
"trt::CO2"));
436 if (endcapABPlusPresent) {
437 pEndCapABPlus =
new GeoFullPhysVol(lEndCapVolumeAB);
440 new GeoAlignableTransform(trtTransform *
m_data->partTransform(endcapA_WheelAB_Label));
442 world->add(topLevelNameTag);
444 world->add(
new GeoIdentifierTag(0));
445 world->add(pEndCapABPlus);
451 if (endcapABMinusPresent) {
452 pEndCapABMinus =
new GeoFullPhysVol(lEndCapVolumeAB);
457 world->add(topLevelNameTag);
459 world->add(
new GeoIdentifierTag(1));
460 world->add(pEndCapABMinus);
469 GeoLogVol * lEndCapVolumeC =
nullptr;
470 if (endcapCPlusPresent || endcapCMinusPresent) {
471 GeoTube * sEndCapVolumeC_unshifted =
new GeoTube (
m_data->innerRadiusOfEndCapVolumeC,
472 m_data->outerRadiusOfEndCapVolumeC,
473 m_data->lengthOfEndCapVolumeC/2.);
474 const GeoShape & sEndCapVolumeC
475 = ( *sEndCapVolumeC_unshifted << GeoTrf::TranslateZ3D(
m_data->positionOfEndCapVolumeC));
477 lEndCapVolumeC =
new GeoLogVol(
"TRTEndcapWheelC", &sEndCapVolumeC,
m_materialManager->getMaterial(
"trt::CO2"));
480 if (endcapCPlusPresent) {
481 pEndCapCPlus =
new GeoFullPhysVol(lEndCapVolumeC);
484 new GeoAlignableTransform(trtTransform *
m_data->partTransform(endcapA_WheelC_Label));
486 world->add(topLevelNameTag);
488 world->add(
new GeoIdentifierTag(0));
489 world->add(pEndCapCPlus);
493 if (endcapCMinusPresent) {
494 pEndCapCMinus =
new GeoFullPhysVol(lEndCapVolumeC);
499 world->add(topLevelNameTag);
501 world->add(
new GeoIdentifierTag(0));
502 world->add(pEndCapCMinus);
507 GeoFullPhysVol *pCommonEndcapAB[2];
508 GeoFullPhysVol *pCommonEndcapC[2];
510 pCommonEndcapAB[0] = pEndCapABPlus;
511 pCommonEndcapAB[1] = pEndCapABMinus;
512 pCommonEndcapC[0] = pEndCapCPlus;
513 pCommonEndcapC[1] = pEndCapCMinus;
523 xMat.add(pBarrelVol,
"TRTBarrel");
527 xMat.add(pEndCapABPlus,
"TRTEndcap");
528 xMat.add(pEndCapABPlus,
"TRTEndcapA");
530 if (pEndCapABMinus) {
532 xMat.add(pEndCapABMinus,
"TRTEndcap");
533 xMat.add(pEndCapABMinus,
"TRTEndcapC");
539 xMat.add(pEndCapCPlus,
"TRTEndcap_WheelC");
540 xMat.add(pEndCapCPlus,
"TRTEndcapA_WheelC");
544 xMat.add(pEndCapCMinus,
"TRTEndcap_WheelC");
545 xMat.add(pEndCapCMinus,
"TRTEndcapC_WheelC");
564 GeoTube *sBarrelInnerSupport =
new GeoTube(
m_data->innerRadiusOfBarrelVolume,
565 m_data->innerRadiusOfBarrelVolume +
m_data->thicknessOfBarrelInnerSupport,
566 m_data->lengthOfBarrelVolume/2);
569 GeoLogVol *lBarrelInnerSupport =
new GeoLogVol(
"BarrelInnerSupport", sBarrelInnerSupport,
575 GeoPhysVol *pBarrelInnerSupport =
new GeoPhysVol(lBarrelInnerSupport);
576 pBarrelVol->add(pBarrelInnerSupport);
579 GeoTube *sBarrelOuterSupport =
new GeoTube(
m_data->outerRadiusOfBarrelVolume -
m_data->thicknessOfBarrelOuterSupport,
580 m_data->outerRadiusOfBarrelVolume,
m_data->lengthOfBarrelVolume/2);
582 GeoLogVol *lBarrelOuterSupport =
new GeoLogVol(
"BarrelOuterSupport", sBarrelOuterSupport,
588 GeoPhysVol *pBarrelOuterSupport =
new GeoPhysVol(lBarrelOuterSupport);
589 pBarrelVol->add(pBarrelOuterSupport);
593 if (
m_data->includeBarServiceAndFlange) {
602 GeoTube *sEndFlangeRegion =
new GeoTube(
m_data->barFlangeRMin,
m_data->barFlangeRMax,
604 GeoLogVol *lEndFlangeRegion =
new GeoLogVol(
"EndFlangeRegion", sEndFlangeRegion,
607 GeoPhysVol *pEndFlangeRegion =
new GeoPhysVol(lEndFlangeRegion);
609 double zPosEndFlange = (
m_data->barFlangeZMin+
m_data->barFlangeZMax)/2;
610 GeoTransform *xfEndFlangeRegionPlus =
new GeoTransform(GeoTrf::TranslateZ3D(zPosEndFlange));
611 GeoTransform *xfEndFlangeRegionMinus =
new GeoTransform(GeoTrf::TranslateZ3D(-zPosEndFlange));
613 pBarrelVol->add(xfEndFlangeRegionPlus);
614 pBarrelVol->add(pEndFlangeRegion);
615 pBarrelVol->add(xfEndFlangeRegionMinus);
616 pBarrelVol->add(pEndFlangeRegion);
625 GeoTube *sServices =
new GeoTube(
m_data->barServicesRMin,
m_data->barServicesRMax,
627 GeoLogVol *lServices =
new GeoLogVol(
"Services", sServices,
630 GeoPhysVol *pServices =
new GeoPhysVol(lServices);
632 double zPosServices = (
m_data->barServicesZMin+
m_data->barServicesZMax)/2;
633 GeoTransform *xfServicesPlus =
new GeoTransform(GeoTrf::TranslateZ3D(zPosServices));
634 GeoTransform *xfServicesMinus =
new GeoTransform(GeoTrf::TranslateZ3D(-zPosServices));
636 pBarrelVol->add(xfServicesPlus);
637 pBarrelVol->add(pServices);
638 pBarrelVol->add(xfServicesMinus);
639 pBarrelVol->add(pServices);
651 std::vector<InDetDD::TRT_BarrelDescriptor *> bDescriptor;
656 GeoTube *sCoolingTube =
new GeoTube(0,
m_data->barrelOuterRadiusOfCoolingTube,
m_data->lengthOfBarrelVolume/2.0);
657 GeoLogVol *lCoolingTube =
new GeoLogVol(
"CoolingTube",sCoolingTube,
m_materialManager->getMaterial(
"trt::CoolingTube"));
658 GeoPhysVol *pCoolingTube =
new GeoPhysVol(lCoolingTube);
660 GeoTube *sCoolingFluid =
new GeoTube(0,
m_data->barrelInnerRadiusOfCoolingTube,
m_data->lengthOfBarrelVolume/2.0);
661 GeoLogVol *lCoolingFluid =
new GeoLogVol(
"CoolingFluid",sCoolingFluid,
m_materialManager->getMaterial(
"trt::CoolingFluid"));
662 GeoPhysVol*pCoolingFluid =
new GeoPhysVol(lCoolingFluid);
664 pCoolingTube->add(pCoolingFluid);
666 double lengthOfInnerDeadRegion=
m_data->lengthOfDeadRegion;
667 double lengthOfActiveGas = (
m_data->barrelLengthOfStraw-
m_data->barrelLengthOfTwister)/2.0 -
m_data->lengthOfDeadRegion - lengthOfInnerDeadRegion;
668 double activeGasZPositionNormalStraws = (lengthOfActiveGas +
m_data->barrelLengthOfTwister) / 2. + lengthOfInnerDeadRegion;
670 lengthOfInnerDeadRegion =
m_data->barrelLengthOfLargeDeadRegion;
671 lengthOfActiveGas = (
m_data->barrelLengthOfStraw-
m_data->barrelLengthOfTwister)/2.0 -
m_data->lengthOfDeadRegion - lengthOfInnerDeadRegion;
672 double activeGasZPositionStrawsWithLargeDeadRegion = (lengthOfActiveGas +
m_data->barrelLengthOfTwister) / 2. + lengthOfInnerDeadRegion;
675 for (
size_t iABC=0;iABC<
m_data->nBarrelRings;iABC++) {
679 GeoLogVol *lRad =
nullptr;
680 GeoLogVol *lShell =
nullptr;
683 std::ostringstream shellstream;
684 shellstream <<
"Shell" << iABC;
690 if ( shellCorner1.y() <= 0 ) {
ATH_MSG_DEBUG(
"shellCorner1 is <= 0 (" << shellCorner1 <<
")"); }
691 if ( shellCorner2.y() <= 0 ) {
ATH_MSG_DEBUG(
"shellCorner2 is <= 0 (" << shellCorner2 <<
")"); }
692 if ( shellCorner3.y() <= 0 ) {
ATH_MSG_DEBUG(
"shellCorner3 is <= 0 (" << shellCorner3 <<
")" ); }
693 if ( shellCorner4.y() <= 0 ) {
ATH_MSG_DEBUG(
"shellCorner4 is <= 0 (" << shellCorner4 <<
")"); }
695 shellCorner1,shellCorner2,shellCorner3,shellCorner4,shellPosition);
698 std::ostringstream layerstr;
701 std::string shellMatName =
"trt::ModuleShell"+layerstr.str();
702 std::string shellName =
"ModuleShell"+layerstr.str();
706 lShell =
new GeoLogVol(shellName, sShell, shellMat);
714 shellCorner1,shellCorner2,shellCorner3,shellCorner4,
715 radAbsolutePosition,
m_data->barrelThicknessOfModuleWalls);
718 std::string radMatName =
"trt::FibreRadiator"+layerstr.str();
719 std::string radName =
"FibreRadiator"+layerstr.str();
724 lRad =
new GeoLogVol(radName, sRad, radMat);
728 GeoTransform *xCool1 =
new GeoTransform(shellPosition.inverse()
729 *GeoTrf::Translate3D(
m_data->barrelXOfCoolingTube[iABC][0],
m_data->barrelYOfCoolingTube[iABC][0],0));
730 GeoTransform *xCool2 =
new GeoTransform(shellPosition.inverse()
731 *GeoTrf::Translate3D(
m_data->barrelXOfCoolingTube[iABC][1],
m_data->barrelYOfCoolingTube[iABC][1],0));
737 size_t nStrawsWithLargeDeadRegion = 0;
739 for (
size_t iLayer = 0; iLayer<
m_data->barrelNumberOfLayersWithLargeDeadRegion; iLayer++) {
740 nStrawsWithLargeDeadRegion +=
m_data->barrelNumberOfStrawsInStrawLayer[iABC][iLayer];
745 GeoTrf::TranslateX3D Xx(1.0);
746 GeoTrf::TranslateY3D Xy(1.0);
748 GENFUNCTION fx =
ArrayFunction(&
m_data->strawXPosition[iABC][0+nStrawsWithLargeDeadRegion],
749 &
m_data->strawXPosition[iABC][0]+
m_data->barrelNumberOfStrawsInModule[iABC]);
751 GENFUNCTION fy =
ArrayFunction(&
m_data->strawYPosition[iABC][0+nStrawsWithLargeDeadRegion],
752 &
m_data->strawYPosition[iABC][0]+
m_data->barrelNumberOfStrawsInModule[iABC]);
753 TRANSFUNCTION tx1 = Pow(Xx,fx)*Pow(Xy,fy);
756 GENFUNCTION fxDead =
ArrayFunction(&
m_data->strawXPosition[iABC][0], &
m_data->strawXPosition[iABC][0+nStrawsWithLargeDeadRegion]);
757 GENFUNCTION fyDead =
ArrayFunction(&
m_data->strawYPosition[iABC][0], &
m_data->strawYPosition[iABC][0+nStrawsWithLargeDeadRegion]);
758 TRANSFUNCTION tx1Dead = Pow(Xx,fxDead)*Pow(Xy,fyDead);
764 TRANSFUNCTION tx1All = Pow(Xx,fxAll)*Pow(Xy,fyAll);
776 m_data->strawYPosition[iABC][
m_data->barrelIndexOfSecondGlobalAlignmentStraw[iABC]],0);
782 GeoTrf::Vector2D local12((Align2Local - Align1Local).
x(),(Align2Local - Align1Local).
y());
783 GeoTrf::Vector2D global12((Align2Global - Align1Global).
x(),(Align2Global - Align1Global).
y());
784 double zrotang = global12.phi()-local12.phi();
788 GeoTrf::Transform3D absStrawXForm = GeoTrf::Translate3D(Align1Global.x(),Align1Global.y(),Align1Global.z())
789 *GeoTrf::RotateZ3D( zrotang )
790 *GeoTrf::Translate3D(-Align1Local.x(),-Align1Local.y(),-Align1Local.z());
796 TRANSFUNCTION tx2=shellPosition.inverse()*absStrawXForm*tx1;
797 TRANSFUNCTION tx2Dead=shellPosition.inverse()*absStrawXForm*tx1Dead;
798 TRANSFUNCTION tx2All=shellPosition.inverse()*absStrawXForm*tx1All;
810 while (c< m_data->barrelNumberOfStrawsInModule[iABC] ) {
833 if((iABC==0)&&(iLayer<=m_data->barrelNumberOfLayersWithLargeDeadRegion )) {
835 double lengthOfActiveGas=
836 (
m_data->barrelLengthOfStraw-
m_data->barrelLengthOfTwister)/2.0 -
m_data->lengthOfDeadRegion-
m_data->barrelLengthOfLargeDeadRegion;
837 double startZOfActiveGas=activeGasZPositionStrawsWithLargeDeadRegion-lengthOfActiveGas/2.0;
838 bDescriptor.back()->strawZPos(activeGasZPositionStrawsWithLargeDeadRegion);
839 bDescriptor.back()->strawZDead(startZOfActiveGas);
840 bDescriptor.back()->strawLength(lengthOfActiveGas);
842 double lengthOfActiveGas=(
m_data->barrelLengthOfStraw-
m_data->barrelLengthOfTwister)/2.0 - 2*
m_data->lengthOfDeadRegion;
843 double startZOfActiveGas=activeGasZPositionNormalStraws-lengthOfActiveGas/2.0;
844 bDescriptor.back()->strawZPos(activeGasZPositionNormalStraws);
845 bDescriptor.back()->strawZDead(startZOfActiveGas);
846 bDescriptor.back()->strawLength(lengthOfActiveGas);
850 bDescriptor.back()->addStraw(
z,
x);
859 pBarrelVol->add(
new GeoSerialIdentifier(0));
860 for (
size_t iMod = 0; iMod<
m_data->nBarrelModulesUsed;iMod++) {
866 GeoFullPhysVol * pShell =
new GeoFullPhysVol(lShell);
870 GeoAlignableTransform * xfx1 =
new GeoAlignableTransform(GeoTrf::RotateZ3D(delta)*shellPosition);
871 pBarrelVol->add(xfx1);
872 pBarrelVol->add(pShell);
881 pShell->add(
new GeoIdentifierTag(iABC));
890 pRad->add(pCoolingTube);
892 pRad->add(pCoolingTube);
893 pRad->add(
new GeoSerialIdentifier(0));
901 ATH_MSG_DEBUG(
"Marking Argon straws from /TRT/Cond/StatusHT:\t"
907 ATH_MSG_DEBUG(
"Marking Krypton straws from /TRT/Cond/StatusHT:\t"
913 ATH_MSG_DEBUG(
"Marking Xenon straws from /TRT/Cond/StatusHT:\t"
916 pHoleForMixedStrawWithLargeDeadRegion =
makeStraw(
true);
920 throw std::runtime_error(
"Unexpected gas mixture");
926 ,
m_data->barrelNumberOfStrawsInModule[iABC]-nStrawsWithLargeDeadRegion);
931 , nStrawsWithLargeDeadRegion);
932 pRad->add(serialTransformerDead);
934 pRad->add(serialTransformer);
949 for (
unsigned int iStrawLayer=0;iStrawLayer<nStrawLayers; iStrawLayer++) {
951 unsigned int jStrawLayer=iStrawLayer;
970 for (
unsigned int e=0;
e<2;
e++) {
971 for (
unsigned int iMod=0;iMod<
m_data->nBarrelModulesUsed; iMod++) {
973 for (
unsigned int iABC=0;iABC<
m_data->nBarrelRings;iABC++) {
987 for (
unsigned int e=0;
e<2;
e++) {
988 for (
unsigned int iABC=0;iABC<
m_data->nBarrelRings;iABC++) {
991 for (
unsigned int iMod=0;iMod<
m_data->nBarrelModulesUsed; iMod++) {
995 current->setPreviousInPhi(prev);
999 if (
m_data->nBarrelModulesUsed==
m_data->nBarrelModules) {
1002 if (
first && last) {
1003 first->setPreviousInPhi(last);
1025 if (!(endcapABPlusPresent || endcapABMinusPresent || endcapCPlusPresent || endcapCMinusPresent)){
1028 unsigned int firstIndexOfA = 0;
1029 unsigned int firstIndexOfB =
m_data->endcapNumberOfAWheels;
1030 unsigned int firstIndexOfC =
m_data->endcapNumberOfAWheels +
m_data->endcapNumberOfBWheels;
1034 if (
m_data->initialLayout) indexUpperBound = firstIndexOfC;
1036 const unsigned int nSides = 2;
1037 const unsigned int nStrawLayMaxEc = 8;
1039 unsigned int iiSide, iiWheel, iiPlane, iiPhi,
counter;
1041 double zdelta = 0.024;
1042 GeoTransform *xfRadiator, *xfPlane, *xfHeatExchanger, *xfFaradayFoilFront, *xfFaradayFoilBack;
1043 GeoTransform *xfInnerSupportGapperA,*xfOuterSupportGapperA, *xfInnerSupportGapperB, *xfOuterSupportGapperB;
1044 GeoFullPhysVol *childPlane =
nullptr;
1047 double RotationsOfStrawPlanes[nStrawLayMaxEc];
1048 double shiftForEachRotation =
m_data->endCapShiftForEachRotation;
1049 RotationsOfStrawPlanes[0] = 0.;
1051 bool oldGeometry =
true;
1053 if (shiftForEachRotation < 0) oldGeometry =
false;
1059 RotationsOfStrawPlanes[
counter] = RotationsOfStrawPlanes[
counter-1] + shiftForEachRotation;
1060 if (RotationsOfStrawPlanes[
counter] >= 1.)
1061 RotationsOfStrawPlanes[
counter] -= 1.;
1065 double RotationsOfStrawPlanesTmp[nStrawLayMaxEc] = {0,0,0,0,2,2,2,2};
1068 RotationsOfStrawPlanes[
counter] = (
counter * shiftForEachRotation) + RotationsOfStrawPlanesTmp[
counter];
1073 std::vector<InDetDD::TRT_EndcapDescriptor*> descriptorsAB[nSides][nStrawLayMaxEc];
1074 std::vector<InDetDD::TRT_EndcapDescriptor*> descriptorsC[nSides][nStrawLayMaxEc];
1078 for(iiSide = 0; iiSide<nSides; iiSide++) {
1079 for(iiPlane = 0; iiPlane < nStrawLayMaxEc; iiPlane++) {
1080 descriptorsAB[iiSide][iiPlane].resize (
m_data->nEndcapPhi);
1081 descriptorsC[iiSide][iiPlane].resize (
m_data->nEndcapPhi);
1088 if (endcapABPlusPresent || endcapABMinusPresent) {
1092 GeoTube* sInnerSupportA =
new GeoTube(
m_data->endCapInnerRadiusOfSupportA,
1093 m_data->endCapInnerRadiusOfSupportA +
m_data->endCapRadialThicknessOfInnerSupportA,
1094 m_data->endCapLengthOfWheelsA/2);
1095 GeoLogVol* lInnerSupportA =
new GeoLogVol(
"InnerSupportA", sInnerSupportA,
m_materialManager->getMaterial(
"trt::InnerSupportA"));
1096 GeoPhysVol* pInnerSupportA =
new GeoPhysVol(lInnerSupportA);
1098 GeoTube* sOuterSupportA =
new GeoTube(
m_data->endCapOuterRadiusOfSupportA -
m_data->endCapRadialThicknessOfOuterSupportA,
1099 m_data->endCapOuterRadiusOfSupportA,
m_data->endCapLengthOfWheelsA/2);
1100 GeoLogVol* lOuterSupportA =
new GeoLogVol(
"OuterSupportA", sOuterSupportA,
m_materialManager->getMaterial(
"trt::OuterSupportA"));
1101 GeoPhysVol* pOuterSupportA =
new GeoPhysVol(lOuterSupportA);
1110 GeoIntrusivePtr<GeoFullPhysVol> pStrawPlaneA =
makeStrawPlane(firstIndexOfA);
1124 GeoTube* sMainRadiatorA =
new GeoTube(
m_data->endCapInnerRadiusOfSupportA +
m_data->endCapRadialThicknessOfInnerSupportA,
1125 m_data->endCapOuterRadiusOfSupportA -
m_data->endCapRadialThicknessOfOuterSupportA
1126 -
m_data->endCapRadialDistFromRadToOuterSupportA,
m_data->endCapMainRadiatorThicknessA/2);
1127 GeoLogVol* lMainRadiatorA =
new GeoLogVol(
"MainRadiatorA",sMainRadiatorA,
m_materialManager->getMaterial(
"trt::FoilRadiatorAC"));
1128 GeoPhysVol* pMainRadiatorA =
new GeoPhysVol(lMainRadiatorA);
1130 GeoTube* sThinRadiatorA =
new GeoTube(
m_data->endCapInnerRadiusOfSupportA +
m_data->endCapRadialThicknessOfInnerSupportA,
1131 m_data->endCapOuterRadiusOfSupportA -
m_data->endCapRadialThicknessOfOuterSupportA
1132 -
m_data->endCapRadialDistFromRadToOuterSupportA,
m_data->endCapThinRadiatorThicknessA/2);
1133 GeoLogVol* lThinRadiatorA =
new GeoLogVol(
"ThinRadiatorA",sThinRadiatorA,
m_materialManager->getMaterial(
"trt::FoilRadiatorAC"));
1134 GeoPhysVol* pThinRadiatorA =
new GeoPhysVol(lThinRadiatorA);
1137 GeoTube* sWheelA =
new GeoTube(
m_data->endCapInnerRadiusOfSupportA,
m_data->endCapOuterRadiusOfSupportA,
m_data->endCapLengthOfWheelsA/2);
1138 GeoLogVol* lWheelA =
new GeoLogVol(
"WheelA", sWheelA,
m_materialManager->getMaterial(
"trt::CO2"));
1176 for(iiSide=0; iiSide<nSides; iiSide++) {
1178 if (pCommonEndcapAB[iiSide]) {
1180 double WheelPlacerA =
m_data->endCapPositionOfFirstWheelA[iiSide];
1182 for(iiWheel=firstIndexOfA; iiWheel < firstIndexOfB; iiWheel++)
1185 WheelPlacerA +=
m_data->endCapDistanceBetweenWheelCentersA[iiSide][iiWheel] ;
1187 GeoFullPhysVol* pWheelA =
new GeoFullPhysVol(lWheelA);
1189 GeoAlignableTransform * xfAlignableModule =
nullptr;
1192 for (iiPlane = 0; iiPlane <
m_data->endCapNumberOfStrawLayersPerWheelA; iiPlane++)
1201 if (iiPlane % 4 == 0) {
1203 int barrel_ec = (iiSide) ? -2 : +2;
1204 xfAlignableModule =
new GeoAlignableTransform(GeoTrf::Transform3D::Identity());
1212 double phiPlane =
m_data->endCapPhiOfFirstStraw + RotationsOfStrawPlanes[iiPlane%nStrawLayMaxEc]*deltaPhiForStrawsA;
1215 if(iiSide && oldGeometry && (iiPlane%8 == 0)) {
1216 phiPlane += deltaPhiForStrawsA;
1219 int bar_ec = (iiSide) ? -2 : +2;
1230 ATH_MSG_DEBUG(
"Marking Argon straws from /TRT/Cond/StatusHT:\t"
1232 childPlane = pStrawPlaneA_Ar->clone();
1235 ATH_MSG_DEBUG(
"Marking Krypton straws from /TRT/Cond/StatusHT:\t"
1237 childPlane = pStrawPlaneA_Kr->clone();
1240 ATH_MSG_DEBUG(
"Marking Xenon straws from /TRT/Cond/StatusHT:\t"
1242 childPlane = pStrawPlaneA->clone();
1246 throw std::runtime_error(
"Unexpected gas mixture");
1251 xfPlane =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionA[iiPlane] -
m_data->endCapLengthOfWheelsA/2)*GeoTrf::RotateZ3D(phiPlane));
1253 if (xfAlignableModule) pWheelA->add(xfAlignableModule);
1254 pWheelA->add(xfPlane);
1255 pWheelA->add(
new GeoIdentifierTag(iiPlane));
1256 pWheelA->add(childPlane);
1260 if(iiWheel==firstIndexOfA && iiPlane < nStrawLayMaxEc)
1261 for(iiPhi = 0; iiPhi <
m_data->nEndcapPhi; iiPhi++)
1267 pDescriptor->
nStraws() =
m_data->endcapNumberOfStrawsInStrawLayer_AWheels/
m_data->nEndcapPhi;
1268 pDescriptor->
strawPitch() = deltaPhiForStrawsA;
1270 double startPhi = phiPlane + iiPhi * pDescriptor->
strawPitch() * pDescriptor->
nStraws();
1284 pDescriptor->
startPhi() = startPhi;
1286 pDescriptor->
strawLength() =
m_data->endCapOuterRadiusOfSupportA -
m_data->endCapRadialThicknessOfOuterSupportA
1287 - 2*
m_data->lengthOfDeadRegion -
m_data->endCapRadialThicknessOfInnerSupportA -
m_data->endCapInnerRadiusOfSupportA;
1288 pDescriptor->
innerRadius() =
m_data->endCapInnerRadiusOfSupportA +
m_data->endCapRadialThicknessOfInnerSupportA
1289 +
m_data->lengthOfDeadRegion;
1292 descriptorsAB[iiSide][iiPlane%nStrawLayMaxEc][iiPhi] = pDescriptor;
1295 for(iiPhi = 0; iiPhi <
m_data->nEndcapPhi; iiPhi++)
1301 int iiPhiOffline = (iiSide==0) ? iiPhi : (3*
m_data->nEndcapPhi/2 - iiPhi - 1)%
m_data->nEndcapPhi;
1303 descriptorsAB[iiSide][iiPlane%nStrawLayMaxEc][iiPhi],
1318 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionA[
counter-1] -
m_data->endCapLengthOfWheelsA/2
1319 -
m_data->outerRadiusOfStraw -
m_data->endCapThinRadiatorThicknessA/2));
1320 pWheelA->add(xfRadiator);
1321 pWheelA->add(pThinRadiatorA);
1326 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionA[
counter-1] -
m_data->endCapLengthOfWheelsA/2
1327 +
m_data->outerRadiusOfStraw +
m_data->endCapThinRadiatorThicknessA/2));
1328 pWheelA->add(xfRadiator);
1329 pWheelA->add(pThinRadiatorA);
1333 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionA[
counter-1] -
m_data->endCapLengthOfWheelsA/2
1334 +
m_data->outerRadiusOfStraw +
m_data->endCapMainRadiatorThicknessA/2));
1335 pWheelA->add(xfRadiator);
1336 pWheelA->add(pMainRadiatorA);
1339 pWheelA->add(pInnerSupportA);
1340 pWheelA->add(pOuterSupportA);
1343 GeoAlignableTransform * xfWheel =
new GeoAlignableTransform( GeoTrf::TranslateZ3D(WheelPlacerA) );
1345 pCommonEndcapAB[iiSide]->add(xfWheel);
1346 pCommonEndcapAB[iiSide]->add(
new GeoIdentifierTag(iiWheel));
1347 pCommonEndcapAB[iiSide]->add(pWheelA);
1350 int barrel_ec = (iiSide) ? -2 : +2;
1354 if (
m_data->includeECFoilHeatExchangerAndMembranes) {
1359 GeoTube* sFaradayFoilWheelAB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportA +
m_data->endCapRadialThicknessOfInnerSupportA,
1360 m_data->endCapOuterRadiusOfSupportA -
m_data->endCapRadialThicknessOfOuterSupportA,
1361 m_data->endCapFaradayFoilThickness/2);
1362 GeoLogVol* lFaradayFoilWheelAB =
new GeoLogVol(
"FaradayKaptonFoil",sFaradayFoilWheelAB,
m_materialManager->getMaterial(
"trt::FaradayFoilMaterial"));
1363 GeoIntrusivePtr<GeoPhysVol> pFaradayFoilWheelAB{
new GeoPhysVol(lFaradayFoilWheelAB)};
1366 GeoTube* sHeatExchangerA =
new GeoTube(
m_data->endCapRMinOfHeatExchanger,
m_data->endCapRMaxOfHeatExchanger,
m_data->endCapHeatExchangerThicknessA/2);
1367 GeoLogVol* lHeatExchangerA =
new GeoLogVol(
"HeatExchangerA",sHeatExchangerA,
m_materialManager->getMaterial(
"trt::HeatExchangerAMat"));
1368 GeoIntrusivePtr<GeoPhysVol> pHeatExchangerA{
new GeoPhysVol(lHeatExchangerA)};
1371 GeoTube* sInnerSupportGapperA =
new GeoTube(
m_data->endCapInnerRadiusOfSupportA,
1372 m_data->endCapInnerRadiusOfSupportA +
m_data->endCapRadialThicknessOfInnerSupportA,
1373 m_data->endCapHeatExchangerThicknessA/2 +
m_data->endCapFaradayFoilThickness/2 + zdelta);
1374 GeoLogVol* lInnerSupportGapperA =
new GeoLogVol(
"InnerSupportGapperA", sInnerSupportGapperA,
m_materialManager->getMaterial(
"trt::InnerSupportA"));
1375 GeoIntrusivePtr<GeoPhysVol> pInnerSupportGapperA{
new GeoPhysVol(lInnerSupportGapperA)};
1377 GeoTube* sOuterSupportGapperA =
new GeoTube(
m_data->endCapOuterRadiusOfSupportA -
m_data->endCapRadialThicknessOfOuterSupportA,
1378 m_data->endCapOuterRadiusOfSupportA,
1379 m_data->endCapHeatExchangerThicknessA/2 +
m_data->endCapFaradayFoilThickness/2 + zdelta);
1380 GeoLogVol* lOuterSupportGapperA =
new GeoLogVol(
"OuterSupportGapperA", sOuterSupportGapperA,
m_materialManager->getMaterial(
"trt::OuterSupportA"));
1381 GeoIntrusivePtr<GeoPhysVol> pOuterSupportGapperA{
new GeoPhysVol(lOuterSupportGapperA)};
1383 if(iiWheel<=firstIndexOfB-1)
1385 xfFaradayFoilFront =
new GeoTransform(GeoTrf::TranslateZ3D(WheelPlacerA
1386 -
m_data->endCapLengthOfWheelsA/2
1387 -
m_data->endCapFaradayFoilThickness/2.0));
1388 xfFaradayFoilBack =
new GeoTransform(GeoTrf::TranslateZ3D(WheelPlacerA
1389 +
m_data->endCapLengthOfWheelsA/2
1390 +
m_data->endCapFaradayFoilThickness/2.0));
1391 pCommonEndcapAB[iiSide]->add(xfFaradayFoilFront);
1392 pCommonEndcapAB[iiSide]->add(pFaradayFoilWheelAB);
1393 pCommonEndcapAB[iiSide]->add(xfFaradayFoilBack);
1394 pCommonEndcapAB[iiSide]->add(pFaradayFoilWheelAB);
1399 if(iiWheel<firstIndexOfB-1)
1401 xfHeatExchanger =
new GeoTransform(GeoTrf::TranslateZ3D( WheelPlacerA
1402 +
m_data->endCapLengthOfWheelsA/2
1403 +
m_data->endCapFaradayFoilThickness
1404 +
m_data->endCapHeatExchangerThicknessA/2));
1405 pCommonEndcapAB[iiSide]->add(xfHeatExchanger);
1406 pCommonEndcapAB[iiSide]->add(pHeatExchangerA);
1408 xfInnerSupportGapperA =
new GeoTransform(GeoTrf::TranslateZ3D( WheelPlacerA
1409 +
m_data->endCapLengthOfWheelsA/2
1410 +
m_data->endCapFaradayFoilThickness
1411 +
m_data->endCapHeatExchangerThicknessA/2));
1412 xfOuterSupportGapperA =
new GeoTransform(GeoTrf::TranslateZ3D( WheelPlacerA
1413 +
m_data->endCapLengthOfWheelsA/2
1414 +
m_data->endCapFaradayFoilThickness
1415 +
m_data->endCapHeatExchangerThicknessA/2));
1416 pCommonEndcapAB[iiSide]->add(xfInnerSupportGapperA);
1417 pCommonEndcapAB[iiSide]->add(pInnerSupportGapperA);
1418 pCommonEndcapAB[iiSide]->add(xfOuterSupportGapperA);
1419 pCommonEndcapAB[iiSide]->add(pOuterSupportGapperA);
1436 GeoTube* sInnerSupportB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportB,
1437 m_data->endCapInnerRadiusOfSupportB +
m_data->endCapRadialThicknessOfInnerSupportB,
1438 m_data->endCapLengthOfWheelsB/2);
1439 GeoLogVol* lInnerSupportB =
new GeoLogVol(
"InnerSupportB", sInnerSupportB,
m_materialManager->getMaterial(
"trt::InnerSupportB"));
1440 GeoPhysVol* pInnerSupportB =
new GeoPhysVol(lInnerSupportB);
1442 GeoTube* sOuterSupportB =
new GeoTube(
m_data->endCapOuterRadiusOfSupportB -
m_data->endCapRadialThicknessOfOuterSupportB,
1443 m_data->endCapOuterRadiusOfSupportB,
m_data->endCapLengthOfWheelsB/2);
1444 GeoLogVol* lOuterSupportB =
new GeoLogVol(
"OuterSupportB", sOuterSupportB,
m_materialManager->getMaterial(
"trt::OuterSupportB"));
1445 GeoPhysVol* pOuterSupportB =
new GeoPhysVol(lOuterSupportB);
1448 GeoFullPhysVol* pStrawPlaneB_Kr =
nullptr;
1449 GeoFullPhysVol* pStrawPlaneB_Ar =
nullptr;
1454 GeoIntrusivePtr<GeoFullPhysVol> pStrawPlaneB {
makeStrawPlane(firstIndexOfB)};
1458 GeoTube* sMainRadiatorB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportB +
m_data->endCapRadialThicknessOfInnerSupportB,
1459 m_data->endCapOuterRadiusOfSupportB -
m_data->endCapRadialThicknessOfOuterSupportB
1460 -
m_data->endCapRadialDistFromRadToOuterSupportB,
m_data->endCapMainRadiatorThicknessB/2);
1461 GeoLogVol* lMainRadiatorB =
new GeoLogVol(
"MainRadiatorB",sMainRadiatorB,
m_materialManager->getMaterial(
"trt::FoilRadiatorB"));
1462 GeoPhysVol* pMainRadiatorB =
new GeoPhysVol(lMainRadiatorB);
1464 GeoTube* sThinRadiatorB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportB +
m_data->endCapRadialThicknessOfInnerSupportB,
1465 m_data->endCapOuterRadiusOfSupportB -
m_data->endCapRadialThicknessOfOuterSupportB
1466 -
m_data->endCapRadialDistFromRadToOuterSupportB,
1467 m_data->endCapThinRadiatorThicknessB/2);
1468 GeoLogVol* lThinRadiatorB =
new GeoLogVol(
"ThinRadiatorB",sThinRadiatorB,
m_materialManager->getMaterial(
"trt::FoilRadiatorB"));
1469 GeoPhysVol* pThinRadiatorB =
new GeoPhysVol(lThinRadiatorB);
1471 GeoTube* sMiddleRadiatorB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportB +
m_data->endCapRadialThicknessOfInnerSupportB,
1472 m_data->endCapOuterRadiusOfSupportB -
m_data->endCapRadialThicknessOfOuterSupportB
1473 -
m_data->endCapRadialDistFromRadToOuterSupportB,
m_data->endCapMiddleRadiatorThicknessB/2);
1474 GeoLogVol* lMiddleRadiatorB =
new GeoLogVol(
"MiddleRadiatorB",sMiddleRadiatorB,
m_materialManager->getMaterial(
"trt::FoilRadiatorB"));
1475 GeoPhysVol* pMiddleRadiatorB =
new GeoPhysVol(lMiddleRadiatorB);
1479 GeoTube* sWheelB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportB,
m_data->endCapOuterRadiusOfSupportB,
m_data->endCapLengthOfWheelsB/2);
1480 GeoLogVol* lWheelB =
new GeoLogVol(
"WheelB", sWheelB,
m_materialManager->getMaterial(
"trt::CO2"));
1485 for(iiSide=0; iiSide<nSides; iiSide++) {
1487 double WheelPlacerB =
m_data->endCapPositionOfFirstWheelB[iiSide];
1490 if (pCommonEndcapAB[iiSide]) {
1491 for(iiWheel=firstIndexOfB; iiWheel < firstIndexOfC; iiWheel++)
1494 WheelPlacerB +=
m_data->endCapDistanceBetweenWheelCentersB[iiSide][iiWheel];
1496 GeoFullPhysVol* pWheelB =
new GeoFullPhysVol(lWheelB);
1498 GeoAlignableTransform * xfAlignableModule =
nullptr;
1501 for (iiPlane = 0; iiPlane <
m_data->endCapNumberOfStrawLayersPerWheelB; iiPlane++)
1508 if (iiPlane % 4 == 0) {
1510 int barrel_ec = (iiSide) ? -2 : +2;
1511 xfAlignableModule =
new GeoAlignableTransform(GeoTrf::Transform3D::Identity());
1518 int bar_ec = (iiSide) ? -2 : +2;
1529 ATH_MSG_DEBUG(
"Marking Argon straws from /TRT/Cond/StatusHT:\t"
1531 childPlane = pStrawPlaneB_Ar->clone();
1534 ATH_MSG_DEBUG(
"Marking Krypton straws from /TRT/Cond/StatusHT:\t"
1536 childPlane = pStrawPlaneB_Kr->clone();
1539 ATH_MSG_DEBUG(
"Marking Xenon straws from /TRT/Cond/StatusHT:\t"
1541 childPlane = pStrawPlaneB->clone();
1545 throw std::runtime_error(
"Unexpected gas mixture");
1550 double phiPlane =
m_data->endCapPhiOfFirstStraw + RotationsOfStrawPlanes[iiPlane%nStrawLayMaxEc]*deltaPhiForStrawsB;
1553 if(iiSide && oldGeometry && (iiPlane%8 == 0)) {
1554 phiPlane += deltaPhiForStrawsB;
1557 xfPlane =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionB[iiPlane]
1558 -
m_data->endCapLengthOfWheelsB/2)*GeoTrf::RotateZ3D(phiPlane));
1560 if (xfAlignableModule) pWheelB->add(xfAlignableModule);
1561 pWheelB->add(xfPlane);
1562 pWheelB->add(
new GeoIdentifierTag(iiPlane));
1563 pWheelB->add(childPlane);
1566 for(iiPhi = 0; iiPhi <
m_data->nEndcapPhi; iiPhi++)
1572 int iiPhiOffline = (iiSide==0) ? iiPhi : (3*
m_data->nEndcapPhi/2 - iiPhi - 1)%
m_data->nEndcapPhi;
1574 descriptorsAB[iiSide][iiPlane%nStrawLayMaxEc][iiPhi],
1591 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionB[
counter-1] -
m_data->endCapLengthOfWheelsB/2
1592 +
m_data->outerRadiusOfStraw +
m_data->endCapMainRadiatorThicknessB/2));
1593 pWheelB->add(xfRadiator);
1594 pWheelB->add(pMainRadiatorB);
1601 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionB[
counter-1] -
m_data->endCapLengthOfWheelsB/2 +
sign*(
m_data->outerRadiusOfStraw +
m_data->endCapThinRadiatorThicknessB/2)));
1602 pWheelB->add(xfRadiator);
1603 pWheelB->add(pThinRadiatorB);
1610 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionB[
counter-1] -
m_data->endCapLengthOfWheelsB/2 +
sign*(
m_data->outerRadiusOfStraw +
m_data->endCapMiddleRadiatorThicknessB/2)));
1611 pWheelB->add(xfRadiator);
1612 pWheelB->add(pMiddleRadiatorB);
1617 pWheelB->add(pInnerSupportB);
1618 pWheelB->add(pOuterSupportB);
1621 GeoAlignableTransform * xfWheel =
new GeoAlignableTransform(GeoTrf::TranslateZ3D( WheelPlacerB ));
1624 pCommonEndcapAB[iiSide]->add(xfWheel);
1625 pCommonEndcapAB[iiSide]->add(
new GeoIdentifierTag(iiWheel));
1626 pCommonEndcapAB[iiSide]->add(pWheelB);
1629 int barrel_ec = (iiSide) ? -2 : +2;
1634 if (
m_data->includeECFoilHeatExchangerAndMembranes) {
1639 GeoTube* sFaradayFoilWheelAB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportB +
m_data->endCapRadialThicknessOfInnerSupportB,
1640 m_data->endCapOuterRadiusOfSupportB -
m_data->endCapRadialThicknessOfOuterSupportB,
1641 m_data->endCapFaradayFoilThickness/2);
1642 GeoLogVol* lFaradayFoilWheelAB =
new GeoLogVol(
"FaradayKaptonFoil",sFaradayFoilWheelAB,
m_materialManager->getMaterial(
"trt::FaradayFoilMaterial"));
1643 GeoIntrusivePtr<GeoPhysVol> pFaradayFoilWheelAB{
new GeoPhysVol(lFaradayFoilWheelAB)};
1646 GeoTube* sHeatExchangerB =
new GeoTube(
m_data->endCapRMinOfHeatExchanger,
m_data->endCapRMaxOfHeatExchanger,
m_data->endCapHeatExchangerThicknessB/2);
1648 GeoLogVol* lHeatExchangerB =
new GeoLogVol(
"HeatExchangerB", sHeatExchangerB,
m_materialManager->getMaterial(
"trt::HeatExchangerBMat"));
1649 GeoIntrusivePtr<GeoPhysVol> pHeatExchangerB{
new GeoPhysVol(lHeatExchangerB)};
1652 GeoTube* sInnerSupportGapperB =
new GeoTube(
m_data->endCapInnerRadiusOfSupportB,
1653 m_data->endCapInnerRadiusOfSupportB +
m_data->endCapRadialThicknessOfInnerSupportB,
1654 m_data->endCapHeatExchangerThicknessB/2 +
m_data->endCapFaradayFoilThickness/2 + zdelta);
1655 GeoLogVol* lInnerSupportGapperB =
new GeoLogVol(
"InnerSupportGapperB", sInnerSupportGapperB,
m_materialManager->getMaterial(
"trt::InnerSupportB"));
1656 GeoIntrusivePtr<GeoPhysVol> pInnerSupportGapperB{
new GeoPhysVol(lInnerSupportGapperB)};
1658 GeoTube* sOuterSupportGapperB =
new GeoTube(
m_data->endCapOuterRadiusOfSupportB -
m_data->endCapRadialThicknessOfOuterSupportB,
1659 m_data->endCapOuterRadiusOfSupportB,
1660 m_data->endCapHeatExchangerThicknessB/2 +
m_data->endCapFaradayFoilThickness/2 + zdelta);
1661 GeoLogVol* lOuterSupportGapperB =
new GeoLogVol(
"OuterSupportGapperB", sOuterSupportGapperB,
m_materialManager->getMaterial(
"trt::OuterSupportB"));
1662 GeoIntrusivePtr<GeoPhysVol> pOuterSupportGapperB{
new GeoPhysVol(lOuterSupportGapperB)};
1665 if(iiWheel-firstIndexOfB<firstIndexOfC-firstIndexOfB)
1667 xfFaradayFoilFront =
new GeoTransform(GeoTrf::TranslateZ3D(WheelPlacerB
1668 -
m_data->endCapLengthOfWheelsB/2
1669 -
m_data->endCapFaradayFoilThickness/2.0));
1670 xfFaradayFoilBack =
new GeoTransform(GeoTrf::TranslateZ3D(WheelPlacerB
1671 +
m_data->endCapLengthOfWheelsB/2
1672 +
m_data->endCapFaradayFoilThickness/2.0));
1674 pCommonEndcapAB[iiSide]->add(xfFaradayFoilFront);
1675 pCommonEndcapAB[iiSide]->add(pFaradayFoilWheelAB);
1676 pCommonEndcapAB[iiSide]->add(xfFaradayFoilBack);
1677 pCommonEndcapAB[iiSide]->add(pFaradayFoilWheelAB);
1682 if(iiWheel-firstIndexOfB<firstIndexOfC-firstIndexOfB-1)
1684 xfHeatExchanger =
new GeoTransform(GeoTrf::TranslateZ3D( WheelPlacerB
1685 +
m_data->endCapLengthOfWheelsB/2
1686 +
m_data->endCapFaradayFoilThickness
1687 +
m_data->endCapHeatExchangerThicknessB/2));
1688 pCommonEndcapAB[iiSide]->add(xfHeatExchanger);
1689 pCommonEndcapAB[iiSide]->add(pHeatExchangerB);
1691 xfInnerSupportGapperB =
new GeoTransform(GeoTrf::TranslateZ3D(WheelPlacerB
1692 +
m_data->endCapLengthOfWheelsB/2
1693 +
m_data->endCapFaradayFoilThickness
1694 +
m_data->endCapHeatExchangerThicknessB/2));
1696 xfOuterSupportGapperB =
new GeoTransform(GeoTrf::TranslateZ3D(WheelPlacerB
1697 +
m_data->endCapLengthOfWheelsB/2
1698 +
m_data->endCapFaradayFoilThickness
1699 +
m_data->endCapHeatExchangerThicknessB/2));
1700 pCommonEndcapAB[iiSide]->add(xfInnerSupportGapperB);
1701 pCommonEndcapAB[iiSide]->add(pInnerSupportGapperB);
1702 pCommonEndcapAB[iiSide]->add(xfOuterSupportGapperB);
1703 pCommonEndcapAB[iiSide]->add(pOuterSupportGapperB);
1719 if (
m_data->includeECFoilHeatExchangerAndMembranes) {
1722 GeoTube* sMbrane =
new GeoTube(
m_data->endCapRMinOfMbrane,
m_data->endCapRMaxOfMbrane,
m_data->endCapThicknessOfMbrane/2.0);
1723 GeoLogVol* lMbrane =
new GeoLogVol(
"Membrane", sMbrane,
m_materialManager->getMaterial(
"trt::EndCapMbrane"));
1724 GeoPhysVol* pMbrane =
new GeoPhysVol(lMbrane);
1726 GeoTransform *xfMbraneWheelA1 =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapZMinOfMbraneWheelA1 +
m_data->endCapThicknessOfMbrane/2.0));
1727 GeoTransform *xfMbraneWheelA2 =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapZMinOfMbraneWheelA2 +
m_data->endCapThicknessOfMbrane/2.0));
1728 GeoTransform *xfMbraneWheelB1 =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapZMinOfMbraneWheelB1 +
m_data->endCapThicknessOfMbrane/2.0));
1729 GeoTransform *xfMbraneWheelB2 =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapZMinOfMbraneWheelB2 +
m_data->endCapThicknessOfMbrane/2.0));
1731 for(iiSide=0; iiSide<nSides; iiSide++) {
1732 pCommonEndcapAB[iiSide]->add(xfMbraneWheelA1);
1733 pCommonEndcapAB[iiSide]->add(pMbrane);
1734 pCommonEndcapAB[iiSide]->add(xfMbraneWheelA2);
1735 pCommonEndcapAB[iiSide]->add(pMbrane);
1736 pCommonEndcapAB[iiSide]->add(xfMbraneWheelB1);
1737 pCommonEndcapAB[iiSide]->add(pMbrane);
1738 pCommonEndcapAB[iiSide]->add(xfMbraneWheelB2);
1739 pCommonEndcapAB[iiSide]->add(pMbrane);
1747 if (endcapCPlusPresent || endcapCMinusPresent) {
1749 GeoTube* sInnerSupportC =
new GeoTube(
m_data->endCapInnerRadiusOfSupportC,
m_data->endCapInnerRadiusOfSupportC
1750 +
m_data->endCapRadialThicknessOfInnerSupportC,
m_data->endCapLengthOfWheelsC/2);
1751 GeoLogVol* lInnerSupportC =
new GeoLogVol(
"InnerSupportC", sInnerSupportC,
m_materialManager->getMaterial(
"trt::InnerSupportC"));
1752 GeoPhysVol* pInnerSupportC =
new GeoPhysVol(lInnerSupportC);
1754 GeoTube* sOuterSupportC =
new GeoTube(
m_data->endCapOuterRadiusOfSupportC -
m_data->endCapRadialThicknessOfOuterSupportC,
1755 m_data->endCapOuterRadiusOfSupportC,
m_data->endCapLengthOfWheelsC/2);
1756 GeoLogVol* lOuterSupportC =
new GeoLogVol(
"OuterSupportC", sOuterSupportC,
m_materialManager->getMaterial(
"trt::OuterSupportC"));
1757 GeoPhysVol* pOuterSupportC =
new GeoPhysVol(lOuterSupportC);
1760 GeoIntrusivePtr<GeoFullPhysVol> pStrawPlaneC =
makeStrawPlane(firstIndexOfC);
1763 GeoTube* sMainRadiatorC =
new GeoTube(
m_data->endCapInnerRadiusOfSupportC +
m_data->endCapRadialThicknessOfInnerSupportC,
1764 m_data->endCapOuterRadiusOfSupportC -
m_data->endCapRadialThicknessOfOuterSupportC
1765 -
m_data->endCapRadialDistFromRadToOuterSupportC,
m_data->endCapMainRadiatorThicknessC/2);
1766 GeoLogVol* lMainRadiatorC =
new GeoLogVol(
"MainRadiatorC",sMainRadiatorC,
m_materialManager->getMaterial(
"trt::FoilRadiatorAC"));
1767 GeoPhysVol* pMainRadiatorC =
new GeoPhysVol(lMainRadiatorC);
1769 GeoTube* sThinRadiatorC =
new GeoTube(
m_data->endCapInnerRadiusOfSupportC +
m_data->endCapRadialThicknessOfInnerSupportC,
1770 m_data->endCapOuterRadiusOfSupportC -
m_data->endCapRadialThicknessOfOuterSupportC
1771 -
m_data->endCapRadialDistFromRadToOuterSupportC,
m_data->endCapThinRadiatorThicknessC/2);
1772 GeoLogVol* lThinRadiatorC =
new GeoLogVol(
"ThinRadiatorC",sThinRadiatorC,
m_materialManager->getMaterial(
"trt::FoilRadiatorAC"));
1773 GeoPhysVol* pThinRadiatorC =
new GeoPhysVol(lThinRadiatorC);
1776 GeoTube* sWheelC =
new GeoTube(
m_data->endCapInnerRadiusOfSupportC,
m_data->endCapOuterRadiusOfSupportC,
m_data->endCapLengthOfWheelsC/2);
1777 GeoLogVol* lWheelC =
new GeoLogVol(
"WheelC", sWheelC,
m_materialManager->getMaterial(
"trt::CO2"));
1782 for(iiSide=0; iiSide<nSides; iiSide++) {
1784 if (pCommonEndcapC[iiSide]) {
1785 for(iiWheel=firstIndexOfC; iiWheel < indexUpperBound; iiWheel++)
1787 GeoFullPhysVol* pWheelC =
new GeoFullPhysVol(lWheelC);
1790 for (iiPlane = 0; iiPlane <
m_data->endCapNumberOfStrawLayersPerWheelC; iiPlane++)
1793 double phiPlane =
m_data->endCapPhiOfFirstStraw + RotationsOfStrawPlanes[iiPlane%nStrawLayMaxEc]*deltaPhiForStrawsC;
1796 if(iiSide && oldGeometry && (iiPlane%8 == 0)) {
1797 phiPlane += deltaPhiForStrawsC;
1801 childPlane = pStrawPlaneC->clone();
1803 xfPlane =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionC[iiPlane]
1804 -
m_data->endCapLengthOfWheelsC/2)*GeoTrf::RotateZ3D(phiPlane));
1805 pWheelC->add(xfPlane);
1806 pWheelC->add(
new GeoIdentifierTag(iiPlane));
1807 pWheelC->add(childPlane);
1811 if(iiWheel==firstIndexOfC && iiPlane < nStrawLayMaxEc)
1812 for(iiPhi = 0; iiPhi <
m_data->nEndcapPhi; iiPhi++)
1817 pDescriptor->
nStraws() =
m_data->endcapNumberOfStrawsInStrawLayer_CWheels/
m_data->nEndcapPhi;
1818 pDescriptor->
strawPitch() = deltaPhiForStrawsC;
1821 double startPhi = phiPlane + iiPhi * pDescriptor->
strawPitch() * pDescriptor->
nStraws();
1834 pDescriptor->
startPhi() = startPhi;
1836 pDescriptor->
strawLength() =
m_data->endCapOuterRadiusOfSupportC -
m_data->endCapRadialThicknessOfOuterSupportC
1837 - 2*
m_data->lengthOfDeadRegion -
m_data->endCapRadialThicknessOfInnerSupportC -
m_data->endCapInnerRadiusOfSupportC;
1838 pDescriptor->
innerRadius() =
m_data->endCapInnerRadiusOfSupportC +
m_data->endCapRadialThicknessOfInnerSupportC +
m_data->lengthOfDeadRegion;
1842 descriptorsC[iiSide][iiPlane%nStrawLayMaxEc][iiPhi] = pDescriptor;
1846 for(iiPhi = 0; iiPhi <
m_data->nEndcapPhi; iiPhi++)
1852 int iiPhiOffline = (iiSide==0) ? iiPhi : (3*
m_data->nEndcapPhi/2 - iiPhi - 1)%
m_data->nEndcapPhi;
1854 descriptorsC[iiSide][iiPlane%nStrawLayMaxEc][iiPhi],
1870 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionC[
counter-1] -
m_data->endCapLengthOfWheelsC/2
1871 -
m_data->lengthOfDeadRegion -
m_data->endCapThinRadiatorThicknessC/2));
1872 pWheelC->add(xfRadiator);
1873 pWheelC->add(pThinRadiatorC);
1878 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionC[
counter-1] -
m_data->endCapLengthOfWheelsC/2
1879 +
m_data->outerRadiusOfStraw +
m_data->endCapThinRadiatorThicknessC/2));
1880 pWheelC->add(xfRadiator);
1881 pWheelC->add(pThinRadiatorC);
1885 xfRadiator =
new GeoTransform(GeoTrf::TranslateZ3D(
m_data->endCapLayerZPositionC[
counter-1] -
m_data->endCapLengthOfWheelsC/2
1886 +
m_data->outerRadiusOfStraw +
m_data->endCapMainRadiatorThicknessC/2));
1887 pWheelC->add(xfRadiator);
1888 pWheelC->add(pMainRadiatorC);
1892 pWheelC->add(pInnerSupportC);
1893 pWheelC->add(pOuterSupportC);
1896 GeoAlignableTransform * xfWheel
1897 =
new GeoAlignableTransform(GeoTrf::TranslateZ3D(
m_data->endCapPositionOfFirstWheelC
1898 + (iiWheel - firstIndexOfC)*
m_data->endCapDistanceBetweenWheelCentersC));
1900 pCommonEndcapC[iiSide]->add(xfWheel);
1901 pCommonEndcapC[iiSide]->add(
new GeoIdentifierTag(iiWheel));
1902 pCommonEndcapC[iiSide]->add(pWheelC);
1905 int barrel_ec = (iiSide) ? -2 : +2;
1918 for (iiSide=0; iiSide<2; iiSide++)
1919 for(iiPhi=0; iiPhi<
m_data->nEndcapPhi; iiPhi++)
1922 for (iiWheel=0; iiWheel<indexUpperBound; iiWheel++)
1929 current->setPreviousInZ(prev);