-
Notifications
You must be signed in to change notification settings - Fork 228
refactor: Muon Mockup Detector Builder: refactoring and adding endcaps #4922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
| // 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // 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); |
| 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); |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| bool isBarrel = (static_cast<int>(currentIdx) < 3); | |
| const bool isBarrel = (currentIdx == StationIdx ::BI || currentIdx == StationIdx ::BM || currentIdx == StationIdx ::BO); |
| if (std::find(m_cfg.stationNames.begin(), m_cfg.stationNames.end(), | ||
| station) == m_cfg.stationNames.end()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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
| throw std::logic_error( | ||
| "processStation() -- Found null chamber node for parent " + | ||
| parent->getLogVol()->getName()); | ||
| } | ||
| auto trVol = buildChildChamber(box, boundFactory); |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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



I refactored
GeoModelMuonMockupBuilderso that converted boxes are processed per station to produce a station-levelStaticBluePrintNode. Then these nodes are attached to the appropriate container.Due to the stacking policy, three containers are attached to the root
Blueprintand stacked along Z: one for the detector body and two for the big wheels. While theStaticBluePrintNodes 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