ATLAS Offline Software
Loading...
Searching...
No Matches
BoundsExpander.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef ACTSMUONDETECTOR_BOUNDSEXPANDER_H
5#define ACTSMUONDETECTOR_BOUNDSEXPANDER_H
6
8
9#ifndef SIMULATIONBASE
12#include "Acts/Definitions/Algebra.hpp"
13#include "Acts/Utilities/BoundFactory.hpp"
14#include "Acts/Utilities/ArrayHelpers.hpp"
15#include "Acts/Definitions/Units.hpp"
16#include "Acts/Utilities/Logger.hpp"
17
18
19#include <memory>
20#include <climits>
21#include <span>
22
23namespace MuonGMR4 {
25 class Chamber;
27}
28namespace Acts{
29 class Surface;
30 class GeometryContext;
31 class Volume;
32 class TrackingVolume;
33 class VolumeBounds;
34}
35
36
37namespace MuonGMR4 {
39 public:
44 static std::vector<Amg::Vector3D> cornerPoints(const Acts::GeometryContext& tgContext,
45 const Acts::Volume& volume,
46 const std::size_t nSegments = 3);
51 static std::vector<Amg::Vector3D> cornerPoints(const Acts::GeometryContext& tgContext,
52 const Acts::Surface& surface,
53 const std::size_t nSegments = 3);
58 static std::shared_ptr<Acts::VolumeBounds>
59 makeBounds(const MuonGMR4::MuonReadoutElement& readoutElement,
60 Acts::VolumeBoundFactory& boundFactory);
62 using VolumeAligner_t = std::function<Acts::Transform3(const Acts::GeometryContext& tgContext)>;
64 explicit BoundsExpander() = default;
69 explicit BoundsExpander(const Acts::Transform3& toVolume,
70 std::unique_ptr<const Acts::Logger> loggerObj = nullptr);
74 void expand(const Acts::GeometryContext& tgContext,
75 const MuonGMR4::Chamber& chamber);
79 void expand(const Acts::GeometryContext& tgContext,
80 const MuonGMR4::SpectrometerSector& sector);
86 void expand(const Acts::GeometryContext& tgContext,
87 const MuonGMR4::MuonReadoutElement& readoutElement,
88 Acts::VolumeBoundFactory& boundFactory);
89
93 virtual void expand(const Acts::GeometryContext& tgContext,
94 const Acts::Volume& volume) = 0;
98 virtual std::shared_ptr<Acts::VolumeBounds>
99 makeBounds(Acts::VolumeBoundFactory& boundFactory) = 0;
100
105 std::unique_ptr<Acts::TrackingVolume> makeEnvelope(Acts::VolumeBoundFactory& factory,
106 std::string_view volName);
109 Acts::Transform3 toVertexCenter() const;
112 const Acts::Transform3& boxMidPoint() const;
115 void reCenter(std::span<const Amg::Vector3D> vertices);
118 std::span<const double> minima() const;
121 std::span<const double> maxima() const;
123 const Acts::Logger& logger() const;
124 private:
125 std::unique_ptr<const Acts::Logger> m_logger{Acts::getDefaultLogger("BoundsExpander",
126 Acts::Logging::Level::INFO)};
127
128 Acts::Transform3 m_toVolume{Acts::Transform3::Identity()};
130 Acts::Transform3 m_shiftTrf{Acts::Transform3::Identity()};
132 std::array<double, 3> m_locMax{Acts::filledArray<double, 3>(-2.*Acts::UnitConstants::km)};
134 std::array<double, 3> m_locMin{Acts::filledArray<double, 3>(2.*Acts::UnitConstants::km)};
135 };
136
137}
138#endif
139#endif
static std::vector< Amg::Vector3D > cornerPoints(const Acts::GeometryContext &tgContext, const Acts::Volume &volume, const std::size_t nSegments=3)
Returns the vertices from a volume.
std::span< const double > maxima() const
Returns the triplet of the maximum coordinates from the ensemble of all seen vertices.
std::array< double, 3 > m_locMin
Minimum value seen by the recenter method.
Acts::Transform3 m_shiftTrf
Extra shift to center all the vertices.
std::span< const double > minima() const
Returns the triplet of the minimum coordinates from the ensemble of all seen vertices.
Acts::Transform3 toVertexCenter() const
Returns the transform from the ATLAS frame to the center of all seen vertices.
BoundsExpander()=default
Default constructor.
std::function< Acts::Transform3(const Acts::GeometryContext &tgContext)> VolumeAligner_t
Abrivation of the transform getter.
Acts::Transform3 m_toVolume
External method to go from ATLAS to the reference frame.
virtual std::shared_ptr< Acts::VolumeBounds > makeBounds(Acts::VolumeBoundFactory &boundFactory)=0
Make the final bounds after all volumes are passed via the expand method.
virtual void expand(const Acts::GeometryContext &tgContext, const Acts::Volume &volume)=0
Expand the bound definition from a generic volume.
std::array< double, 3 > m_locMax
Maximum value seen by the recenter method.
void expand(const Acts::GeometryContext &tgContext, const MuonGMR4::Chamber &chamber)
Expand the bounds from a chamber.
static std::shared_ptr< Acts::VolumeBounds > makeBounds(const MuonGMR4::MuonReadoutElement &readoutElement, Acts::VolumeBoundFactory &boundFactory)
Crate volume bounds that enclose the readout element from the central localToGlobalTransform.
std::unique_ptr< const Acts::Logger > m_logger
const Acts::Transform3 & boxMidPoint() const
Returns the transform from the nominal volume center to the middle point to all seen vertices.
const Acts::Logger & logger() const
Returns the ACTS logegr object.
void reCenter(std::span< const Amg::Vector3D > vertices)
Update the center point from a list of global vertices.
std::unique_ptr< Acts::TrackingVolume > makeEnvelope(Acts::VolumeBoundFactory &factory, std::string_view volName)
Creates an empty tracking volume.
Chamber represent the volume enclosing a muon station.
Definition Chamber.h:29
MuonReadoutElement is an abstract class representing the geometry of a muon detector.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...