Skip to content

Conversation

@lmonaco99
Copy link
Contributor

I refactored GeoModelMuonMockupBuilder so that converted boxes are processed per station to produce a station-level StaticBluePrintNode. Then these nodes are attached to the appropriate container.

Due to the stacking policy, three containers are attached to the root Blueprint and stacked along Z: one for the detector body and two for the big wheels. While the StaticBluePrintNodes for EM and EO are directly attached to the big-wheels containers, the body container is further composed of two containers stacked along R: the barrel container, which holds the BI, BM, BO station nodes stacked along R, and a second cylindrical container that contains the small wheels, stacked along Z.

--- END COMMIT MESSAGE ---

@junggjo9 @dimitra97

@github-actions github-actions bot added the Component - Examples Affects the Examples module label Dec 18, 2025
@github-actions github-actions bot added this to the next milestone Dec 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

📊: Physics performance monitoring for c6e4b74

Full contents

physmon summary

@sonarqubecloud
Copy link

Comment on lines +120 to +123
// Helper function converting the station idx to string
std::string stationIdxToString(StationIdx idx) const;
// Helper function converting the first-level container idx to string
std::string firstContainerIdxToString(FirstContainerIdx idx) const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Helper function converting the station idx to string
std::string stationIdxToString(StationIdx idx) const;
// Helper function converting the first-level container idx to string
std::string firstContainerIdxToString(FirstContainerIdx idx) const;
// Helper function converting the station idx to string
static std::string stationIdxToString(const StationIdx idx);
// Helper function converting the first-level container idx to string
static std::string firstContainerIdxToString(const FirstContainerIdx idx);

Comment on lines +69 to +75
std::vector<CylinderContainerBlueprintNode*> FirstContainers(
static_cast<std::size_t>(FirstContainerIdx::nFirstContainers), nullptr);

// Second level: one container for the barrel and one for the two NSWs. These
// containers are attached to the body container and will be stacked in r.
std::vector<CylinderContainerBlueprintNode*> SecondContainers(
static_cast<std::size_t>(SecondContainerIdx::nSecondContainers), nullptr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these shuold be std::array s the vecor is never expanded

};

// Sorting the boxes by station
std::sort(boundingBoxes.begin(), boundingBoxes.end(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::sort(boundingBoxes.begin(), boundingBoxes.end(),
std::ranges::sort(boundingBoxes,

while (it != boundingBoxes.end()) {
// Current station index
StationIdx currentIdx = getStationIdx(*it);
bool isBarrel = (static_cast<int>(currentIdx) < 3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool isBarrel = (static_cast<int>(currentIdx) < 3);
const bool isBarrel = (currentIdx == StationIdx ::BI || currentIdx == StationIdx ::BM || currentIdx == StationIdx ::BO);

Comment on lines +130 to +131
if (std::find(m_cfg.stationNames.begin(), m_cfg.stationNames.end(),
station) == m_cfg.stationNames.end()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (std::find(m_cfg.stationNames.begin(), m_cfg.stationNames.end(),
station) == m_cfg.stationNames.end()) {
if (!rangeContainsValue(m_cfg.stationNames, station)) {

Ensure that https://github.com/acts-project/acts/blob/main/Core/include/Acts/Utilities/Helpers.hpp is included

Comment on lines +252 to +256
throw std::logic_error(
"processStation() -- Found null chamber node for parent " +
parent->getLogVol()->getName());
}
auto trVol = buildChildChamber(box, boundFactory);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

auto stationNode =
std::make_shared<Node_t>(std::make_unique<Acts::TrackingVolume>(
Acts::Transform3{Acts::Translation3(0., 0., translationZ)},
std::make_shared<Acts::CylinderVolumeBounds>(bounds.rMin, bounds.rMax,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounds should be instantiated from the bound factory!

} else {
trVol = std::make_unique<Acts::TrackingVolume>(*box.volume, box.name);

// add the sensitives (tubes) in the constructed tracking volume
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'not really true as the tubes have been treated above already

auto checkSide = [&contains](const StationIdx& idx) {
// Assume only stationEta can assume negative values
return contains("-")
? static_cast<StationIdx>(static_cast<std::uint8_t>(idx) + 3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why +3 and not +6? Mingling hard coded values and enums are never good ideas. What happens if the barrel chamber has a - in the name? Does it then become an endcap?

} else if (stationIdx == StationIdx::ECM || stationIdx == StationIdx::ECO) {
return FirstContainerIdx::BW_C;
} else {
return FirstContainerIdx::Body;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Body is the same as Barrel? Francesco, I don't think that giving the child multiple names is a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Examples Affects the Examples module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants