25 std::unique_ptr<const Acts::Logger>
logger)
31 m_splitCategories.reserve(
m_cfg.splitPatterns.size());
32 for (
const std::pair<const std::string, std::string>& pattern_split_category :
33 m_cfg.splitPatterns) {
36 if (
m_cfg.discMap.find(pattern_split_category.second) !=
37 m_cfg.discMap.end()) {
39 }
else if (
m_cfg.barrelMap.find(pattern_split_category.second) ==
40 m_cfg.barrelMap.end()) {
42 pattern_split_category.second +
43 " is neither a category name for barrel or disk module splits.");
46 m_splitCategories.push_back(
48 pattern_split_category.second, is_disk));
53 inline std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>>
56 std::shared_ptr<const Acts::TGeoDetectorElement> detElement)
const {
58 const TGeoNode&
node = detElement->tgeoNode();
61 static const char* category_names[2] = {
"barrel",
"disc"};
62 for (
const std::tuple<std::regex, std::string, bool>& split_category :
64 if (std::regex_match(sensorName, std::get<0>(split_category))) {
66 std::string(category_names[std::get<2>(split_category)]) +
67 " node " + sensorName +
" using split ranges of category " +
68 std::get<1>(split_category));
69 if (!std::get<2>(split_category)) {
71 gctx, detElement,
m_cfg.barrelMap.at(std::get<1>(split_category)));
74 gctx, detElement,
m_cfg.discMap.at(std::get<1>(split_category)));
78 ACTS_DEBUG(
"No matching configuration found. Node " +
80 " will not be split.");
86 inline std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>>
89 const std::shared_ptr<const Acts::TGeoDetectorElement>& detElement,
90 unsigned int nSegments)
const {
96 ACTS_WARNING(
"Invalid splitting config for barrel node: " +
98 "! Node will not be slpit.");
103 std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>> detElements =
105 detElements.reserve(nSegments);
108 double thickness = detElement->thickness();
111 const std::vector<double> boundsValues = bounds.
values();
118 std::make_shared<Acts::RectangleBounds>(0.5 * lengthX, 0.5 * lengthY);
120 auto localTranslation =
Acts::Vector2(-0.5 * lengthX * (nSegments - 1), 0.);
122 ACTS_DEBUG(
"Rectangle bounds for new node (half length): " +
126 for (
size_t i = 0;
i < nSegments;
i++) {
129 transform.translation();
132 auto element = std::make_shared<const Acts::TGeoDetectorElement>(
133 identifier, detElement->tgeoNode(), elemTransform, rectBounds,
137 localTranslation +=
step;
143 inline std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>>
146 const std::shared_ptr<const Acts::TGeoDetectorElement>& detElement,
147 const std::vector<ActsExamples::TGeoITkModuleSplitter::SplitRange>&
157 sf.localToGlobal(gctx,
Acts::Vector2(0., 0.), Acts::Vector3::Zero());
159 "Disc surface origin at: " +
std::to_string(discOrigin[0]) +
", " +
166 ACTS_WARNING(
"Invalid splitting config for disk node: " +
168 "! Node will not be slpit.");
172 auto nSegments = splitRanges.size();
175 std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>> detElements =
177 detElements.reserve(nSegments);
180 double thickness = detElement->thickness();
182 const std::vector<double> boundsValues = bounds.
values();
183 std::array<double, Acts::AnnulusBounds::eSize>
values{};
186 for (
size_t i = 0;
i < nSegments;
i++) {
189 auto annulusBounds = std::make_shared<Acts::AnnulusBounds>(
values);
191 "New r bounds for node: " +
std::to_string(annulusBounds->rMin()) +
194 auto element = std::make_shared<const Acts::TGeoDetectorElement>(