ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::VolumePlacement::AlignedCache Class Reference

Auxiliary class to store the aligned transforms of the volume and of the associated portals. More...

Inheritance diagram for ActsTrk::VolumePlacement::AlignedCache:
Collaboration diagram for ActsTrk::VolumePlacement::AlignedCache:

Public Types

enum class  CacheFlags : std::uint8_t { volumeLocToGlob , volumeGlobToLoc , portalLocToGlob }
 Flag to indicate which kind of transform is handled by the AlignedCache. More...

Public Member Functions

 AlignedCache (const CacheFlags flags, const DetectorType type, const VolumePlacement *parent)
 Constructor for the cache storing the of the volume itself.
 AlignedCache (const VolumePlacement *parent, const std::size_t portalIdx)
 Constructor for the cache storing the transform of the alignable portals.
virtual Amg::Transform3D fetchTransform (const DetectorAlignStore *store) const override
 Fetch the transform to store it in the detector alignment cache.
IdentifierHash hash () const
 Returns the sensor hash of this transformation cache.
const Amg::Transform3DgetTransform (const DetectorAlignStore *store) const
 Returns the matching transformation from the alignment store.
const Amg::Transform3DgetTransform (const Acts::GeometryContext &gctx) const
 returns the cached transform from the Acts Geometry context
bool storeTransform (DetectorAlignStore &store) const
 Store the final transform in the mutable alignment store.
virtual void releaseNominalCache () const
 resets the nominal cache associated with the detector element
DetectorType detectorType () const
 returns the detector type of the cache

Private Types

using TicketCounter = detail::TrfStoreTicketCounter

Private Attributes

const VolumePlacementm_parent {nullptr}
 Back reference to the parent VolumePlacement.
CacheFlags m_flags {CacheFlags::portalLocToGlob}
 Flags to indicate which transform type is handled.
const IdentifierHash m_hash {0}
const DetectorType m_type {DetectorType::UnDefined}
const unsigned int m_clientNo {TicketCounter::drawTicket(m_type)}
CxxUtils::CachedUniquePtrT< Amg::Transform3D > m_nomCache ATLAS_THREAD_SAFE {}

Detailed Description

Auxiliary class to store the aligned transforms of the volume and of the associated portals.

Definition at line 86 of file VolumePlacement.h.

Member Typedef Documentation

◆ TicketCounter

Member Enumeration Documentation

◆ CacheFlags

enum class ActsTrk::VolumePlacement::AlignedCache::CacheFlags : std::uint8_t
strong

Flag to indicate which kind of transform is handled by the AlignedCache.

Enumerator
volumeLocToGlob 
volumeGlobToLoc 
portalLocToGlob 

Definition at line 89 of file VolumePlacement.h.

89 : 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 };

Constructor & Destructor Documentation

◆ AlignedCache() [1/2]

ActsTrk::VolumePlacement::AlignedCache::AlignedCache ( const CacheFlags flags,
const DetectorType type,
const VolumePlacement * parent )
explicit

Constructor for the cache storing the of the volume itself.

Parameters
flagsFlag indicating local -> global or global -> local
typeIn which detector transform store is the cache appended
parentPointer to the parent creating the cache

Definition at line 13 of file VolumePlacement.cxx.

15 :
16 ActsTrk::TransformCacheBase{IdentifierHash{}, type},
const VolumePlacement * m_parent
Back reference to the parent VolumePlacement.
CacheFlags m_flags
Flags to indicate which transform type is handled.

◆ AlignedCache() [2/2]

ActsTrk::VolumePlacement::AlignedCache::AlignedCache ( const VolumePlacement * parent,
const std::size_t portalIdx )
explicit

Constructor for the cache storing the transform of the alignable portals.

Parameters
parentPointer to the parent creating the cache
portalidxIndex of the portal represented by the cache

Definition at line 18 of file VolumePlacement.cxx.

19 :
20 ActsTrk::TransformCacheBase(portalIdx, parent->detectorType()),
21 m_parent{parent} {}

Member Function Documentation

◆ detectorType()

DetectorType ActsTrk::TransformCacheBase::detectorType ( ) const
inherited

returns the detector type of the cache

Definition at line 28 of file TransformCache.cxx.

28{ return m_type; }
const DetectorType m_type

