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,
32 const IDetectorElement*,
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 IDetectorElement& 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(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 private:
87 public:
89 enum class CacheFlags: std::uint8_t {
90 volumeLocToGlob, // Local -> global transform of the volume
91 volumeGlobToLoc, // Global -> local transform of the volume
92 portalLocToGlob // Local -> global transform of the associated portal
93 };
94
99 explicit AlignedCache(const CacheFlags flags,
100 const DetectorType type,
101 const VolumePlacement* parent);
106 explicit AlignedCache(const VolumePlacement* parent,
107 const std::size_t portalIdx);
109 virtual Amg::Transform3D fetchTransform(const DetectorAlignStore* store) const override;
110 private:
112 const VolumePlacement* m_parent{nullptr};
115 };
116
119 GeoIntrusivePtr<GeoTransform> m_refShift{};
121 std::unique_ptr<AlignedCache> m_locToGlobCache{};
123 std::unique_ptr<AlignedCache> m_globToLocCache{};
125 std::vector<std::unique_ptr<AlignedCache>> m_portalCaches{};
127 std::vector<std::unique_ptr<VolumePlacement>> m_children{};
129 std::unique_ptr<Acts::detail::PortalPlacement> m_surfacePlacement{};
130 };
131}
132
133#endif
134#endif
Eigen::Affine3d Transform3D
Base class interface for the actual readout elements.
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.
unsigned storeAlignedTransforms(DetectorAlignStore &store) const override final
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.
std::variant< AlignableNode_t, const IDetectorElement *, const VolumePlacement * > Parent_t
Abrivation of the parent input types that are connected to the alignment system --> A direct alignabl...
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.
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::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
Definition testRead.cxx:27