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 <optional>
17#include <variant>
18
19namespace ActsTrk{
24 public:
26 using AlignableNode_t = GeoIntrusivePtr<GeoAlignableTransform>;
32 using Parent_t = std::variant<AlignableNode_t,
33 const IDetectorElement*,
34 const VolumePlacement*>;
39 explicit VolumePlacement(const DetectorType detType,
40 const AlignableNode_t parentNode,
41 const std::optional<Amg::Transform3D> & addShift = std::nullopt);
46 explicit VolumePlacement(const IDetectorElement& parentElement,
47 const std::optional<Amg::Transform3D> & addShift = std::nullopt);
52 explicit VolumePlacement(const VolumePlacement& parentPlacement,
53 const std::optional<Amg::Transform3D> & addShift = std::nullopt);
57 void addChild(std::unique_ptr<VolumePlacement>&& child);
60 void connectCenterSurface(std::shared_ptr<Acts::RegularSurface> surface);
62 DetectorType detectorType() const override final;
64 unsigned storeAlignedTransforms(DetectorAlignStore& store) const override final;
67 const std::vector<std::shared_ptr<Acts::RegularSurface>>& portalsToAlign) override final;
69 const Acts::Transform3& localToGlobalTransform(const Acts::GeometryContext& gctx) const override final;
73 const Acts::Transform3& globalToLocalTransform(const Acts::GeometryContext& gctx) const override final;
78 const std::size_t portalIdx) const override final;
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 VolumeGeoPositioning(const CacheFlags flags,
101 const DetectorType type,
102 const VolumePlacement* parent);
107 explicit VolumeGeoPositioning(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<VolumeGeoPositioning> m_locToGlobCache{};
124 std::unique_ptr<VolumeGeoPositioning> m_globToLocCache{};
126 std::vector<std::unique_ptr<VolumeGeoPositioning>> m_portalCaches{};
128 std::vector<std::shared_ptr<VolumePlacement>> m_children{};
130 std::shared_ptr<Acts::detail::PortalPlacement> m_surfacePlacement{};
131 };
132}
133
134#endif
135#endif
Eigen::Affine3d Transform3D
AlignableGeoPositioning(const IdentifierHash &cacheHash, const DetectorType type)
Standard constrcutor.
ATLAS interface of a detector element.
ATLAS extension of the VolumePlacementBase interface.
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.
VolumeGeoPositioning(const CacheFlags flags, const DetectorType type, const VolumePlacement *parent)
Constructor for the cache storing the of the volume itself.
VolumePlacement(const DetectorType detType, const AlignableNode_t parentNode, const std::optional< Amg::Transform3D > &addShift=std::nullopt)
Constructor taking an Alignable transform from the geometry tree.
const Acts::Transform3 & globalToLocalTransform(const Acts::GeometryContext &gctx) const override final
std::unique_ptr< VolumeGeoPositioning > m_locToGlobCache
Cache to handle the local -> global transform of the volume.
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::vector< std::shared_ptr< VolumePlacement > > m_children
Children spawning from this VolumePlacement.
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::unique_ptr< VolumeGeoPositioning > m_globToLocCache
Cache to handle the global -> local transform of the volume.
std::vector< std::unique_ptr< VolumeGeoPositioning > > m_portalCaches
Cache to handle the local -> global transforms of the associated portals.
std::shared_ptr< Acts::detail::PortalPlacement > m_surfacePlacement
Pipe the local -> global transform to a surface.
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
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