Skip to content

Commit 6500c83

Browse files
authored
refactor: Muon Mockup Detector Builder: refactoring and adding endcaps (#4922)
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` StaticBluePrintNode`s 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.
1 parent 1b1bdbe commit 6500c83

File tree

4 files changed

+496
-172
lines changed

4 files changed

+496
-172
lines changed

Examples/Detectors/GeoModelDetector/include/ActsExamples/GeoModelDetector/GeoModelMuonMockupBuilder.hpp

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,78 @@ class GeoModelMuonMockupBuilder : public Acts::ITrackingGeometryBuilder {
5353
const Acts::GeometryContext& gctx) const override;
5454

5555
private:
56+
// Enum class for the station indices
57+
enum class StationIdx : std::uint8_t {
58+
BI, // Inner Barrel
59+
BM, // Middle Barrel
60+
BO, // Outer Barrel
61+
EAI, // Endcap Inner A-side
62+
EAM, // Endcap Middle A-side
63+
EAO, // Endcap Outer A-side
64+
ECI, // Endcap Inner C-side
65+
ECM, // Endcap Middle C-side
66+
ECO, // Endcap Outer C-side
67+
nStations
68+
};
69+
// Enum class for the first level of container indices
70+
enum class FirstContainerIdx : std::uint8_t {
71+
Central, // Central container for barrel & NSWs
72+
BW_A, // Big Wheel A-side
73+
BW_C, // Big Wheel C-side
74+
nFirstContainers
75+
};
76+
// Enum class for the second level of container indices when the first is
77+
// Central
78+
enum class SecondContainerIdx : std::uint8_t {
79+
Barrel, // Barrel container
80+
NSWs, // NSW container
81+
nSecondContainers
82+
};
83+
5684
Config m_cfg;
5785

58-
std::shared_ptr<Acts::Experimental::StaticBlueprintNode> buildBarrelNode(
59-
const ConvertedVolList_t& boundingBoxes, const std::string& name,
60-
Acts::VolumeBoundFactory& boundFactory,
61-
const Acts::GeometryIdentifier& geoId) const;
86+
using Box_t = ConvertedVolList_t::value_type;
87+
using Node_t = Acts::Experimental::StaticBlueprintNode;
88+
using NodePtr_t = std::shared_ptr<Node_t>;
89+
90+
/// @brief Produce a station node from the provided converted volume boxes
91+
NodePtr_t processStation(const std::span<Box_t> boundingBoxes,
92+
const std::string& station, const bool isBarrel,
93+
Acts::VolumeBoundFactory& boundFactory,
94+
const Acts::GeometryIdentifier& geoId) const;
95+
96+
/// @brief Build a child chamber volume from the provided converted volume box
97+
std::unique_ptr<Acts::TrackingVolume> buildChildChamber(
98+
const Box_t& box, Acts::VolumeBoundFactory& boundFactory) const;
99+
100+
/// @brief Helper struct to store cylinder bounds, used to compute the overall bounds
101+
/// of a station tracking volume from its component volumes
102+
struct cylBounds {
103+
/// @brief Lowest radius
104+
double rMin{std::numeric_limits<double>::max()};
105+
/// @brief Highest radius
106+
double rMax{std::numeric_limits<double>::lowest()};
107+
/// @brief Lowest longitudinal coordinate
108+
double zMin{std::numeric_limits<double>::max()};
109+
/// @brief Highest longitudinal coordinate
110+
double zMax{std::numeric_limits<double>::lowest()};
111+
};
112+
/// @brief Helper function to update the cylinder bounds of each station across its component volumes (chambers)
113+
/// @tparam VolBounds_t: The bounds type of the chamber volume
114+
/// @param volume: The chamber volume to extract the bounds from
115+
/// @param bounds: The cylBounds object to be updated
116+
template <Acts::VolumeBounds::BoundsType VolBounds_t>
117+
void updateBounds(const Acts::TrackingVolume& volume,
118+
cylBounds& bounds) const;
119+
120+
// Helper function returning the station idx from a box volume
121+
StationIdx getStationIdx(const Box_t& box) const;
122+
// Helper function returning the first-level container idx from a station idx
123+
FirstContainerIdx getFirstContainerIdx(const StationIdx& stationIdx) const;
124+
// Helper function converting the station idx to string
125+
static std::string stationIdxToString(const StationIdx idx);
126+
// Helper function converting the first-level container idx to string
127+
static std::string firstContainerIdxToString(const FirstContainerIdx idx);
62128

63129
/// Private access method to the logger
64130
const Acts::Logger& logger() const { return *m_logger; }

0 commit comments

Comments
 (0)