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
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 = DetectorAlignStore::TrackingAlignStore

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)}
std::shared_mutex m_mutex ATLAS_THREAD_SAFE {}
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 87 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 90 of file VolumePlacement.h.

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

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 20 of file TransformCache.cxx.

20{ 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 std::unique_lock guard{m_mutex};
18 m_nomCache.release();
19 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

std::shared_mutex m_mutex ActsTrk::TransformCacheBase::ATLAS_THREAD_SAFE {}
mutableprivateinherited

Definition at line 59 of file TransformCache.h.

59{};

◆ ATLAS_THREAD_SAFE [2/2]

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

Definition at line 60 of file TransformCache.h.

60{};

◆ m_clientNo

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

Definition at line 58 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 transformation inside the cont...

◆ m_flags

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

Flags to indicate which transform type is handled.

Definition at line 115 of file VolumePlacement.h.

◆ m_hash

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

Definition at line 55 of file TransformCache.h.

55{0};

◆ m_parent

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

Back reference to the parent VolumePlacement.

Definition at line 113 of file VolumePlacement.h.

113{nullptr};

◆ m_type

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

Definition at line 56 of file TransformCache.h.

@ UnDefined
Small Thing Gap chambers (NSW)

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