Implementation to make a (tracking) volume alignable.
More...
#include <VolumePlacement.h>
|
| using | AlignableNode_t = GeoIntrusivePtr<GeoAlignableTransform> |
| | Abrivation of an alignable GeoTransform.
|
| using | Parent_t |
| | Abrivation of the parent input types that are connected to the alignment system --> A direct alignable transform --> A detector element base following the alignment --> Another alignable volume element.
|
Implementation to make a (tracking) volume alignable.
The placement is coupled to the alignment system either via a reference IDetectorElement, an alignable node in the geometry tree or another VolumePlacement.
Definition at line 22 of file VolumePlacement.h.
◆ AlignableNode_t
◆ Parent_t
Initial value:
ATLAS interface of a detector element.
GeoIntrusivePtr< GeoAlignableTransform > AlignableNode_t
Abrivation of an alignable GeoTransform.
VolumePlacement(const DetectorType detType, const AlignableNode_t parentNode, std::optional< Amg::Transform3D > addShift=std::nullopt)
Constructor taking an Alignable transform from the geometry tree.
Abrivation of the parent input types that are connected to the alignment system --> A direct alignable transform --> A detector element base following the alignment --> Another alignable volume element.
Definition at line 31 of file VolumePlacement.h.
◆ VolumePlacement() [1/3]
Constructor taking an Alignable transform from the geometry tree.
- Parameters
-
| detType | Detectortype of the alignment store into which the transforms are written |
| parentNode | Pointer to the alignable transform |
| addShift | Additional optional shift to be applied on top of the alignable reference |
Definition at line 39 of file VolumePlacement.cxx.
41 :
45 if (!addShift) {
46 return;
47 }
48 m_refShift = GeoDeDuplicator{}.makeTransform(*addShift);
49 }
std::unique_ptr< VolumeGeoPositioning > m_locToGlobCache
Cache to handle the local -> global transform of the volume.
Parent_t m_parent
Parent element which is following the alignment.
GeoIntrusivePtr< GeoTransform > m_refShift
Additional shift on top of the parent position.
std::unique_ptr< VolumeGeoPositioning > m_globToLocCache
Cache to handle the global -> local transform of the volume.
◆ VolumePlacement() [2/3]
Constructor taking the reference to a Detector element.
The life time of the detector element must be ensured to exceed the Placement's lifetime
- Parameters
-
| parentElement | The detector element which alignment the volume is following |
| addShift | Additional optional shift to be applied on top of the alignable reference |
Definition at line 55 of file VolumePlacement.cxx.
56 :
59 parentElement.detectorType(), this)} {
60 if (!addShift) {
61 return;
62 }
64 parentElement.detectorType(), this);
65 m_refShift = GeoDeDuplicator{}.makeTransform(*addShift);
66
67 }
◆ VolumePlacement() [3/3]
| ActsTrk::VolumePlacement::VolumePlacement |
( |
const VolumePlacement & | parentPlacement, |
|
|
std::optional< Amg::Transform3D > | addShift = std::nullopt ) |
|
explicit |
Constructor taking the reference to another placement The life time of the object must be ensured to exceed the Placement's lifetime.
- Parameters
-
| parentPlacement | The parent placement moving according to the alignment |
| addShift | Additional optional shift to be applied on top of the alignable reference |
Definition at line 69 of file VolumePlacement.cxx.
70 :
72 if (!addShift) {
73 return;
74 }
76 parentPlacement.detectorType(), this);
78 parentPlacement.detectorType(), this);
79 m_refShift = GeoDeDuplicator{}.makeTransform(*addShift);
80
81 }
◆ addChild()
| void ActsTrk::VolumePlacement::addChild |
( |
std::unique_ptr< VolumePlacement > && | child | ) |
|
Add a child volume placement to this placement.
The object takes ownership and fills the alignment cache
- Parameters
-
| child | The child to be appended |
Definition at line 50 of file VolumePlacement.cxx.
50 {
51 assert(child.get() != this);
52 assert(child != nullptr);
54 }
std::vector< std::shared_ptr< VolumePlacement > > m_children
Children spawning from this VolumePlacement.
◆ connectCenterSurface()
| void ActsTrk::VolumePlacement::connectCenterSurface |
( |
std::shared_ptr< Acts::RegularSurface > | surface | ) |
|
Connect an external surface and place it into the volume center.
- Parameters
-
| surface | pointer to the surface that is connected to the placement |
Definition at line 123 of file VolumePlacement.cxx.
123 {
126 }
127 m_surfacePlacement = std::make_shared<Acts::detail::PortalPlacement>(std::numeric_limits<std::size_t>::max(),
128 Amg::Transform3D::Identity(), this,
129 surface);
130 }
std::shared_ptr< Acts::detail::PortalPlacement > m_surfacePlacement
Pipe the local -> global transform to a surface.
#define THROW_EXCEPTION(MESSAGE)
◆ detectorType()
| DetectorType ActsTrk::VolumePlacement::detectorType |
( |
| ) |
const |
|
finaloverridevirtual |
Implements ActsTrk::IVolumePlacement.
Definition at line 131 of file VolumePlacement.cxx.
131 {
134 }
135 return std::visit([](const auto& parent) {
136 using visit_t = std::decay_t<
decltype(
parent)>;
137 if constexpr(!std::is_same_v<visit_t, AlignableNode_t>) {
138 return parent->detectorType();
139 }
142 }
@ UnDefined
Small Thing Gap chambers (NSW).
◆ globalToLocalTransform() [1/2]
| const Acts::Transform3 & ActsTrk::VolumePlacement::globalToLocalTransform |
( |
const Acts::GeometryContext & | gctx | ) |
const |
|
finaloverride |
Definition at line 107 of file VolumePlacement.cxx.
107 {
108
110 return std::get<const VolumePlacement*>(
m_parent)->globalToLocalTransform(tgContext);
111 }
113 }
◆ globalToLocalTransform() [2/2]
Definition at line 114 of file VolumePlacement.cxx.
114 {
116 }
const Acts::Transform3 & globalToLocalTransform(const Acts::GeometryContext &gctx) const override final
◆ localToGlobalTransform() [1/3]
| const Acts::Transform3 & ActsTrk::VolumePlacement::localToGlobalTransform |
( |
const Acts::GeometryContext & | gctx | ) |
const |
|
finaloverride |
Definition at line 91 of file VolumePlacement.cxx.
91 {
93 if (std::holds_alternative<const IDetectorElement*>(
m_parent)){
94 const auto* gctx = tgContext.get<const GeometryContext*>();
95 return std::get<const IDetectorElement*>(
m_parent)->localToGlobalTransform(*gctx);
96 }
else if (std::holds_alternative<const VolumePlacement*>(
m_parent)) {
97 return std::get<const VolumePlacement*>(
m_parent)->localToGlobalTransform(tgContext);
98 } else {
99 THROW_EXCEPTION(
"A VolumePlacement without cache && alignable trf should never happen");
100 }
101 }
103 }
◆ localToGlobalTransform() [2/3]
Constructs the local -> global transform of the volume.
The request is forwarded to the parent and an optional shift is applied on top
- Parameters
-
| store | From which the alignment information is grepped and to which the final transform is written |
Definition at line 144 of file VolumePlacement.cxx.
144 {
146 using visit_t = std::decay_t<
decltype(
parent)>;
147 if constexpr(std::is_same_v<visit_t, AlignableNode_t>) {
148 return parent->getTransform(store ?
store->geoModelAlignment.get() :
nullptr);
149 } else {
150 return parent->localToGlobalTransform(store);
151 }
152 return Amg::Transform3D::Identity();
154 : Amg::Transform3D::Identity());
155 }
Eigen::Affine3d Transform3D
◆ localToGlobalTransform() [3/3]
Definition at line 104 of file VolumePlacement.cxx.
104 {
106 }
const Acts::Transform3 & localToGlobalTransform(const Acts::GeometryContext &gctx) const override final
◆ makePortalsAlignable()
| void ActsTrk::VolumePlacement::makePortalsAlignable |
( |
const Acts::GeometryContext & | gctx, |
|
|
const std::vector< std::shared_ptr< Acts::RegularSurface > > & | portalsToAlign ) |
|
finaloverride |
Definition at line 83 of file VolumePlacement.cxx.
84 {
85 Acts::VolumePlacementBase::makePortalsAlignable(gctx, portalsToAlign);
86 for (std::size_t p = 0ul;
p < portalsToAlign.size(); ++
p) {
87 m_portalCaches.emplace_back(std::make_unique<VolumeGeoPositioning>(
this, p));
88 }
89 }
std::vector< std::unique_ptr< VolumeGeoPositioning > > m_portalCaches
Cache to handle the local -> global transforms of the associated portals.
◆ portalLocalToGlobal()
| const Acts::Transform3 & ActsTrk::VolumePlacement::portalLocalToGlobal |
( |
const Acts::GeometryContext & | gctx, |
|
|
const std::size_t | portalIdx ) const |
|
finaloverride |
◆ storeAlignedTransforms()
| unsigned ActsTrk::VolumePlacement::storeAlignedTransforms |
( |
DetectorAlignStore & | store | ) |
const |
|
finaloverridevirtual |
Implements ActsTrk::IVolumePlacement.
Definition at line 157 of file VolumePlacement.cxx.
157 {
160 if (volCache) {
161 n+=volCache->storeTransform(store);
162 }
163 }
164 for (
const std::unique_ptr<VolumeGeoPositioning>& cache:
m_portalCaches) {
165 n+=
cache->storeTransform(store);
166 }
167 for (
const std::shared_ptr<VolumePlacement>& child :
m_children) {
168 n+=child->storeAlignedTransforms(store);
169 }
171 }
Auxiliary class to store the aligned transforms of the volume and of the associated portals.
const IIntersectionCache * cache() const
Retrieve the associated cache block, if it exists.
◆ m_children
| std::vector<std::shared_ptr<VolumePlacement> > ActsTrk::VolumePlacement::m_children {} |
|
private |
◆ m_globToLocCache
◆ m_locToGlobCache
◆ m_parent
| Parent_t ActsTrk::VolumePlacement::m_parent {} |
|
private |
◆ m_portalCaches
◆ m_refShift
| GeoIntrusivePtr<GeoTransform> ActsTrk::VolumePlacement::m_refShift {} |
|
private |
◆ m_surfacePlacement
| std::shared_ptr<Acts::detail::PortalPlacement> ActsTrk::VolumePlacement::m_surfacePlacement {} |
|
private |
The documentation for this class was generated from the following files: