ATLAS Offline Software
Loading...
Searching...
No Matches
VolumePlacement.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 ActsGeoUtils_VolumePlacement_H
5#define ActsGeoUtils_VolumePlacement_H
6#ifndef SIMULATIONBASE
7
12
13#include "GeoModelKernel/GeoAlignableTransform.h"
14#include "GeoModelKernel/GeoIntrusivePtr.h"
15
16#include <variant>
17
18namespace ActsTrk{
23 public:
25 using AlignableNode_t = GeoIntrusivePtr<GeoAlignableTransform>;
31 using Parent_t = std::variant<AlignableNode_t,
33 const VolumePlacement*>;
38 explicit VolumePlacement(const DetectorType detType,
39 const AlignableNode_t parentNode,
40 std::optional<Amg::Transform3D> addShift = std::nullopt);
45 explicit VolumePlacement(const IDetectorElementBase& parentElement,
46 std::optional<Amg::Transform3D> addShift = std::nullopt);
51 explicit VolumePlacement(const VolumePlacement& parentPlacement,
52 std::optional<Amg::Transform3D> addShift = std::nullopt);
56 void addChild(std::unique_ptr<VolumePlacement>&& child);
59 void connectCenterSurface(std::shared_ptr<Acts::RegularSurface> surface);
61 DetectorType detectorType() const override final;
63 unsigned storeAlignedTransforms(const DetectorAlignStore& store) const override final;
66 const std::vector<std::shared_ptr<Acts::RegularSurface>>& portalsToAlign) override final;
68 const Acts::Transform3& localToGlobalTransform(const Acts::GeometryContext& gctx) const override final;
72 const Acts::Transform3& globalToLocalTransform(const Acts::GeometryContext& gctx) const override final;
77 const std::size_t portalIdx) const override final;
78
79 private:
88 public:
90 enum class CacheFlags: std::uint8_t {
91 volumeLocToGlob, // Local -> global transform of the volume
92 volumeGlobToLoc, // Global -> local transform of the volume
93 portalLocToGlob // Local -> global transform of the associated portal
94 };
95
100 explicit AlignedCache(const CacheFlags flags,
101 const DetectorType type,
102 const VolumePlacement* parent);
107 explicit AlignedCache(const VolumePlacement* parent,
108 const std::size_t portalIdx);
110 virtual Amg::Transform3D fetchTransform(const DetectorAlignStore* store) const override;
111 private:
113 const VolumePlacement* m_parent{nullptr};
116 };
117
120 GeoIntrusivePtr<GeoTransform> m_refShift{};
122 std::unique_ptr<AlignedCache> m_locToGlobCache{};
124 std::unique_ptr<AlignedCache> m_globToLocCache{};
126 std::vector<std::unique_ptr<AlignedCache>> m_portalCaches{};
128 std::vector<std::unique_ptr<VolumePlacement>> m_children{};
130 std::unique_ptr<Acts::detail::PortalPlacement> m_surfacePlacement{};
131 };
132}
133
134#endif
135#endif
Eigen::Affine3d Transform3D
base class interface providing the bare minimal interface extension.
ATLAS extension of the VolumePlacementBase interface.
TransformCacheBase(const IdentifierHash &cacheHash, const DetectorType type)
Auxiliary class to store the aligned transforms of the volume and of the associated portals.
const VolumePlacement * m_parent
Back reference to the parent VolumePlacement.
CacheFlags m_flags
Flags to indicate which transform type is handled.
CacheFlags
Flag to indicate which kind of transform is handled by the AlignedCache.
AlignedCache(const CacheFlags flags, const DetectorType type, const VolumePlacement *parent)
Constructor for the cache storing the of the volume itself.
std::unique_ptr< AlignedCache > m_globToLocCache
Cache to handle the global -> local transform of the volume.
std::vector< std::unique_ptr< AlignedCache > > m_portalCaches
Cache to handle the local -> global transforms of the associated portals.
const Acts::Transform3 & globalToLocalTransform(const Acts::GeometryContext &gctx) const override final
GeoIntrusivePtr< GeoAlignableTransform > AlignableNode_t
Abrivation of an alignable GeoTransform.
Parent_t m_parent
Parent element which is following the alignment.
const Acts::Transform3 & localToGlobalTransform(const Acts::GeometryContext &gctx) const override final
std::unique_ptr< Acts::detail::PortalPlacement > m_surfacePlacement
Pipe the local -> global transform to a surface.
VolumePlacement(const DetectorType detType, const AlignableNode_t parentNode, std::optional< Amg::Transform3D > addShift=std::nullopt)
Constructor taking an Alignable transform from the geometry tree.
GeoIntrusivePtr< GeoTransform > m_refShift
Additional shift on top of the parent position.
void addChild(std::unique_ptr< VolumePlacement > &&child)
Add a child volume placement to this placement.
std::vector< std::unique_ptr< VolumePlacement > > m_children
Children spawning from this VolumePlacement.
unsigned storeAlignedTransforms(const DetectorAlignStore &store) const override final
DetectorType detectorType() const override final
void makePortalsAlignable(const Acts::GeometryContext &gctx, const std::vector< std::shared_ptr< Acts::RegularSurface > > &portalsToAlign) override final
const Acts::Transform3 & portalLocalToGlobal(const Acts::GeometryContext &gctx, const std::size_t portalIdx) const override final
std::variant< AlignableNode_t, const IDetectorElementBase *, const VolumePlacement * > Parent_t
Abrivation of the parent input types that are connected to the alignment system --> A direct alignabl...
std::unique_ptr< AlignedCache > m_locToGlobCache
Cache to handle the local -> global transform of the volume.
void connectCenterSurface(std::shared_ptr< Acts::RegularSurface > surface)
Connect an external surface and place it into the volume center.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Affine3d Transform3D
STL namespace.
#define private