![]() |
ATLAS Offline Software
|
The TransformStore provides a central place to outsource the alignable transforms of the sensitive detector elements and the alignable volumes. More...
#include <TransformStore.h>
Public Types | |
| enum class | Mode : std::uint8_t { LazyFill , Block } |
| Enum describing the operation mode of the cache. More... | |
Public Member Functions | |
| TransformStore (const DetectorType detType, const Mode m) | |
| Constructor. | |
| TransformStore (TransformStore &&other) noexcept=default | |
| Define the move constructor. | |
| TransformStore & | operator= (TransformStore &&other) noexcept=default |
| Define the move assignment operator. | |
| TransformStore (const TransformStore &other) noexcept | |
| Define the copy constructor. | |
| TransformStore & | operator= (const TransformStore &other) noexcept |
| Define the copy assignment operator. | |
| const Amg::Transform3D * | getTransform (const unsigned ticketNo) const |
| Returns the pointer to the transfomation cached in the store (Might be a nullptr if LazyFill is used). | |
| const Amg::Transform3D & | setTransform (const unsigned int ticketNo, Amg::Transform3D &&trf) const |
| Stores a transform at the index of the passed ticket number. | |
| const Amg::Transform3D & | setTransform (const unsigned int ticketNo, Amg::Transform3D &&trf) |
| Stores a transform at the index of the passed ticket number. | |
| Mode | mode () const |
| Returns the mode with which the store has been instantiated. | |
| DetectorType | detectorType () const |
| Returns the detector type. | |
| std::size_t | size () const |
| Return the size (maximum capacity) of the current store. | |
| std::size_t | filled () const |
| Returns the number of filled transforms. | |
Static Public Member Functions | |
| static std::string | toString (const Mode m) |
| Define the to string operator. | |
Private Types | |
| using | LazyStorage_t = std::vector<CxxUtils::CachedUniquePtr<Amg::Transform3D>> |
| Abrivation of the backend in the lazy filling mode. | |
| using | TrfVec_t = std::vector<Amg::Transform3D> |
| Abrivate the transform vector. | |
| using | CheckVec_t = std::vector<char> |
| Abrivate the char vector. | |
| using | BlockStorage_t = std::pair<TrfVec_t, CheckVec_t> |
| Abrivation of the continous vector storage. | |
| using | Storage_t = std::variant<LazyStorage_t, BlockStorage_t> |
| Use the std::variant to dynamically switch between the two types. | |
Private Member Functions | |
| std::ostream & | print (std::ostream &ostr) const |
Static Private Member Functions | |
| static Storage_t | initStorage (const DetectorType dType, const Mode mode) noexcept |
| Helper method to instantiate the storage for a given detector type. | |
Private Attributes | |
| Storage_t | m_storage {} |
| DetectorType | m_detType {ActsTrk::DetectorType::UnDefined} |
| The associated detector type. | |
Friends | |
| std::ostream & | operator<< (std::ostream &ostr, const Mode m) |
| std::ostream & | operator<< (std::ostream &ostr, const TransformStore &store) |
| Define the to string ostream operator. | |
The TransformStore provides a central place to outsource the alignable transforms of the sensitive detector elements and the alignable volumes.
For each subdetector, a cache of size N is provided (C.f. the TrfStoreTicketCounter how the cache size is managed). The transform store can be operated either in a LazyFilling mode where the memory is only assigned if the cache slot is actually needed. In this mode, the setTransform mehtod can be called on a const instance. Alternatively, the Store can be operated in Block mode, where tne the memory for N Transforms is allocated at instantiation and can only be filled if a non-const reference is passed
Definition at line 27 of file TransformStore.h.
|
private |
Abrivation of the continous vector storage.
Definition at line 89 of file TransformStore.h.
|
private |
Abrivate the char vector.
Definition at line 87 of file TransformStore.h.
|
private |
Abrivation of the backend in the lazy filling mode.
Definition at line 83 of file TransformStore.h.
|
private |
Use the std::variant to dynamically switch between the two types.
Definition at line 91 of file TransformStore.h.
|
private |
Abrivate the transform vector.
Definition at line 85 of file TransformStore.h.
|
strong |
Enum describing the operation mode of the cache.
| Enumerator | |
|---|---|
| LazyFill | |
| Block | Transforms can be set later during the event processing. Transforms can only be set if the Store is created and non-const. |
Definition at line 30 of file TransformStore.h.
| ActsTrk::detail::TransformStore::TransformStore | ( | const DetectorType | detType, |
| const Mode | m ) |
Constructor.
| detType | Sub detector type to retrieve the information about how much memory needs to be allocated |
| m | Storage mode |
Definition at line 47 of file TransformStore.cxx.
|
defaultnoexcept |
Define the move constructor.
|
noexcept |
Define the copy constructor.
Definition at line 51 of file TransformStore.cxx.
| DetectorType ActsTrk::detail::TransformStore::detectorType | ( | ) | const |
| std::size_t ActsTrk::detail::TransformStore::filled | ( | ) | const |
Returns the number of filled transforms.
Definition at line 131 of file TransformStore.cxx.
|
inline |
Returns the pointer to the transfomation cached in the store (Might be a nullptr if LazyFill is used).
| ticketNo | Unique ticket number drawn by the client indicating the index inside the storegae vector |
Definition at line 139 of file TransformStore.h.
|
staticprivatenoexcept |
Helper method to instantiate the storage for a given detector type.
| dType | Subdetector system for which the transform storage needs to be instantiated |
| mode | The mode in which the storage shall be instantiated |
Definition at line 31 of file TransformStore.cxx.
| TransformStore::Mode ActsTrk::detail::TransformStore::mode | ( | ) | const |
Returns the mode with which the store has been instantiated.
Definition at line 120 of file TransformStore.cxx.
|
noexcept |
Define the copy assignment operator.
Definition at line 63 of file TransformStore.cxx.
|
defaultnoexcept |
Define the move assignment operator.
|
private |
Definition at line 23 of file TransformStore.cxx.
| const Amg::Transform3D & ActsTrk::detail::TransformStore::setTransform | ( | const unsigned int | ticketNo, |
| Amg::Transform3D && | trf ) |
Stores a transform at the index of the passed ticket number.
| ticketNo | Number of the ticket under which the transform should be cached |
| trf | Transform object to be stored |
| const Amg::Transform3D & ActsTrk::detail::TransformStore::setTransform | ( | const unsigned int | ticketNo, |
| Amg::Transform3D && | trf ) const |
Stores a transform at the index of the passed ticket number.
(Only works if the LazyFill mode option is activated)
| ticketNo | Number of the ticket under which the transform should be cached |
| trf | Transform object to be stored |
| std::size_t ActsTrk::detail::TransformStore::size | ( | ) | const |
Return the size (maximum capacity) of the current store.
Definition at line 94 of file TransformStore.cxx.
Define the to string operator.
Definition at line 15 of file TransformStore.cxx.
Definition at line 37 of file TransformStore.h.
|
friend |
Define the to string ostream operator.
Definition at line 41 of file TransformStore.h.
|
private |
The associated detector type.
Definition at line 94 of file TransformStore.h.
|
private |
Definition at line 92 of file TransformStore.h.