804 Acts::CylinderVolumeBuilder::Config cvbCfg;
805 Acts::CylinderVolumeBuilder cvb(
809 Acts::VolumeConfig sctNegEC =
810 cvb.analyzeContent(gctx, sct_lb.negativeLayers(gctx), {});
812 Acts::VolumeConfig sctPosEC =
813 cvb.analyzeContent(gctx, sct_lb.positiveLayers(gctx), {});
815 Acts::VolumeConfig sctBrl =
816 cvb.analyzeContent(gctx, sct_lb.centralLayers(gctx), {});
819 Acts::VolumeConfig trtNegEC =
820 cvb.analyzeContent(gctx, trt_lb.negativeLayers(gctx), {});
822 Acts::VolumeConfig trtPosEC =
823 cvb.analyzeContent(gctx, trt_lb.positiveLayers(gctx), {});
825 Acts::VolumeConfig trtBrl =
826 cvb.analyzeContent(gctx, trt_lb.centralLayers(gctx), {});
830 double absZMinEC =
std::min(std::abs(trtNegEC.zMax), std::abs(trtPosEC.zMin));
831 double absZMaxEC =
std::max(std::abs(trtNegEC.zMin), std::abs(trtPosEC.zMax));
833 trtNegEC.zMin = -absZMaxEC;
834 trtNegEC.zMax = -absZMinEC;
835 trtPosEC.zMin = absZMinEC;
836 trtPosEC.zMax = absZMaxEC;
838 using CVBBV = Acts::CylinderVolumeBounds::BoundValues;
841 bool isSCTSmallerInZ =
false;
843 ATH_MSG_VERBOSE(
"Shrinking SCT in R (and maybe in increase size in Z) to fit around Pixel");
844 auto pixelBounds =
dynamic_cast<const Acts::CylinderVolumeBounds *
>(
845 &
pixel->volumeBounds());
846 double sctNegECzMin =
std::min(sctNegEC.zMin, -pixelBounds->get(CVBBV::eHalfLengthZ));
847 double sctPosECzMax =
std::max(sctPosEC.zMax, pixelBounds->get(CVBBV::eHalfLengthZ));
849 ATH_MSG_VERBOSE(
"- SCT +-EC.rMin: " << sctNegEC.rMin <<
" -> " << pixelBounds->get(CVBBV::eMaxR));
850 ATH_MSG_VERBOSE(
"- SCT BRL.rMin: " << sctBrl.rMin <<
" -> " << pixelBounds->get(CVBBV::eMaxR));
851 ATH_MSG_VERBOSE(
"- SCT EC.zMin: " << sctNegEC.zMin <<
" -> " << sctNegECzMin);
852 ATH_MSG_VERBOSE(
"- SCT EC.zMax: " << sctPosEC.zMax <<
" -> " << sctPosECzMax);
854 sctNegEC.rMin = pixelBounds->get(CVBBV::eMaxR);
855 sctPosEC.rMin = pixelBounds->get(CVBBV::eMaxR);
856 sctBrl.rMin = pixelBounds->get(CVBBV::eMaxR);
858 isSCTSmallerInZ = sctPosEC.zMax < pixelBounds->get(CVBBV::eHalfLengthZ);
860 sctNegEC.zMin = sctNegECzMin;
861 sctPosEC.zMax = sctPosECzMax;
871 << sctNegEC.toString());
872 ATH_MSG_VERBOSE(
"- SCT::Barrel: " << sctBrl.layers.size() <<
" layers, "
873 << sctBrl.toString());
876 << sctPosEC.toString());
881 << trtNegEC.toString());
882 ATH_MSG_VERBOSE(
"- TRT::Barrel: " << trtBrl.layers.size() <<
" layers, "
883 << trtBrl.toString());
886 << trtPosEC.toString());
890 sctBrl.zMax = (sctBrl.zMax + sctPosEC.zMin) / 2.;
891 sctBrl.zMin = -sctBrl.zMax;
895 trtBrl.zMin = sctBrl.zMin;
896 trtBrl.zMax = sctBrl.zMax;
899 trtNegEC.zMin = sctNegEC.zMin;
900 trtPosEC.zMax = sctPosEC.zMax;
903 trtNegEC.zMax = trtBrl.zMin;
904 sctNegEC.zMax = trtBrl.zMin;
905 trtPosEC.zMin = trtBrl.zMax;
906 sctPosEC.zMin = trtBrl.zMax;
909 sctBrl.rMax = trtBrl.rMin;
910 sctNegEC.rMax = trtNegEC.rMin;
911 sctPosEC.rMax = trtPosEC.rMin;
914 trtNegEC.rMax = trtBrl.rMax;
915 trtPosEC.rMax = trtBrl.rMax;
917 ATH_MSG_VERBOSE(
"Dimensions after synchronization between SCT and TRT");
921 << sctNegEC.toString());
922 ATH_MSG_VERBOSE(
"- SCT::Barrel: " << sctBrl.layers.size() <<
" layers, "
923 << sctBrl.toString());
926 << sctPosEC.toString());
931 << trtNegEC.toString());
932 ATH_MSG_VERBOSE(
"- TRT::Barrel: " << trtBrl.layers.size() <<
" layers, "
933 << trtBrl.toString());
936 << trtPosEC.toString());
938 auto makeTVol = [&](
const auto &vConf,
const auto &
name) {
939 return cvh.createTrackingVolume(gctx, vConf.layers, {},
941 vConf.rMin, vConf.rMax, vConf.zMin,
946 auto tvSctNegEC = makeTVol(sctNegEC,
"SCT::NegativeEndcap");
947 auto tvSctBrl = makeTVol(sctBrl,
"SCT::Barrel");
948 auto tvSctPosEC = makeTVol(sctPosEC,
"SCT::PositiveEndcap");
950 auto tvTrtNegEC = makeTVol(trtNegEC,
"TRT::NegativeEndcap");
951 auto tvTrtBrl = makeTVol(trtBrl,
"TRT::Barrel");
952 auto tvTrtPosEC = makeTVol(trtPosEC,
"TRT::PositiveEndcap");
956 cvh.createContainerTrackingVolume(gctx, {tvSctNegEC, tvTrtNegEC});
958 cvh.createContainerTrackingVolume(gctx, {tvSctPosEC, tvTrtPosEC});
959 auto barrel = cvh.createContainerTrackingVolume(gctx, {tvSctBrl, tvTrtBrl});
964 cvh.createContainerTrackingVolume(gctx, {negEC,
barrel, posEC});
969 auto containerBounds =
dynamic_cast<const Acts::CylinderVolumeBounds *
>(
970 &container->volumeBounds());
971 auto pixelBounds =
dynamic_cast<const Acts::CylinderVolumeBounds *
>(
972 &
pixel->volumeBounds());
973 std::vector<std::shared_ptr<Acts::TrackingVolume>> noVolumes;
975 if(!isSCTSmallerInZ) {
977 auto posGap = cvh.createGapTrackingVolume(
980 pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
981 pixelBounds->get(CVBBV::eHalfLengthZ),
982 containerBounds->get(CVBBV::eHalfLengthZ),
985 "Pixel::PositiveGap");
986 auto negGap = cvh.createGapTrackingVolume(
989 pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
990 -containerBounds->get(CVBBV::eHalfLengthZ),
991 -pixelBounds->get(CVBBV::eHalfLengthZ),
994 "Pixel::NegativeGap");
997 cvh.createContainerTrackingVolume(gctx, {negGap,
pixel, posGap});
1000 cvh.createContainerTrackingVolume(gctx, {
pixelContainer, container});
1005 cvh.createContainerTrackingVolume(gctx, {
pixel, container});