4#ifndef ACTSMUONDETECTOR_TRAPEZOIDBOUNDSEXPANDER_H
5#define ACTSMUONDETECTOR_TRAPEZOIDBOUNDSEXPANDER_H
20 std::shared_ptr<const Acts::VolumeBounds> volBounds);
22 void print(std::ostream& ostr)
const;
31 Acts::Transform3
toCenter{Acts::Transform3::Identity()};
33 std::shared_ptr<const Acts::VolumeBounds>
bounds{};
85 virtual void expand(
const Acts::GeometryContext& tgContext,
86 const Acts::Volume& volume)
override final;
89 virtual std::shared_ptr<Acts::VolumeBounds>
90 makeBounds(Acts::VolumeBoundFactory& factory)
override final;
99 void setMargin(
const double marginXlow,
const double marginXhigh,
100 const double marginY,
const double marginZ);
113 const std::size_t lowPatch,
114 const std::size_t highPatch)
const;
117 std::array<double, 4>
m_margin{Acts::filledArray<double, 4>(0.)};
BoundsExpander()=default
Default constructor.
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.
virtual std::shared_ptr< Acts::VolumeBounds > makeBounds(Acts::VolumeBoundFactory &factory) override final
void findTrapezoidEdge(Amg::Vector3D &botCorner, Amg::Vector3D &topCorner, const Side side, const std::size_t lowPatch, const std::size_t highPatch) const
Moves the position of the bottom and top corner of a trapezoid side such that all vertices are enclos...
std::vector< TrapezoidPatch > m_constituents
std::array< double, 4 > m_margin
BoundsExpander()=default
Use the constructor from the base class.
void setMargin(const double margin)
Apply an extra margin to all four bound dimensions.
std::shared_ptr< Acts::VolumeBounds > m_finalBounds
static Amg::Vector3D makeVertex(const TrapezoidPatch &trapezoid, const Side side, const Level lvl)
Returns the vertex point from a trapezoid.
friend std::ostream & operator<<(std::ostream &ostr, const Level lvl)
Pipe the Level to an ostream.
Level
Enum to select the top / bottom corners of a trapezoid.
Side
Enum to select the left / right corners of a trapezoid.
friend std::ostream & operator<<(std::ostream &ostr, const Side side)
Pipe the Side to an ostream.
static double distanceToTrapezoid(const Amg::Vector3D &vertex, const Amg::Vector3D &edge, const Amg::Vector3D &testMe, const Side side)
Returns the distance to the inclided trapezoidal side Positive values imply that the test point is ou...
virtual void expand(const Acts::GeometryContext &tgContext, const Acts::Volume &volume) override final
static std::uint8_t toIndex(const Side side, const Level lvl)
Construct an index from [0;3] from the side and level.
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
friend std::ostream & operator<<(std::ostream &ostr, const TrapezoidPatch &patch)
the ostream operator
void print(std::ostream &ostr) const
Print the TrapezoidPatch.
Acts::Transform3 toCenter
The transform to move to the outer trapezoid center.
double area() const
Calculates the area in the x-y plane.
TrapezoidPatch(const Acts::Transform3 &trf, std::shared_ptr< const Acts::VolumeBounds > volBounds)
The constructor.
std::shared_ptr< const Acts::VolumeBounds > bounds
Pointer to the volume bounds.