◆ fetchTransform()

Amg::Transform3D ActsTrk::VolumePlacement::AlignedCache::fetchTransform ( const DetectorAlignStore * store) const
overridevirtual

Fetch the transform to store it in the detector alignment cache.

Implements ActsTrk::TransformCacheBase.

Definition at line 23 of file VolumePlacement.cxx.

23 {
24 switch (m_flags) {
26 return m_parent->localToGlobalTransform(store);
28 return m_parent->localToGlobalTransform(store) *
29 m_parent->portalPlacement(hash())->portalToVolumeCenter();
31 return m_parent->localToGlobalTransform(store).inverse();
32 }
33 }
34 return Amg::Transform3D::Identity();
35 }
IdentifierHash hash() const
Returns the sensor hash of this transformation cache.

◆ getTransform() [1/2]

const Amg::Transform3D & ActsTrk::TransformCacheBase::getTransform ( const Acts::GeometryContext & gctx) const
inherited

returns the cached transform from the Acts Geometry context

◆ getTransform() [2/2]

const Amg::Transform3D & ActsTrk::TransformCacheBase::getTransform ( const DetectorAlignStore * store) const
inherited

Returns the matching transformation from the alignment store.

If a nullptr is given, then it's equivalent to the case that the transformation is pointing to a perfectly aligned surface. In this case, the internal nominal transformation cache is invoked.

Parameters
storePointer to the detector aligment store

◆ hash()

IdentifierHash ActsTrk::TransformCacheBase::hash ( ) const
inherited

Returns the sensor hash of this transformation cache.

◆ releaseNominalCache()

void ActsTrk::TransformCacheBase::releaseNominalCache ( ) const
virtualinherited

resets the nominal cache associated with the detector element

Reimplemented in ActsTrk::TransformCache.

Definition at line 16 of file TransformCache.cxx.

16 {
17 m_nomCache.release();
18 }

◆ storeTransform()

bool ActsTrk::TransformCacheBase::storeTransform ( DetectorAlignStore & store) const
inherited

Store the final transform in the mutable alignment store.

Returns true whether a new transform was stored

Parameters
storeThe reference to the store where the cache stores its transform

Definition at line 20 of file TransformCache.cxx.

20 {
21 if (store.detType != detectorType() ||
22 store.trackingAlignment->getTransform(m_clientNo) != nullptr){
23 return false;
24 }
25 store.trackingAlignment->setTransform(m_clientNo, fetchTransform(&store));
26 return true;
27 }
const unsigned int m_clientNo
DetectorType detectorType() const
returns the detector type of the cache
virtual Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const =0
TestStore store
Definition TestStore.cxx:23

Member Data Documentation

◆ ATLAS_THREAD_SAFE

CxxUtils::CachedUniquePtrT<Amg::Transform3D> m_nomCache ActsTrk::TransformCacheBase::ATLAS_THREAD_SAFE {}
mutableprivateinherited

Definition at line 63 of file TransformCache.h.

63{};

◆ m_clientNo

const unsigned int ActsTrk::TransformCacheBase::m_clientNo {TicketCounter::drawTicket(m_type)}
privateinherited

Definition at line 62 of file TransformCache.h.

static unsigned int drawTicket(const DetectorType detType)
Returns a unique ID to the client under which the client can store its transfomrm inside the containe...

◆ m_flags

CacheFlags ActsTrk::VolumePlacement::AlignedCache::m_flags {CacheFlags::portalLocToGlob}
private

Flags to indicate which transform type is handled.

Definition at line 114 of file VolumePlacement.h.

◆ m_hash

const IdentifierHash ActsTrk::TransformCacheBase::m_hash {0}
privateinherited

Definition at line 59 of file TransformCache.h.

59{0};

◆ m_parent

const VolumePlacement* ActsTrk::VolumePlacement::AlignedCache::m_parent {nullptr}
private

Back reference to the parent VolumePlacement.

Definition at line 112 of file VolumePlacement.h.

112{nullptr};

◆ m_type

const DetectorType ActsTrk::TransformCacheBase::m_type {DetectorType::UnDefined}
privateinherited

Definition at line 60 of file TransformCache.h.

@ UnDefined
Small Thing Gap chambers (NSW).

The documentation for this class was generated from the following files: