4#ifndef ACTSMUONDETECTOR_BOUNDSEXPANDER_H
5#define ACTSMUONDETECTOR_BOUNDSEXPANDER_H
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"
30 class GeometryContext;
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>
60 Acts::VolumeBoundFactory& boundFactory);
62 using VolumeAligner_t = std::function<Acts::Transform3(
const Acts::GeometryContext& tgContext)>;
70 std::unique_ptr<const Acts::Logger> loggerObj =
nullptr);
74 void expand(
const Acts::GeometryContext& tgContext,
79 void expand(
const Acts::GeometryContext& tgContext,
86 void expand(
const Acts::GeometryContext& tgContext,
88 Acts::VolumeBoundFactory& boundFactory);
93 virtual void expand(
const Acts::GeometryContext& tgContext,
94 const Acts::Volume& volume) = 0;
98 virtual std::shared_ptr<Acts::VolumeBounds>
105 std::unique_ptr<Acts::TrackingVolume>
makeEnvelope(Acts::VolumeBoundFactory& factory,
106 std::string_view volName);
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;
125 std::unique_ptr<const Acts::Logger>
m_logger{Acts::getDefaultLogger(
"BoundsExpander",
126 Acts::Logging::Level::INFO)};
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)};
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.
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...
This class is not to needed in AthSimulation.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...