TrackingGeometry Interface method.
107 double enclosedInnerSectorHalflength = 0.;
108 double enclosedInnerSectorRadius = 0.;
122 if (!innerDetectorBounds)
125 enclosedInnerSectorHalflength = innerDetectorBounds->
halflengthZ();
126 enclosedInnerSectorRadius = innerDetectorBounds->
outerRadius();
128 keyDim.emplace_back(enclosedInnerSectorRadius, enclosedInnerSectorHalflength);
136 for (
unsigned int i = 0;
i < envelopeDefsIn.size();
i++) {
139 else if (envelopeDefsIn[
i].
second == envelopeDefsIn[ii].
second &&
140 envelopeDefsIn[
i].
first > envelopeDefsIn[ii].
first)
146 unsigned int inext = ii + 1;
147 if (inext == envelopeDefsIn.size())
149 if (envelopeDefsIn[inext].
second != envelopeDefsIn[ii].
second) {
151 inext = ii > 0 ? ii - 1 : envelopeDefsIn.size() - 1;
157 for (
unsigned int i = inext;
i < envelopeDefsIn.size();
i++)
158 envelopeDefs.push_back(envelopeDefsIn[
i]);
160 for (
unsigned int i = 0;
i <= inext - 1;
i++)
161 envelopeDefs.push_back(envelopeDefsIn[
i]);
165 envelopeDefs.push_back(envelopeDefsIn[
i]);
168 inext = envelopeDefsIn.size() - 1;
169 while (inext >= ii) {
170 envelopeDefs.push_back(envelopeDefsIn[inext]);
179 for (
unsigned int i = 0;
i < envelopeDefs.size();
i++) {
182 if (std::abs(envelopeDefs[
i].
second) < envEnclosingVolumeHalfZ)
183 envEnclosingVolumeHalfZ = std::abs(envelopeDefs[
i].
second);
185 if (envelopeDefs[
i].
first > 1100. && envelopeDefs[
i].
first < 1200. &&
188 if (enclosedInnerSectorRadius != envelopeDefs[
i].
first)
190 "Enclosed ID volume radius does not match ID envelope, adjusting "
192 envEnclosingVolumeHalfZ = envelopeDefs[
i].second;
194 enclosedInnerSectorRadius = envelopeDefs[
i].first;
195 enclosedInnerSectorHalflength = envelopeDefs[
i].second;
201 if (envelopeDefs[
i].
second > 0. && envelopeDefs[
i].
second < 6785. &&
202 (envelopeDefs[
i].
first > 1200. ||
203 envelopeDefs[
i].
second > envEnclosingVolumeHalfZ)) {
204 if (msCutouts.empty())
205 msCutouts.push_back(envelopeDefs[
i]);
208 while (envIter != msCutouts.end() &&
209 (*envIter).second < envelopeDefs[
i].second)
211 while (envIter != msCutouts.end() &&
212 (*envIter).second == envelopeDefs[
i].second &&
213 (*envIter).first > envelopeDefs[
i].first)
215 msCutouts.insert(envIter, envelopeDefs[
i]);
221 for (
unsigned int i = 0;
i < msCutouts.size();
i++)
223 <<
i <<
":" << msCutouts[
i].
first <<
","
231 if (!msCutouts.empty()) {
232 caloDefaultRadius = msCutouts[0].first;
233 caloDefaultHalflengthZ = msCutouts[0].second;
235 " Calo central cylinder dimensions adjusted using EnvelopeSvc:"
243 enclosedInnerSectorRadius, enclosedInnerSectorHalflength);
249 dummyVolumes,
"Calo::GapVolumes::DummyID");
251 keyDim.emplace_back(enclosedInnerSectorRadius, enclosedInnerSectorHalflength);
259 for (
unsigned int i = 0;
i < bpDefs.size();
i++) {
265 bpDefs[
i].
second >= envEnclosingVolumeHalfZ &&
266 bpDefs[
i].
second <= msCutouts.back().second) {
267 bpCutouts.push_back(bpDefs[
i]);
270 keyDim.push_back(bpDefs[
i]);
277 if (bpCutouts.size() > 1 &&
278 bpCutouts.back().second == bpCutouts[bpCutouts.size() - 2].second)
279 bpCutouts.erase(bpCutouts.end() - 1);
281 for (
unsigned int i = 0;
i < bpCutouts.size();
i++)
283 <<
i <<
":" << bpCutouts[
i].
first <<
","
286 keyDim.emplace_back(caloDefaultRadius, caloDefaultHalflengthZ);
295 const std::vector<Trk::TrackingVolume*>* lArVolumes =
325 std::vector<Trk::TrackingVolume*>* tileVolumes =
332 "--------------- detailed output "
333 "---------------------------------------------------------- ");
334 std::vector<Trk::TrackingVolume*>::const_iterator tileVolIter =
335 tileVolumes->begin();
336 std::vector<Trk::TrackingVolume*>::const_iterator tileVolIterEnd =
338 for (; tileVolIter != tileVolIterEnd;
352 double rTileMin = ebBounds ? ebBounds->
innerRadius() : 2288.;
353 double zTileMin = ebBounds ? tilePositiveExtendedBarrel->
center().z() -
357 keyDim.emplace_back(rTileMin, zTileMin);
358 for (
unsigned int i = 0;
i < keyDim.size();
i++) {
372 if (!lArBarrelBounds)
377 if (!lArPositiveEndcapBounds)
382 if (!lArNegativeEndcapBounds)
387 if (!lArPositiveHecBounds)
392 if (!lArPositiveFcalBounds)
397 if (!lArNegativeFcalBounds)
403 if (!tileCombinedBounds)
422 double caloPositiveOuterBoundary = tileCombinedBounds->
halflengthZ();
424 double lArPositiveOuterBoundary = lArPositiveFcal->
center().z();
425 lArPositiveOuterBoundary += lArPositiveFcalBounds->
halflengthZ();
433 float caloVolsOuterRadius = tileCombinedBounds->
outerRadius();
434 float caloVolsExtendZ = caloPositiveOuterBoundary;
443 float rInnerGapBP = 0.;
444 std::pair<Trk::TrackingVolume*, Trk::TrackingVolume*> innerGapBP =
446 bpCutouts, keyDim[0].
second,
448 keyDim.back().second,
"InnerGap", rInnerGapBP);
450 double z = 0.5 * (keyDim.back().second + keyDim[0].second);
452 auto mbtsNegLayers = std::make_unique<std::vector<Trk::Layer*>>();
453 auto mbtsPosLayers = std::make_unique<std::vector<Trk::Layer*>>();
455 if (lArPositiveMBTS && lArNegativeMBTS) {
478 mbtsPosZpos, dibo->
clone(),
484 mbtsNegLayers->push_back(mbtsNegLayer);
485 mbtsPosLayers->push_back(mbtsPosLayer);
493 keyDim[0].
first, 0.5 * (keyDim.back().second - keyDim[0].second));
498 lArG1P, lArG1Bounds, lArSectorInnerGapMaterial, mbtsPosLayers.release(),
499 "Calo::GapVolumes::LAr::PositiveSectorInnerGap");
504 lArG1N, lArG1Bounds->
clone(), lArSectorInnerGapMaterial,
505 mbtsNegLayers.release(),
"Calo::GapVolumes::LAr::NegativeSectorInnerGap");
509 if (innerGapBP.first) {
510 std::vector<Trk::TrackingVolume*> volsInnerGap;
511 volsInnerGap.push_back(innerGapBP.first);
512 volsInnerGap.push_back(lArPositiveSectorInnerGap);
514 volsInnerGap,
m_caloMaterial,
"Calo::Container::PositiveInnerGap");
516 positiveInnerGap = lArPositiveSectorInnerGap;
519 if (innerGapBP.second) {
520 std::vector<Trk::TrackingVolume*> volsInnerGap;
521 volsInnerGap.push_back(innerGapBP.second);
522 volsInnerGap.push_back(lArNegativeSectorInnerGap);
524 volsInnerGap,
m_caloMaterial,
"Calo::Container::NegativeInnerGap");
526 negativeInnerGap = lArNegativeSectorInnerGap;
529 std::vector<Trk::TrackingVolume*> inBufferVolumes;
530 inBufferVolumes.push_back(negativeInnerGap);
531 inBufferVolumes.push_back(innerVol);
532 inBufferVolumes.push_back(positiveInnerGap);
537 "Calo::Container::EnclosedInnerDetector");
544 float rEndcapBP = 0.;
545 std::pair<Trk::TrackingVolume*, Trk::TrackingVolume*> endcapBP =
547 lArPositiveEndcap->
center().z() +
549 "Endcap", rEndcapBP);
573 ecpPos, ecpUpBounds,
m_Al, dummyLayers, dummyVolumes,
574 "Calo::GapVolumes::LAr::PositiveECPresamplerCover");
576 ecpNeg, ecpUpBounds->
clone(),
m_Al, dummyLayers, dummyVolumes,
577 "Calo::GapVolumes::LAr::NegativeECPresamplerCover");
580 dummyVolumes,
"Calo::GapVolumes::LAr::PositiveECPresamplerInner");
583 dummyVolumes,
"Calo::GapVolumes::LAr::NegativeECPresamplerInner");
586 std::vector<Trk::TrackingVolume*> volsECP;
587 volsECP.push_back(ecPresamplerInnerPos);
588 volsECP.push_back(lArPosECPresampler);
589 volsECP.push_back(ecPresamplerCoverPos);
592 volsECP,
m_caloMaterial,
"Calo::Container::PositiveECPresamplerR");
593 std::vector<Trk::TrackingVolume*> volsECN;
594 volsECN.push_back(ecPresamplerInnerNeg);
595 volsECN.push_back(lArNegECPresampler);
596 volsECN.push_back(ecPresamplerCoverNeg);
599 volsECN,
m_caloMaterial,
"Calo::Container::NegativeECPresamplerR");
602 z = lArPosECPresampler->
center().z() - ecpHz;
603 float z1 = lArPosECPresampler->
center().z() + ecpHz;
611 rEndcapBP, keyDim.back().first, 0.5 * (
z - keyDim.back().second));
617 rEndcapBP, keyDim.back().first, 0.5 * (z2 - z1));
620 ecIPos, ecpIBounds,
m_Ar, dummyLayers, dummyVolumes,
621 "Calo::GapVolumes::LAr::PositiveECPresamplerIn");
623 ecINeg, ecpIBounds->
clone(),
m_Ar, dummyLayers, dummyVolumes,
624 "Calo::GapVolumes::LAr::NegativeECPresamplerIn");
626 ecOPos, ecpOBounds,
m_Ar, dummyLayers, dummyVolumes,
627 "Calo::GapVolumes::LAr::PositiveECPresamplerOut");
629 ecONeg, ecpOBounds->
clone(),
m_Ar, dummyLayers, dummyVolumes,
630 "Calo::GapVolumes::LAr::NegativeECPresamplerOut");
633 std::vector<Trk::TrackingVolume*> volECP;
634 volECP.push_back(ecPresamplerInPos);
635 volECP.push_back(positiveECP);
636 volECP.push_back(ecPresamplerOutPos);
640 std::vector<Trk::TrackingVolume*> volECN;
641 volECN.push_back(ecPresamplerOutNeg);
642 volECN.push_back(negativeECP);
643 volECN.push_back(ecPresamplerInNeg);
664 ecPos, ecUpBounds,
m_Ar, dummyLayers, dummyVolumes,
665 "Calo::GapVolumes::LAr::PositiveEndcapCover");
667 ecNeg, ecUpBounds->
clone(),
m_Ar, dummyLayers, dummyVolumes,
668 "Calo::GapVolumes::LAr::NegativeEndcapCover");
671 dummyVolumes,
"Calo::GapVolumes::LAr::PositiveEndcapInner");
674 dummyVolumes,
"Calo::GapVolumes::LAr::NegativeEndcapInner");
677 std::vector<Trk::TrackingVolume*> volsEC;
678 volsEC.push_back(ecInnerPos);
679 volsEC.push_back(lArPositiveEndcap);
680 volsEC.push_back(ecCoverPos);
684 std::vector<Trk::TrackingVolume*> volsEN;
685 volsEN.push_back(ecInnerNeg);
686 volsEN.push_back(lArNegativeEndcap);
687 volsEN.push_back(ecCoverNeg);
693 std::vector<Trk::TrackingVolume*> volEEP;
694 volEEP.push_back(positiveEP);
695 volEEP.push_back(positiveEC);
699 std::vector<Trk::TrackingVolume*> volEEN;
700 volEEN.push_back(negativeEC);
701 volEEN.push_back(negativeEP);
708 std::vector<Trk::TrackingVolume*> volsEndcapPos;
710 volsEndcapPos.push_back(endcapBP.first);
711 volsEndcapPos.push_back(positiveEEP);
713 std::unique_ptr<Trk::TrackingVolume> positiveEndcap(
715 volsEndcapPos,
m_caloMaterial,
"Calo::Container::PositiveEndcap"));
717 std::vector<Trk::TrackingVolume*> volsEndcapNeg;
719 volsEndcapNeg.push_back(endcapBP.second);
720 volsEndcapNeg.push_back(negativeEEP);
722 std::unique_ptr<Trk::TrackingVolume> negativeEndcap(
724 volsEndcapNeg,
m_caloMaterial,
"Calo::Container::NegativeEndcap"));
730 std::pair<Trk::TrackingVolume*, Trk::TrackingVolume*> hecBP =
751 lArHecPos, lArHecInnerGapBounds,
m_Al, dummyLayers, dummyVolumes,
752 "Calo::GapVolumes::LAr::PositiveHecInnerGap");
755 lArHecNeg, lArHecInnerGapBounds->
clone(),
m_Al, dummyLayers, dummyVolumes,
756 "Calo::GapVolumes::LAr::NegativeHecInnerGap");
765 dummyVolumes,
"Calo::GapVolumes::LAr::PositiveHecOuterGap");
769 dummyLayers, dummyVolumes,
"Calo::GapVolumes::LAr::NegativeHecOuterGap");
773 std::vector<Trk::TrackingVolume*> volsHecPos;
775 volsHecPos.push_back(hecBP.first);
776 volsHecPos.push_back(lArPositiveHecInnerGap);
777 volsHecPos.push_back(lArPositiveHec);
778 volsHecPos.push_back(lArPositiveHecOuterGap);
780 std::unique_ptr<Trk::TrackingVolume> positiveHec(
784 std::vector<Trk::TrackingVolume*> volsHecNeg;
786 volsHecNeg.push_back(hecBP.second);
787 volsHecNeg.push_back(lArNegativeHecInnerGap);
788 volsHecNeg.push_back(lArNegativeHec);
789 volsHecNeg.push_back(lArNegativeHecOuterGap);
791 std::unique_ptr<Trk::TrackingVolume> negativeHec(
800 std::pair<Trk::TrackingVolume*, Trk::TrackingVolume*> fcalBP =
810 if (rFcalBP > lArPositiveFcalBounds->
innerRadius()) {
812 << rFcalBP <<
">" << lArPositiveFcalBounds->
innerRadius()
829 lArFcalPos, lArFcalInnerGapBounds,
m_Al, dummyLayers, dummyVolumes,
830 "Calo::GapVolumes::LAr::PositiveFcalInnerGap");
833 lArFcalNeg, lArFcalInnerGapBounds->
clone(),
m_Al, dummyLayers,
834 dummyVolumes,
"Calo::GapVolumes::LAr::NegativeFcalInnerGap");
844 dummyLayers, dummyVolumes,
"Calo::GapVolumes::LAr::PositiveFcalOuterGap");
848 dummyLayers, dummyVolumes,
"Calo::GapVolumes::LAr::NegativeFcalOuterGap");
852 std::vector<Trk::TrackingVolume*> volsFcalPos;
854 volsFcalPos.push_back(fcalBP.first);
855 volsFcalPos.push_back(lArPositiveFcalInnerGap);
856 volsFcalPos.push_back(lArPositiveFcal);
857 volsFcalPos.push_back(lArPositiveHecFcalCover);
858 volsFcalPos.push_back(lArPositiveFcalOuterGap);
860 std::unique_ptr<Trk::TrackingVolume> positiveFcal(
864 std::vector<Trk::TrackingVolume*> volsFcalNeg;
866 volsFcalNeg.push_back(fcalBP.second);
867 volsFcalNeg.push_back(lArNegativeFcalInnerGap);
868 volsFcalNeg.push_back(lArNegativeFcal);
869 volsFcalNeg.push_back(lArNegativeHecFcalCover);
870 volsFcalNeg.push_back(lArNegativeFcalOuterGap);
872 std::unique_ptr<Trk::TrackingVolume> negativeFcal(
881 std::pair<Trk::TrackingVolume*, Trk::TrackingVolume*> outBP =
883 caloPositiveOuterBoundary,
"Outer", rOutBP);
892 0.5 * (caloPositiveOuterBoundary - lArPositiveOuterBoundary));
896 430., keyDim.back().first,
898 0.5 * (caloPositiveOuterBoundary - lArPositiveOuterBoundary));
900 z = 0.5 * (caloPositiveOuterBoundary + lArPositiveOuterBoundary);
908 lArSecOutG0P, lArSectorOuterG0Bounds, lArSectorOuterGapMat, dummyLayers,
909 dummyVolumes,
"Calo::GapVolumes::LAr::PositiveSectorOuterGap0");
912 lArSecOutG1P, lArSectorOuterG1Bounds,
m_Ar, dummyLayers, dummyVolumes,
913 "Calo::GapVolumes::LAr::PositiveSectorOuterGap");
920 lArNegativeSectorOuterGap0 =
922 lArSectorOuterGapMat, dummyLayers, dummyVolumes,
923 "Calo::GapVolumes::LAr::NegativeSectorOuterGap0");
926 lArSecOutG1N, lArSectorOuterG1Bounds->
clone(),
m_Ar, dummyLayers,
927 dummyVolumes,
"Calo::GapVolumes::LAr::NegativeSectorOuterGap");
930 std::vector<Trk::TrackingVolume*> volsOuterGapP;
932 volsOuterGapP.push_back(outBP.first);
933 volsOuterGapP.push_back(lArPositiveSectorOuterGap0);
934 volsOuterGapP.push_back(lArPositiveSectorOuterGap);
935 std::unique_ptr<Trk::TrackingVolume> positiveOuterGap(
937 volsOuterGapP,
m_caloMaterial,
"Calo::Container::PositiveOuterGap"));
939 std::vector<Trk::TrackingVolume*> volsOuterGapN;
941 volsOuterGapN.push_back(outBP.second);
942 volsOuterGapN.push_back(lArNegativeSectorOuterGap0);
943 volsOuterGapN.push_back(lArNegativeSectorOuterGap);
944 std::unique_ptr<Trk::TrackingVolume> negativeOuterGap(
946 volsOuterGapN,
m_caloMaterial,
"Calo::Container::NegativeOuterGap"));
953 std::vector<Trk::TrackingVolume*> lArNegativeSectorVolumes;
955 lArNegativeSectorVolumes.push_back(negativeOuterGap.release());
957 lArNegativeSectorVolumes.push_back(negativeFcal.release());
959 lArNegativeSectorVolumes.push_back(negativeHec.release());
961 lArNegativeSectorVolumes.push_back(negativeEndcap.release());
965 "Calo::LAr::Container::NegativeSector");
970 std::vector<Trk::TrackingVolume*> lArPositiveSectorVolumes;
972 lArPositiveSectorVolumes.push_back(positiveEndcap.release());
974 lArPositiveSectorVolumes.push_back(positiveHec.release());
976 lArPositiveSectorVolumes.push_back(positiveFcal.release());
978 lArPositiveSectorVolumes.push_back(positiveOuterGap.release());
982 "Calo::LAr::Container::PositiveSector");
997 dummyVolumes,
"Calo::GapVolumes::SolenoidGap");
1005 nullptr, lArTileCentralG1Bounds,
m_Ar, dummyLayers, dummyVolumes,
1006 "Calo::GapVolumes::LArTileCentralSectorGap");
1010 std::vector<Trk::TrackingVolume*> lArCentralBarrelSectorVolumes;
1012 lArCentralBarrelSectorVolumes.push_back(trtSolenoidGap);
1014 lArCentralBarrelSectorVolumes.push_back(solenoid);
1016 lArCentralBarrelSectorVolumes.push_back(solenoidlArPresamplerGap);
1018 lArCentralBarrelSectorVolumes.push_back(lArBarrelPresampler);
1020 lArCentralBarrelSectorVolumes.push_back(lArBarrel);
1022 lArCentralBarrelSectorVolumes.push_back(lArTileCentralSectorGap);
1024 lArCentralBarrelSector =
1027 "Calo::Containers::LAr::CentralBarrelSector",
false,
true);
1033 std::vector<Trk::IdentifiedMaterial> matCrack;
1036 matCrack.emplace_back(&
m_Scint, baseID);
1038 matCrack.emplace_back(&
m_Al, -1);
1049 std::vector<std::vector<size_t>> indexP;
1050 std::vector<std::vector<size_t>> indexN;
1052 std::vector<Trk::BinUtility*> layDN(bun->
bins());
1053 std::vector<Trk::BinUtility*> layUP(bup->
bins());
1054 double crackZ1 = 3532.;
1055 double crackZ2 = 3540.;
1057 std::vector<float>
steps;
1058 for (
unsigned int i = 0;
i < bup->
bins();
i++) {
1060 std::vector<size_t> indx;
1062 steps.push_back(crackZ1);
1063 indx.push_back(i < bup->
bins() - 1 ? 0 : 1);
1064 steps.push_back(crackZ2);
1066 steps.push_back(keyDim.back().second);
1069 indexP.push_back(indx);
1079 0.5 * (keyDim.back().second - crackZ1));
1080 z = 0.5 * (keyDim.back().second + crackZ1);
1085 crackPosTransform, align, crackBoundsPos, crackBinPos, 17,
1086 "Calo::Detectors::Tile::CrackPos");
1088 for (
unsigned int i = 0;
i < bun->
bins();
i++) {
1090 std::vector<size_t> indx;
1092 steps.push_back(-keyDim.back().second);
1094 steps.push_back(-crackZ2);
1095 indx.push_back(
i > 0 ? 0 : 1);
1096 steps.push_back(-crackZ1);
1099 indexN.push_back(indx);
1111 crackNegTransform, align, crackBoundsPos->
clone(), crackBinNeg, 17,
1112 "Calo::Detectors::Tile::CrackNeg");
1117 0.5 * (crackZ1 - lArBarrelBounds->
halflengthZ()));
1124 lArCentralG1P, lArCentralG1Bounds,
m_Ar, dummyLayers, dummyVolumes,
1125 "Calo::GapVolumes::LArCentralPositiveGap");
1131 lArCentralG1N, lArCentralG1Bounds->
clone(),
m_Ar, dummyLayers,
1132 dummyVolumes,
"Calo::GapVolumes::LArCentralNegativeGap");
1137 std::vector<Trk::TrackingVolume*> lArCentralSectorVolumes;
1139 lArCentralSectorVolumes.push_back(crackNeg);
1141 lArCentralSectorVolumes.push_back(lArCentralNegativeGap);
1143 lArCentralSectorVolumes.push_back(lArCentralBarrelSector);
1145 lArCentralSectorVolumes.push_back(lArCentralPositiveGap);
1147 lArCentralSectorVolumes.push_back(crackPos);
1151 "Calo::Containers::LAr::CentralSector");
1156 std::vector<Trk::TrackingVolume*> caloCentralSectorVolumes;
1158 caloCentralSectorVolumes.push_back(inDetEnclosed);
1160 caloCentralSectorVolumes.push_back(lArCentralSector);
1164 "Calo::Containers::CaloCentralSector");
1171 std::vector<Trk::TrackingVolume*> lArCombinedVolumes;
1173 lArCombinedVolumes.push_back(lArNegativeSector);
1175 lArCombinedVolumes.push_back(caloCentralSector);
1177 lArCombinedVolumes.push_back(lArPositiveSector);
1180 lArCombinedVolumes,
m_caloMaterial,
"Calo::Containers::LAr::Combined");
1185 std::vector<Trk::TrackingVolume*> caloVolumes;
1187 caloVolumes.push_back(lArCombined);
1189 caloVolumes.push_back(tileCombined);
1202 if (caloVolsOuterRadius > caloDefaultRadius) {
1204 "Calo volumes exceeds envelope radius: adjusting envelope "
1205 "(de-synchronizing...)");
1206 caloDefaultRadius = caloVolsOuterRadius;
1209 if (caloVolsOuterRadius < caloDefaultRadius) {
1211 "Build radial buffer to synchronize the boundaries in between R "
1212 << caloVolsOuterRadius <<
" and " << caloDefaultRadius);
1215 caloVolsOuterRadius, caloDefaultRadius, caloVolsExtendZ);
1217 nullptr, centralSynBounds,
m_caloMaterial, dummyLayers, dummyVolumes,
1218 "Calo::GapVolumes::EnvelopeBuffer");
1221 if (caloVolsExtendZ < caloDefaultHalflengthZ) {
1223 "Build longitudinal buffers to synchronize the boundaries in between Z "
1224 << caloVolsExtendZ <<
" and " << caloDefaultHalflengthZ);
1227 0., caloDefaultRadius,
1228 0.5 * (caloDefaultHalflengthZ - caloVolsExtendZ));
1231 0.0053 *
pow(0.38, 3));
1233 float zPos = 0.5 * (caloDefaultHalflengthZ + caloVolsExtendZ);
1236 endcapSynBounds,
m_Ar, dummyLayers, dummyVolumes,
1237 "Calo::GapVolumes::PosECBuffer");
1241 endcapSynBounds->
clone(),
m_Ar, dummyLayers, dummyVolumes,
1242 "Calo::GapVolumes::NegECBuffer");
1246 "All gap volumes for the Calorimeter created. Starting to build Volume "
1255 std::vector<float> zCutStep;
1256 std::vector<float> rCutStep;
1257 if (msCutouts.size() > 1) {
1258 zCutStep.push_back(msCutouts[0].
second);
1259 rCutStep.push_back(msCutouts[0].
first);
1260 for (
unsigned int i = 1;
i < msCutouts.size();
i++) {
1261 if (msCutouts[
i].
second == zCutStep.back())
1262 rCutStep.push_back(msCutouts[
i].
first);
1264 zCutStep.push_back(msCutouts[
i].
second);
1266 nCutVol = zCutStep.size() - 1;
1271 std::vector<Trk::TrackingVolume*> forwardCutoutVols;
1272 std::vector<Trk::TrackingVolume*> backwardCutoutVols;
1275 std::vector<Trk::Material> cutOutMat;
1276 cutOutMat.emplace_back(19.9, 213., 50., 23.,
1284 float rout = rCutStep[0];
1285 float zlow = zCutStep[0];
1286 for (
unsigned int i = 1;
i < zCutStep.size();
i++) {
1287 float zup = zCutStep[
i];
1288 float rcut = rCutStep[
i];
1289 std::stringstream
ss;
1292 float rCutOutBP = 0.;
1293 std::pair<Trk::TrackingVolume*, Trk::TrackingVolume*> cutOutBP =
1298 unsigned int mindex =
i > 1 ? 1 :
i;
1305 cutInBounds, cutOutMat[mindex], dummyLayers, dummyVolumes,
1306 "Calo::GapVolumes::CaloPositiveCutIn" +
ss.str());
1310 cutInBounds->
clone(), cutOutMat[mindex], dummyLayers, dummyVolumes,
1311 "Calo::GapVolumes::CaloNegativeCutIn" +
ss.str());
1320 "Muon::GapVolumes::CaloPositiveCutOut" +
ss.str());
1325 "Muon::GapVolumes::CaloNegativeCutOut" +
ss.str());
1332 std::vector<Trk::TrackingVolume*> cvPos;
1333 cvPos.push_back(cutOutBP.first);
1334 cvPos.push_back(caloInPos);
1335 cvPos.push_back(caloOutPos);
1339 "Calo::GapVolumes::CaloPositiveCutoutVolume" +
ss.str());
1340 forwardCutoutVols.push_back(cutOutPos);
1342 std::vector<Trk::TrackingVolume*> cvNeg;
1343 cvNeg.push_back(cutOutBP.second);
1344 cvNeg.push_back(caloInNeg);
1345 cvNeg.push_back(caloOutNeg);
1349 "Calo::GapVolumes::CaloNegativeCutoutVolume" +
ss.str());
1350 backwardCutoutVols.insert(backwardCutoutVols.begin(), cutOutNeg);
1358 if (!centralBuffer) {
1360 calorimeter = caloCombined;
1364 std::vector<Trk::TrackingVolume*> envRVols;
1365 envRVols.push_back(caloCombined);
1366 envRVols.push_back(centralBuffer);
1369 if (!forwardCutoutVols.empty() || ecNegBuffer) {
1374 std::vector<Trk::TrackingVolume*> envZVols;
1375 envZVols.reserve(backwardCutoutVols.size());
1376 for (
auto& backwardCutoutVol : backwardCutoutVols)
1377 envZVols.push_back(backwardCutoutVol);
1379 envZVols.push_back(ecNegBuffer);
1380 envZVols.push_back(caloRVolume);
1382 envZVols.push_back(ecPosBuffer);
1383 for (
auto& forwardCutoutVol : forwardCutoutVols)
1384 envZVols.push_back(forwardCutoutVol);
1397 "TrackingVolume 'Calorimeter' built successfully. Wrap it in "
1398 "TrackingGeometry.");
1401 lArVolumes =
nullptr;
1403 tileVolumes =
nullptr;
1405 auto caloTrackingGeometry =
1406 std::make_unique<Trk::TrackingGeometry>(calorimeter);
1413 caloTrackingGeometry->indexStaticLayers(
signature());
1416 return caloTrackingGeometry;