Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • leggett/acts-core
  • adye/acts-core
  • xju/acts-core
  • corentin/acts-core
  • keli/acts-core
  • gli/acts-core
  • xai/acts-core
  • bschlag/acts-core
  • berkeleylab/acts/acts-core
  • emoyse/acts-core
  • smh/acts-core
  • pagessin/acts-core
  • chamont/acts-core
  • sroe/a-common-tracking-sw
  • calaf/a-common-tracking-sw
  • hgraslan/acts-core
16 results
Show changes
Commits on Source (20)
Showing
with 604 additions and 292 deletions
...@@ -75,6 +75,21 @@ class AbstractVolume : public Volume { ...@@ -75,6 +75,21 @@ class AbstractVolume : public Volume {
/// @return the vector of boundary surfaces /// @return the vector of boundary surfaces
const std::vector<BoundarySurfacePtr>& boundarySurfaces() const; const std::vector<BoundarySurfacePtr>& boundarySurfaces() const;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const final;
private: private:
/// Private method to create BoundarySurfaces /// Private method to create BoundarySurfaces
void createBoundarySurfaces(); void createBoundarySurfaces();
......
...@@ -69,6 +69,23 @@ class ConeLayer : virtual public ConeSurface, public Layer { ...@@ -69,6 +69,23 @@ class ConeLayer : virtual public ConeSurface, public Layer {
// Non-const version // Non-const version
ConeSurface& surfaceRepresentation() override; ConeSurface& surfaceRepresentation() override;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const final {
return Layer::layerPolyhedron(gctx, lseg);
}
protected: protected:
/// Private constructor with arguments /// Private constructor with arguments
/// ///
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
#pragma once #pragma once
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Polyhedron.hpp"
#include "Acts/Geometry/VolumeBounds.hpp" #include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/CylinderSurface.hpp"
#include "Acts/Surfaces/DiscSurface.hpp" #include "Acts/Surfaces/DiscSurface.hpp"
#include "Acts/Surfaces/PolyhedronRepresentation.hpp"
#include "Acts/Utilities/BoundingBox.hpp" #include "Acts/Utilities/BoundingBox.hpp"
#include "Acts/Utilities/Definitions.hpp" #include "Acts/Utilities/Definitions.hpp"
...@@ -19,116 +20,88 @@ namespace Acts { ...@@ -19,116 +20,88 @@ namespace Acts {
class IVisualization; class IVisualization;
/** /// Class which implements a cutout cylinder. This shape is bascially a
* Class which implements a cutout cylinder. This shape is bascially a cylinder, /// cylinder, with another, smaller cylinder subtracted from the center.
* with another, smaller cylinder subtracted from the center. /// --------------------- rmax
* --------------------- rmax /// | |
* | | /// | |---------| | rmed
* | |---------| | rmed /// | | | |
* | | | | /// ------ ------ rmin
* ------ ------ rmin /// -- dz2 --
* -- dz2 -- /// -------- dz1 -------
* -------- dz1 ------- ///
* ///
*/
class CutoutCylinderVolumeBounds : public VolumeBounds { class CutoutCylinderVolumeBounds : public VolumeBounds {
public: public:
/** /// Constructor from defining parameters
* Constructor from defining parameters ///
* @param rmin Minimum radius at the "choke points" /// @param rmin Minimum radius at the "choke points"
* @param rmed The medium radius (outer radius of the cutout) /// @param rmed The medium radius (outer radius of the cutout)
* @param rmax The outer radius of the overall shape /// @param rmax The outer radius of the overall shape
* @param dz1 The longer halflength of the shape /// @param dz1 The longer halflength of the shape
* @param dz2 The shorter halflength of the shape /// @param dz2 The shorter halflength of the shape
*/
CutoutCylinderVolumeBounds(double rmin, double rmed, double rmax, double dz1, CutoutCylinderVolumeBounds(double rmin, double rmed, double rmax, double dz1,
double dz2) double dz2)
: m_rmin(rmin), m_rmed(rmed), m_rmax(rmax), m_dz1(dz1), m_dz2(dz2) {} : m_rmin(rmin), m_rmed(rmed), m_rmax(rmax), m_dz1(dz1), m_dz2(dz2) {}
/** /// Virtual default constructor
* Virtual default constructor
*/
~CutoutCylinderVolumeBounds() override = default; ~CutoutCylinderVolumeBounds() override = default;
/** /// Clone method.
* Clone method. /// @return Pointer to a copy of the shape
* @return Pointer to a copy of the shape
*/
VolumeBounds* clone() const override; VolumeBounds* clone() const override;
/** /// Inside method to test whether a point is inside the shape
* Inside method to test whether a point is inside the shape ///
* @param gpos The point to test /// @param gpos The point to test
* @param tol The tolerance to test with /// @param tol The tolerance to test with
* @return Whether the point is inside or not. /// @return Whether the point is inside or not.
*/
bool inside(const Vector3D& gpos, double tol = 0) const override; bool inside(const Vector3D& gpos, double tol = 0) const override;
/** /// Method to decompose the Bounds into Surfaces
* Method to decompose the Bounds into Surfaces ///
* /// @param transform is the transform to position the surfaces in 3D space
* @param transform is the transform to position the surfaces in 3D space /// @note this is a factory method
* @note this is a factory method ///
* /// @return vector of surfaces from the decopmosition
* @return vector of surfaces from the decopmosition ///
*/
std::vector<std::shared_ptr<const Surface>> decomposeToSurfaces( std::vector<std::shared_ptr<const Surface>> decomposeToSurfaces(
const Transform3D* transform) const override; const Transform3D* transform) const override;
/** /// Construct bounding box for this shape
* Construct bounding box for this shape ///
* @param trf Optional transform /// @param trf Optional transform
* @param envelope Optional envelope to add / subtract from min/max /// @param envelope Optional envelope to add / subtract from min/max
* @param entity Entity to associate this bounding box with /// @param entity Entity to associate this bounding box with
* @return Constructed bounding box /// @return Constructed bounding box
*/
Volume::BoundingBox boundingBox(const Transform3D* trf = nullptr, Volume::BoundingBox boundingBox(const Transform3D* trf = nullptr,
const Vector3D& envelope = {0, 0, 0}, const Vector3D& envelope = {0, 0, 0},
const Volume* entity = nullptr) const final; const Volume* entity = nullptr) const final;
/** /// Write information about this instance to an outstream
* Write information about this instance to an outstream ///
* @param sl The outstream /// @param sl The outstream
* @return The outstream /// @return The outstream
*/
std::ostream& toStream(std::ostream& sl) const override; std::ostream& toStream(std::ostream& sl) const override;
/** /// Return the minimum radius
* Draw this shape using a visualization helper /// @return The minimum radius
* @param helper The visualizatin helper
* @param transform Optional transformation matrix
*/
void draw(IVisualization& helper,
const Transform3D& transform = Transform3D::Identity()) const;
/**
* Return the minimum radius
* @return The minimum radius
*/
double rMin() const { return m_rmin; } double rMin() const { return m_rmin; }
/** /// Return the medium radius
* Return the medium radius /// @return The medium radius
* @return The medium radius
*/
double rMed() const { return m_rmed; } double rMed() const { return m_rmed; }
/** /// Return the maximum radius
* Return the maximum radius /// @return The maximum radius
* @return The maximum radius
*/
double rMax() const { return m_rmax; } double rMax() const { return m_rmax; }
/** /// Return the longer halflength in z.
* Return the longer halflength in z. /// @return The halflength
* @return The halflength
*/
double dZ1() const { return m_dz1; } double dZ1() const { return m_dz1; }
/** /// Return the shorter halflength in z.
* Return the shorter halflength in z. /// @return The halflength
* @return The halflength
*/
double dZ2() const { return m_dz2; } double dZ2() const { return m_dz2; }
private: private:
......
...@@ -76,6 +76,23 @@ class CylinderLayer : public CylinderSurface, public Layer { ...@@ -76,6 +76,23 @@ class CylinderLayer : public CylinderSurface, public Layer {
// Non-const version // Non-const version
CylinderSurface& surfaceRepresentation() override; CylinderSurface& surfaceRepresentation() override;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const final {
return Layer::layerPolyhedron(gctx, lseg);
}
private: private:
/// build approach surfaces */ /// build approach surfaces */
void buildApproachDescriptor(); void buildApproachDescriptor();
......
...@@ -6,12 +6,9 @@ ...@@ -6,12 +6,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// CylinderVolumeBounds.h, Acts project
///////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include <cmath> #include <cmath>
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/Volume.hpp" #include "Acts/Geometry/Volume.hpp"
#include "Acts/Geometry/VolumeBounds.hpp" #include "Acts/Geometry/VolumeBounds.hpp"
#include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/CylinderSurface.hpp"
...@@ -187,12 +184,6 @@ class CylinderVolumeBounds : public VolumeBounds { ...@@ -187,12 +184,6 @@ class CylinderVolumeBounds : public VolumeBounds {
/// Output Method for std::ostream /// Output Method for std::ostream
std::ostream& toStream(std::ostream& sl) const override; std::ostream& toStream(std::ostream& sl) const override;
/// Draw this cylinder to a given helper
/// @param helper The helper instance
/// @param transform An additional transform, default is identity
void draw(IVisualization& helper,
const Transform3D& transform = Transform3D::Identity()) const;
private: private:
/// templated dumpT method /// templated dumpT method
template <class T> template <class T>
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// DiscLayer.h, Acts project
///////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include <algorithm> #include <algorithm>
...@@ -73,6 +69,23 @@ class DiscLayer : virtual public DiscSurface, public Layer { ...@@ -73,6 +69,23 @@ class DiscLayer : virtual public DiscSurface, public Layer {
// Non-const version // Non-const version
DiscSurface& surfaceRepresentation() override; DiscSurface& surfaceRepresentation() override;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const final {
return Layer::layerPolyhedron(gctx, lseg);
}
private: private:
/// build approach surfaces /// build approach surfaces
void buildApproachDescriptor(); void buildApproachDescriptor();
......
// This file is part of the Acts project.
//
// Copyright (C) 2016-2018 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <utility>
#include <vector>
#include "Acts/Utilities/BinningType.hpp"
#include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/Helpers.hpp"
namespace Acts {
using range_type = std::pair<double, double>;
// @brief Extent in space
///
/// This is a nested struct to the GeometryObject representation
/// which can be retrieved and used for surface parsing and will
/// give you the maximal extent in 3D space/
struct Extent {
/// Possible maximal value
static constexpr double maxval = std::numeric_limits<double>::max();
/// Start value
static constexpr range_type maxrange = {maxval, -maxval};
// The different ranges
std::vector<range_type> ranges = std::vector<range_type>(9, maxrange);
// Constructor
Extent() = default;
/// Merge another extent in - using operator+=
/// @param other is the source Extent
Extent& operator+=(const Extent& other) {
for (auto ir = 0; ir < other.ranges.size(); ++ir) {
ranges[ir].first = std::min(ranges[ir].first, other.ranges[ir].first);
ranges[ir].second = std::max(ranges[ir].second, other.ranges[ir].second);
}
return (*this);
}
/// Access the minimum parameter
/// @param bval the binning identification
double min(BinningValue bval) const { return ranges[bval].first; }
/// Access the max parameter
/// @param bval the binning identification
double max(BinningValue bval) const { return ranges[bval].second; }
/// Access the medium parameter
/// @param bval the binning identification
double medium(BinningValue bval) const {
return 0.5 * (ranges[bval].first + ranges[bval].second);
}
/// Access the range - always positive
/// @param bval the binning identification
double range(BinningValue bval) const {
return std::abs(ranges[bval].second - ranges[bval].first);
}
/// Check the vertex
/// @param vtx the Vertex to be checked
void check(const Vector3D& vtx) {
// min/max value check
auto minMax = [&](BinningValue bval, double value) -> void {
ranges[bval].first = std::min(value, ranges[bval].first);
ranges[bval].second = std::max(value, ranges[bval].second);
};
// Walk through the binnin parameters
for (int bval = 0; bval < binValues; ++bval) {
BinningValue bValue = (BinningValue)bval;
minMax(bValue, VectorHelpers::cast(vtx, bValue));
}
}
};
} // namespace Acts
\ No newline at end of file
// This file is part of the Acts project. // This file is part of the Acts project.
// //
// Copyright (C) 2016-2018 CERN for the benefit of the Acts project // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// GeometryObject.h, Acts project
///////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/GeometryID.hpp" #include "Acts/Geometry/GeometryID.hpp"
#include "Acts/Geometry/Polyhedron.hpp"
#include "Acts/Utilities/BinningType.hpp" #include "Acts/Utilities/BinningType.hpp"
#include "Acts/Utilities/Definitions.hpp" #include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/Helpers.hpp" #include "Acts/Utilities/Helpers.hpp"
...@@ -30,15 +27,18 @@ namespace Acts { ...@@ -30,15 +27,18 @@ namespace Acts {
/// ///
class GeometryObject { class GeometryObject {
public: public:
/// Defaulted construrctor
GeometryObject() = default; GeometryObject() = default;
/// Defaulted copy constructor
GeometryObject(const GeometryObject&) = default; GeometryObject(const GeometryObject&) = default;
/// constructor from a ready-made value /// Constructor from a value
/// ///
/// @param geoID the geometry identifier of the object /// @param geoID the geometry identifier of the object
GeometryObject(const GeometryID& geoID) : m_geoID(geoID) {} GeometryObject(const GeometryID& geoID) : m_geoID(geoID) {}
/// assignment operator /// Assignment operator
/// ///
/// @param geoID the source geoID /// @param geoID the source geoID
GeometryObject& operator=(const GeometryObject& geoID) { GeometryObject& operator=(const GeometryObject& geoID) {
...@@ -48,7 +48,6 @@ class GeometryObject { ...@@ -48,7 +48,6 @@ class GeometryObject {
return *this; return *this;
} }
/// Return the value
/// @return the geometry id by reference /// @return the geometry id by reference
const GeometryID& geoID() const; const GeometryID& geoID() const;
...@@ -75,6 +74,21 @@ class GeometryObject { ...@@ -75,6 +74,21 @@ class GeometryObject {
/// @param geoID the geometry identifier to be assigned /// @param geoID the geometry identifier to be assigned
void assignGeoID(const GeometryID& geoID); void assignGeoID(const GeometryID& geoID);
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
virtual Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const = 0;
protected: protected:
GeometryID m_geoID; GeometryID m_geoID;
}; };
...@@ -89,28 +103,6 @@ inline void GeometryObject::assignGeoID(const GeometryID& geoID) { ...@@ -89,28 +103,6 @@ inline void GeometryObject::assignGeoID(const GeometryID& geoID) {
inline double GeometryObject::binningPositionValue(const GeometryContext& gctx, inline double GeometryObject::binningPositionValue(const GeometryContext& gctx,
BinningValue bValue) const { BinningValue bValue) const {
using VectorHelpers::perp; return VectorHelpers::cast(binningPosition(gctx, bValue), bValue);
// now switch
switch (bValue) {
// case x
case Acts::binX: {
return binningPosition(gctx, bValue).x();
} break;
// case y
case Acts::binY: {
return binningPosition(gctx, bValue).y();
} break;
// case z
case Acts::binZ: {
return binningPosition(gctx, bValue).z();
} break;
// case - to be overwritten by disks
case Acts::binR: {
return perp(binningPosition(gctx, bValue));
} break;
// do nothing for the default
default:
return 0.;
}
} }
} // namespace Acts } // namespace Acts
...@@ -211,6 +211,23 @@ class Layer : public virtual GeometryObject { ...@@ -211,6 +211,23 @@ class Layer : public virtual GeometryObject {
/// @return the representing volume of the layer /// @return the representing volume of the layer
const AbstractVolume* representingVolume() const; const AbstractVolume* representingVolume() const;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// It will check for a approach descriptor first and then output
/// the approach surfaces, otherwise the surfaceRepresentation
///
/// @return A list of vertices and a face/facett description of it
Polyhedron layerPolyhedron(const GeometryContext& gctx, size_t lseg) const;
/// return the LayerType /// return the LayerType
LayerType layerType() const; LayerType layerType() const;
......
...@@ -21,15 +21,6 @@ ...@@ -21,15 +21,6 @@
#include <optional> #include <optional>
#ifndef ACTS_LAYERCREATOR_TAKESMALLERBIGGER
#define ACTS_LAYERCREATOR_TAKESMALLERBIGGER
#define takeSmaller(current, test) current = current < test ? current : test
#define takeBigger(current, test) current = current > test ? current : test
#define takeSmallerBigger(cSmallest, cBiggest, test) \
takeSmaller(cSmallest, test); \
takeBigger(cBiggest, test)
#endif
namespace Acts { namespace Acts {
namespace Test { namespace Test {
...@@ -72,7 +63,7 @@ class LayerCreator { ...@@ -72,7 +63,7 @@ class LayerCreator {
/// Destructor /// Destructor
~LayerCreator() = default; ~LayerCreator() = default;
/// returning a cylindrical layer /// Returning a cylindrical layer
/// ///
/// @param gctx ist the geometry context with which the geometry is built /// @param gctx ist the geometry context with which the geometry is built
/// @param surfaces is the vector of pointers to sensitive surfaces /// @param surfaces is the vector of pointers to sensitive surfaces
...@@ -96,32 +87,7 @@ class LayerCreator { ...@@ -96,32 +87,7 @@ class LayerCreator {
std::shared_ptr<const Transform3D> transform = nullptr, std::shared_ptr<const Transform3D> transform = nullptr,
std::unique_ptr<ApproachDescriptor> ad = nullptr) const; std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
/// returning a cylindrical layer /// Returning a Disc layer
///
/// @param gctx ist the geometry context with which the geometry is built
/// @param surfaces is the vector of pointers to sensitive surfaces
/// represented by this layer
/// @pre the pointers to the sensitive surfaces in the surfaces vectors all
/// need to be valid, since no check is performed
/// @param bTypePhi binning type in phi (equidistant/arbitrary)
/// @param bTypeZ binning type in z (equidistant/arbitrary)
/// @param _protoLayer (optional) proto layer specifying the dimensions and
/// envelopes
/// @param transform is the (optional) transform of the layer
/// @param ad possibility to hand over a specific ApproachDescriptor, which is
/// needed for material mapping. Otherwise the default ApproachDescriptor will
/// be taken used for this layer
///
/// @return shared pointer to a newly created layer
MutableLayerPtr cylinderLayer(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces,
BinningType bTypePhi, BinningType bTypeZ,
std::optional<ProtoLayer> _protoLayer = std::nullopt,
std::shared_ptr<const Transform3D> transform = nullptr,
std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
/// returning a disc layer
/// ///
/// @param gctx ist the geometry context with which the geometry is built /// @param gctx ist the geometry context with which the geometry is built
/// @param surfaces is the vector of pointers to sensitive surfaces /// @param surfaces is the vector of pointers to sensitive surfaces
...@@ -145,32 +111,7 @@ class LayerCreator { ...@@ -145,32 +111,7 @@ class LayerCreator {
std::shared_ptr<const Transform3D> transform = nullptr, std::shared_ptr<const Transform3D> transform = nullptr,
std::unique_ptr<ApproachDescriptor> ad = nullptr) const; std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
/// returning a disc layer /// Returning a plane layer
///
/// @param gctx ist the geometry context with which the geometry is built
/// @param surfaces is the vector of pointers to sensitive surfaces
/// represented by this layer
/// @pre the pointers to the sensitive surfaces in the surfaces vectors all
/// need to be valid, since no check is performed
/// @param bTypeR binning type in r (equidistant/arbitrary)
/// @param bTypePhi binning type in phi (equidistant/arbitrary)
/// @param transform is the (optional) transform of the layer
/// @param _protoLayer (optional) proto layer specifying the dimensions and
/// envelopes
/// @param ad possibility to hand over a specific ApproachDescriptor, which is
/// needed for material mapping. Otherwise the default ApproachDescriptor will
/// be taken used for this layer
///
/// @return shared pointer to a newly created layer
MutableLayerPtr discLayer(
const GeometryContext& gctx,
std::vector<std::shared_ptr<const Surface>> surfaces, BinningType bTypeR,
BinningType bTypePhi,
std::optional<ProtoLayer> _protoLayer = std::nullopt,
std::shared_ptr<const Transform3D> transform = nullptr,
std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
/// returning a plane layer
/// ///
/// @param gctx ist the geometry context with which the geometry is built /// @param gctx ist the geometry context with which the geometry is built
/// @param [in] surfaces is the vector of pointers to sensitive surfaces /// @param [in] surfaces is the vector of pointers to sensitive surfaces
...@@ -206,11 +147,11 @@ class LayerCreator { ...@@ -206,11 +147,11 @@ class LayerCreator {
/// Access th configuration object /// Access th configuration object
Config getConfiguration() const; Config getConfiguration() const;
/// set logging instance /// Set logging instance
/// @param newLogger the logger instance /// @param newLogger the logger instance
void setLogger(std::unique_ptr<const Logger> newLogger); void setLogger(std::unique_ptr<const Logger> newLogger);
// associate surfaces contained by this layer to this layer // Associate surfaces contained by this layer to this layer
void associateSurfacesToLayer(Layer& layer) const; void associateSurfacesToLayer(Layer& layer) const;
private: private:
......
...@@ -70,6 +70,23 @@ class NavigationLayer : public Layer { ...@@ -70,6 +70,23 @@ class NavigationLayer : public Layer {
// Non-const version // Non-const version
Surface& surfaceRepresentation() final; Surface& surfaceRepresentation() final;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const final {
return Layer::layerPolyhedron(gctx, lseg);
}
/// Geometric isOnLayer() method /// Geometric isOnLayer() method
/// using isOnSurface() with Layer specific tolerance /// using isOnSurface() with Layer specific tolerance
/// ///
......
...@@ -67,6 +67,23 @@ class PlaneLayer : virtual public PlaneSurface, public Layer { ...@@ -67,6 +67,23 @@ class PlaneLayer : virtual public PlaneSurface, public Layer {
// Non-const version // Non-const version
PlaneSurface& surfaceRepresentation() override; PlaneSurface& surfaceRepresentation() override;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const final {
return Layer::layerPolyhedron(gctx, lseg);
}
private: private:
/// private helper method to build approach surfaces /// private helper method to build approach surfaces
void buildApproachDescriptor(); void buildApproachDescriptor();
......
// This file is part of the Acts project. // This file is part of the Acts project.
// //
// Copyright (C) 2018 CERN for the benefit of the Acts project // Copyright (C) 2018-2020 CERN for the benefit of the Acts project
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -8,13 +8,16 @@ ...@@ -8,13 +8,16 @@
#pragma once #pragma once
#include <limits>
#include <vector> #include <vector>
#include "Acts/Geometry/Extent.hpp"
#include "Acts/Surfaces/BoundaryCheck.hpp"
#include "Acts/Utilities/Definitions.hpp" #include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/Helpers.hpp"
namespace Acts { namespace Acts {
/// @class PolyhedronRepresentation /// @class Polyhedron
/// ///
/// Struct which contains a cartesian approximation for any surface type. /// Struct which contains a cartesian approximation for any surface type.
/// It contains a list of cartesian vertices in the global frame, and /// It contains a list of cartesian vertices in the global frame, and
...@@ -23,38 +26,78 @@ namespace Acts { ...@@ -23,38 +26,78 @@ namespace Acts {
/// Each entry in @c faces is a face, which is in turn a list of vertices /// Each entry in @c faces is a face, which is in turn a list of vertices
/// that need to be connected to form a face. /// that need to be connected to form a face.
/// This allows the @c objString method to produce a ready-to-go obj output. /// This allows the @c objString method to produce a ready-to-go obj output.
struct PolyhedronRepresentation { struct Polyhedron {
using face_type = std::vector<size_t>;
/// Default constructor
Polyhedron() = default;
/// Default constructor from a vector of vertices and a vector of faces /// Default constructor from a vector of vertices and a vector of faces
/// @param verticesIn The 3D global vertices that make up the object /// @param verticesIn The 3D global vertices that make up the object
/// @param facesIn List of lists of indices for faces. /// @param facesIn List of lists of indices for faces.
/// @param triangularMeshIn List of lists of indices for a triangular mesh
/// @param radialCheck A dedicated check for radial extent done
/// @note This creates copies of the input vectors /// @note This creates copies of the input vectors
PolyhedronRepresentation(const std::vector<Vector3D>& verticesIn, Polyhedron(const std::vector<Vector3D>& verticesIn,
const std::vector<std::vector<size_t>>& facesIn) const std::vector<face_type>& facesIn,
: vertices(verticesIn), faces(facesIn) {} const std::vector<face_type>& triangularMeshIn,
bool radialCheck = false)
: vertices(verticesIn),
faces(facesIn),
triangularMesh(triangularMeshIn) {}
/// list of 3D vertices as vectors /// List of 3D vertices as vectors
std::vector<Vector3D> vertices; std::vector<Vector3D> vertices;
/// list of faces connecting the vertices. /// List of faces connecting the vertices.
/// each face is a list of vertices v /// each face is a list of vertices v
/// corresponding to the vertex vector above /// corresponding to the vertex vector above
std::vector<std::vector<size_t>> faces; std::vector<face_type> faces;
/// Method to return an obj string. /// List of faces connecting the vertices.
/// @param vtxOffset Optional obj vertex enumeration offset /// each face is a list of vertices v
/// @note Vertices in obj are enumerated globally. The offset is required /// - in this case restricted to a triangular representation
/// to allow for multiple output objects in one obj file. std::vector<face_type> triangularMesh;
std::string objString(size_t vtxOffset = 0) const;
/// Add another Polyhedrons
///
/// @param other is the source representation
Polyhedron& operator+=(const Polyhedron& other);
/// Draw method for polyhedrons
///
/// @tparam helper_t The draw helper
///
/// @param helper The draw helper object (visitor pattern)
/// @param triangulate Force the faces to be a triangular mesh
/// @param decompose Boolean that forces a decomposition into
/// individual faces with uniquev ertices.
template <typename helper_t> template <typename helper_t>
void draw(helper_t& helper) const { void draw(helper_t& helper, bool triangulate = false,
for (const auto& face : faces) { bool decompose = false) const {
std::vector<Vector3D> face_vtx; // vertices and faces are
for (size_t i : face) { if (not decompose and not triangulate) {
face_vtx.push_back(vertices[i]); helper.faces(vertices, faces);
} else if (triangulate) {
helper.faces(vertices, triangularMesh);
} else {
for (const auto& face : faces) {
std::vector<Vector3D> face_vtx;
for (size_t i : face) {
face_vtx.push_back(vertices[i]);
}
helper.face(face_vtx);
} }
helper.face(face_vtx);
} }
} }
/// Maximum extent of the polyhedron in space
///
/// @param transform An (optional) transform
/// to apply to the vertices for estimation the extent
/// with respect to a given coordinate frame
///
/// @return ranges that describe the space taken by this surface
Extent extent(const Transform3D& transform = Transform3D::Identity()) const;
}; };
} // namespace Acts } // namespace Acts
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
#pragma once #pragma once
#include <iostream> #include <iostream>
#include "Acts/Geometry/Extent.hpp"
#include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Surfaces/PlanarBounds.hpp" #include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/Surface.hpp" #include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/BinningType.hpp"
#include "Acts/Utilities/Definitions.hpp" #include "Acts/Utilities/Definitions.hpp"
namespace Acts { namespace Acts {
...@@ -23,26 +25,13 @@ namespace Acts { ...@@ -23,26 +25,13 @@ namespace Acts {
struct ProtoLayer { struct ProtoLayer {
public: public:
double maxX; /// The extent of the ProtoLayer
double minX; Extent extent;
double maxY; /// The envelope parameters
double minY; using range_type = std::pair<double, double>;
std::vector<range_type> envelope =
double maxZ; std::vector<range_type>((int)binValues, {0., 0.});
double minZ;
double maxR;
double minR;
double maxPhi;
double minPhi;
std::pair<double, double> envX = {0, 0};
std::pair<double, double> envY = {0, 0};
std::pair<double, double> envZ = {0, 0};
std::pair<double, double> envR = {0, 0};
std::pair<double, double> envPhi = {0, 0};
/// Constructor /// Constructor
/// ///
...@@ -66,18 +55,32 @@ struct ProtoLayer { ...@@ -66,18 +55,32 @@ struct ProtoLayer {
ProtoLayer(const GeometryContext& gctx, ProtoLayer(const GeometryContext& gctx,
const std::vector<std::shared_ptr<const Surface>>& surfaces); const std::vector<std::shared_ptr<const Surface>>& surfaces);
// normal empty constructor // Defaulated empty constructor
ProtoLayer() = default; ProtoLayer() = default;
std::ostream& toStream(std::ostream& sl) const; /// Get the parameters : min
/// @param bval The accessed binning value
/// @param addenv The steering if enevlope is added or not
double min(BinningValue bval, bool addenv = true);
/// Calculates the closest radial distance of a line // Get the parameters : max
/// /// @param bval The accessed binning value
/// @param pos1 is the first position on the line /// @param addenv The steering if enevlope is added or not
/// @param pos2 is the second position on the line double max(BinningValue bval, bool addenv = true);
///
/// @return is the closest distance // Get the parameters : max
double radialDistance(const Vector3D& pos1, const Vector3D& pos2) const; /// @param bval The accessed binning value
/// @param addenv The steering if enevlope is added or not
double medium(BinningValue bval, bool addenv = true);
// Get the parameters : max
/// @param bval The accessed binning value
/// @param addenv The steering if enevlope is added or not
double range(BinningValue bval, bool addenv = true);
/// Output to ostream
/// @param sl the input ostream
std::ostream& toStream(std::ostream& sl) const;
private: private:
/// Helper method which performs the actual min/max calculation /// Helper method which performs the actual min/max calculation
...@@ -86,5 +89,13 @@ struct ProtoLayer { ...@@ -86,5 +89,13 @@ struct ProtoLayer {
/// @param surfaces The surfaces to build this protolayer out of /// @param surfaces The surfaces to build this protolayer out of
void measure(const GeometryContext& gctx, void measure(const GeometryContext& gctx,
const std::vector<const Surface*>& surfaces); const std::vector<const Surface*>& surfaces);
/// Calculates the closest radial distance of a line
///
/// @param pos1 is the first position on the line
/// @param pos2 is the second position on the line
///
/// @return is the closest distance
double radialDistance(const Vector3D& pos1, const Vector3D& pos2) const;
}; };
} // namespace Acts } // namespace Acts
\ No newline at end of file
// This file is part of the Acts project. // This file is part of the Acts project.
// //
// Copyright (C) 2016-2018 CERN for the benefit of the Acts project // Copyright (C) 2016-2019 CERN for the benefit of the Acts project
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
// SurfaceArrayCreator.h, Acts project // SurfaceArrayCreator.hpp, Acts project
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
#pragma once #pragma once
...@@ -274,6 +274,9 @@ class SurfaceArrayCreator { ...@@ -274,6 +274,9 @@ class SurfaceArrayCreator {
/// configuration object /// configuration object
Config m_cfg; Config m_cfg;
/// logging instance
std::unique_ptr<const Logger> m_logger;
/// Private access to logger /// Private access to logger
const Logger& logger() const { return *m_logger; } const Logger& logger() const { return *m_logger; }
...@@ -401,9 +404,6 @@ class SurfaceArrayCreator { ...@@ -401,9 +404,6 @@ class SurfaceArrayCreator {
return ptr; return ptr;
} }
/// logging instance
std::unique_ptr<const Logger> m_logger;
/// Private helper method to complete the binning /// Private helper method to complete the binning
/// ///
/// ///
......
// This file is part of the Acts project.
//
// Copyright (C) 2019 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// SurfaceArrayHelper.hpp, Acts project
///////////////////////////////////////////////////////////////////
#pragma once
#include <climits>
#include <vector>
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Utilities/BinningType.hpp"
#include "Acts/Utilities/Logger.hpp"
namespace Acts {
class Surface;
using SurfaceVector = std::vector<const Surface*>;
auto mval = std::numeric_limits<double>::max();
/// @brief helper return struct for dimensions, binning & surfaces
struct SurfacePatch {
/// x min/max from parsing
double xMin = mval, xMax = -mval;
/// y min/max from parsing
double yMin = mval, yMax = -mval;
/// r min/max from parsing
double rMin = mval, rMax = -mval;
/// z min/max from parsing
double zMin = mval, zMax = -mval;
/// Reference binning for sorting
BinningValue splitBin = binR;
/// Reference binning value for sorting
double splitValue = 0.;
/// Split tolerance
double splitTolerance = 0.;
/// number of bins
unsigned int bins0 = 1, bins1 = 1;
/// Surfaces needed for the array
SurfaceVector surfaces;
/// <operator for sorting
bool operator<(const SurfacePatch& other) const {
return (splitValue < other.splitValue);
}
};
using SortedSurfaceVector = std::vector<SurfacePatch>;
/// @brief Helper tool that sorts sesnsitive vectors into layer
/// sorted packages in order to build them into Layers
///
/// It also performs ring layout detection, i.e. detects if a
/// disk setup is better described by rings that are sorted into
/// individual volumes.
///
class SurfaceArrayHelper {
public:
/// Nested configuraiton struct
struct Config {};
/// Nested options struct
struct Options {
/// Tolerance to split in r
double rSplitTolerance = 0.;
/// Tolerance to split in z
double zSplitTolerance = 0.;
};
/// Constructor with explicit config
///
/// @param cfg Explicit config struct
/// @param logger logging instance
SurfaceArrayHelper(const Config& cfg,
std::unique_ptr<const Logger> logger =
getDefaultLogger("SurfaceArrayCreator", Logging::INFO))
: m_cfg(cfg), m_logger(std::move(logger)) {}
/// Destructor
virtual ~SurfaceArrayHelper() = default;
/// Sort surfaces into cylindrical patches
/// @param gctx The geometry context
/// @param surfaces The input surfaces (unordered)
/// @param options The sorting options
SortedSurfaceVector cylinders(const GeometryContext& gctx,
const SurfaceVector& surfaces,
const Options& options) const;
/// Sort surfaces into cylindrical patches
/// @param gctx The geometry context
/// @param surfaces The input surfaces (unordered)
/// @param options The sorting options
SortedSurfaceVector discs(const GeometryContext& gctx,
const SurfaceVector& surfaces,
const Options& options) const;
/// Sort surfaces into planar patches
/// @param gctx The geometry context
/// @param surfaces The input surfaces (unordered)
/// @param options The sorting options
SortedSurfaceVector planes(const GeometryContext& gctx,
const SurfaceVector& surfaces,
const Options& options) const;
/// Set logging instance
/// @param logger is the logging instance to be set
void setLogger(std::unique_ptr<const Logger> logger) {
m_logger = std::move(logger);
}
private:
/// configuration object
Config m_cfg;
/// logging instance
std::unique_ptr<const Logger> m_logger;
/// Private access to logger
const Logger& logger() const { return *m_logger; }
/// Parse and sort boundaries
/// @param surfaces The input surfaces (unordered)
/// @param splitBin The binning value for the split
/// @param splitTolerance The double value tolerance to split
SortedSurfaceVector sort(const GeometryContext& gctx,
const SurfaceVector& surfaces, BinningValue splitBin,
double splitTolerance) const;
};
} // namespace Acts
\ No newline at end of file
...@@ -336,6 +336,21 @@ class TrackingVolume : public Volume { ...@@ -336,6 +336,21 @@ class TrackingVolume : public Volume {
/// @return If it has a BVH or not. /// @return If it has a BVH or not.
bool hasBoundingVolumeHierarchy() const; bool hasBoundingVolumeHierarchy() const;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const final;
/// Sign the volume - the geometry builder has to do that /// Sign the volume - the geometry builder has to do that
/// ///
/// @param geosign is the volume signature /// @param geosign is the volume signature
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/GeometryObject.hpp" #include "Acts/Geometry/GeometryObject.hpp"
#include "Acts/Geometry/GeometryStatics.hpp" #include "Acts/Geometry/GeometryStatics.hpp"
#include "Acts/Geometry/Polyhedron.hpp"
#include "Acts/Utilities/BoundingBox.hpp" #include "Acts/Utilities/BoundingBox.hpp"
#include "Acts/Utilities/Definitions.hpp" #include "Acts/Utilities/Definitions.hpp"
...@@ -105,6 +106,21 @@ class Volume : public virtual GeometryObject { ...@@ -105,6 +106,21 @@ class Volume : public virtual GeometryObject {
const Vector3D binningPosition(const GeometryContext& gctx, const Vector3D binningPosition(const GeometryContext& gctx,
BinningValue bValue) const override; BinningValue bValue) const override;
// Return a Polyhedron for this object
///
/// @param gctx The current geometry context object, e.g. alignment
/// @param lseg Number of segments along curved lines, if the lseg
/// is set to one, only the corners and the extrema are given,
/// otherwise it represents the number of segments for a full 2*M_PI
/// circle and is scaled to the relevant sector
///
/// @note An internal surface transform can invalidate the extrema
/// in the transformed space
///
/// @return A list of vertices and a face/facett description of it
Polyhedron polyhedronRepresentation(const GeometryContext& gctx,
size_t lseg) const override;
protected: protected:
std::shared_ptr<const Transform3D> m_transform; std::shared_ptr<const Transform3D> m_transform;
Transform3D m_itransform; Transform3D m_itransform;
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
///////////////////////////////////////////////////////////////////
// VolumeBounds.h, Acts project
///////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
...@@ -45,8 +41,10 @@ class VolumeBounds { ...@@ -45,8 +41,10 @@ class VolumeBounds {
public: public:
/// Default Constructor*/ /// Default Constructor*/
VolumeBounds() = default; VolumeBounds() = default;
/// Destructor /// Destructor
virtual ~VolumeBounds() = default; virtual ~VolumeBounds() = default;
/// clone() method to make deep copy in Volume copy constructor and for /// clone() method to make deep copy in Volume copy constructor and for
/// assigment operator of the Surface class. /// assigment operator of the Surface class.
virtual VolumeBounds* clone() const = 0; virtual VolumeBounds* clone() const = 0;
......
...@@ -47,70 +47,6 @@ class DetectorElementBase { ...@@ -47,70 +47,6 @@ class DetectorElementBase {
/// Returns the thickness of the module /// Returns the thickness of the module
/// @return double that indicates the thickness of the module /// @return double that indicates the thickness of the module
virtual double thickness() const = 0; virtual double thickness() const = 0;
/// Fast access to bin members
/// Bin members are elements that are in the same geometric binning cell,
/// such, e.g. backside modules in a multiplet detector
///
/// @return vector of DetectorElementBase pointers
const std::vector<const DetectorElementBase*>& binmembers() const;
/// Reigster the bin members
/// Bin members are elements that are in the same geometric binning cell,
/// such, e.g. backside modules in a doublet/triplet detector
///
/// @param binmembers DetectorElementBase objects in the same cell
void registerBinmembers(std::vector<const DetectorElementBase*>& binmembers);
/// Fast access to neighbours
/// Neighbours are elements that are in an neighbouring geometric binning
/// cell, such, e.g. next in phi, next in eta modules
///
/// @return vector of DetectorElementBase pointers
const std::vector<const DetectorElementBase*>& neighbours() const;
/// Reigster the neighbours
/// Neighbours are elements that are in an neighbouring geometric binning
/// cell, such, e.g. next in phi, next in eta modules
///
/// @param neighbours are DetectorElementBase objects that are neighbours
void registerNeighbours(std::vector<const DetectorElementBase*>& neighbours);
private:
std::vector<const DetectorElementBase*> m_binmembers;
std::vector<const DetectorElementBase*> m_neighbours;
}; };
inline const std::vector<const DetectorElementBase*>&
DetectorElementBase::binmembers() const {
return m_binmembers;
}
inline const std::vector<const DetectorElementBase*>&
DetectorElementBase::neighbours() const {
return m_neighbours;
}
inline void DetectorElementBase::registerBinmembers(
std::vector<const DetectorElementBase*>& binmembers) {
for (auto& bmember : binmembers) {
// only fill if it's not yet registered
if (find(m_binmembers.begin(), m_binmembers.end(), bmember) ==
m_binmembers.end()) {
m_binmembers.push_back(bmember);
}
}
}
inline void DetectorElementBase::registerNeighbours(
std::vector<const DetectorElementBase*>& neighbours) {
for (auto& neighbour : neighbours) {
// only fill if it's not yet registered
if (find(m_neighbours.begin(), m_neighbours.end(), neighbour) ==
m_neighbours.end()) {
m_neighbours.push_back(neighbour);
}
}
}
} // end of namespace Acts } // end of namespace Acts