![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
Container with one element per geometry TPC. More...
#include "GeometryDataContainers.h"
Classes | |
struct | IDextractor |
Functor to extract an ID data member. More... | |
Public Types | |
using | Mapper_t = Mapper |
Type of mapper between IDs and index. More... | |
using | ID_t = typename Mapper_t::ID_t |
Type used as ID for this container. More... | |
STL container types. | |
using | value_type = typename Container_t::value_type |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | reference = typename Container_t::reference |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | const_reference = typename Container_t::const_reference |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | pointer = typename Container_t::pointer |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | const_pointer = typename Container_t::const_pointer |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | iterator = details::GeoIDdataContainerIterator< Mapper_t, BaseIter_t > |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | const_iterator = details::GeoIDdataContainerIterator< Mapper_t, BaseConstIter_t > |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | difference_type = typename Container_t::difference_type |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | size_type = typename Container_t::size_type |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | item_iterator = details::GeoIDdataContainerItemIterator< iterator > |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
using | item_const_iterator = details::GeoIDdataContainerItemIterator< const_iterator > |
Special iterator dereferencing to pairs ( ID, value ) (see items() ). More... | |
Public Member Functions | |
GeoIDdataContainer ()=default | |
Default constructor: container has no room at all. More... | |
GeoIDdataContainer (std::initializer_list< unsigned int > dims) | |
Prepares the container with default-constructed data. More... | |
GeoIDdataContainer (std::initializer_list< unsigned int > dims, value_type const &defValue) | |
Prepares the container initializing all its data. More... | |
Element access | |
reference | operator[] (ID_t const &id) |
Returns the element for the specified geometry element. More... | |
const_reference | operator[] (ID_t const &id) const |
Returns the element for the specified geometry element (read-only). More... | |
reference | at (ID_t const &id) |
const_reference | at (ID_t const &id) const |
reference | first () |
Returns the element for the first ID (unchecked). More... | |
const_reference | first () const |
Returns the element for the first ID (unchecked). More... | |
reference | last () |
Returns the element for the last ID (unchecked). More... | |
const_reference | last () const |
Returns the element for the last ID (unchecked). More... | |
Iterators | |
Two types of iterators are provided:
Reverse iterators are not supported (yet?). Standard iteratorsThe STL-like interface provides iterators that go through the entire range of allowed data, i.e. all the These iterators have an interface extension: the data member auto iData = data.begin(); auto const dend = data.end(); while (iData != dend) { std::cout << "data[" << iData.ID() << "] = " << *iData << std::endl; ++iData; } // while Note that using the range-for loop, you don't get access to the iterator and therefore not even to the ID. Item iteratorsThe item iterators are iterators adapted from the standard ones, which when dereferenced return a pair ( } (this loop has the same effect as the one in the example of the standard iterators, but it's more compact). | |
iterator | begin () |
Returns an iterator to the beginning of the data. More... | |
iterator | end () |
Returns an iterator to past the end of the data. More... | |
const_iterator | begin () const |
Returns a constant iterator to the beginning of the data. More... | |
const_iterator | end () const |
Returns a constant iterator to past the end of the data. More... | |
const_iterator | cbegin () const |
Returns a constant iterator to the beginning of the data. More... | |
const_iterator | cend () const |
Returns a constant iterator to past the end of the data. More... | |
item_iterator | item_begin () |
Returns an item iterator to the beginning of the data. More... | |
item_iterator | item_end () |
Returns an item iterator to past the end of the data. More... | |
item_const_iterator | item_begin () const |
Returns a item constant iterator to the beginning of the data. More... | |
item_const_iterator | item_end () const |
Returns a item constant iterator to past the end of the data. More... | |
item_const_iterator | item_cbegin () const |
Returns a item constant iterator to the beginning of the data. More... | |
item_const_iterator | item_cend () const |
Returns a item constant iterator to past the end of the data. More... | |
auto | items () |
Returns an object suitable for a range-for loop with item_iterator . More... | |
auto | items () const |
Returns an object suitable for a range-for loop with item_const_iterator . More... | |
Data modification | |
In general, each single element can be accessed and changed. In addition, this section includes methods acting on multiple elements at once. | |
void | fill (value_type value) |
Sets all elements to the specified value (copied). More... | |
void | reset () |
Sets all the elements to a default-constructed value_type . More... | |
template<typename Op > | |
Op | apply (Op &&op) |
Applies an operation on all elements. More... | |
template<typename Op > | |
decltype(auto) | apply (Op &&op) const |
Applies an operation on all elements. More... | |
Container modification | |
void | resize (std::initializer_list< unsigned int > dims) |
Prepares the container with default-constructed data. More... | |
void | resize (std::initializer_list< unsigned int > dims, value_type const &defValue) |
Prepares the container initializing all its data. More... | |
template<typename OT > | |
void | resizeAs (GeoIDdataContainer< OT, Mapper_t > const &other) |
Prepares the container with default-constructed data. More... | |
template<typename OT > | |
void | resizeAs (GeoIDdataContainer< OT, Mapper_t > const &other, value_type const &defValue) |
Prepares the container initializing all its data. More... | |
void | clear () |
Makes the container empty, with no usable storage space. More... | |
Private Types | |
using | This_t = GeoIDdataContainer< T, Mapper > |
Type of this class. More... | |
using | Container_t = details::GeoContainerData< T > |
Type of data container helper. More... | |
using | BaseIter_t = typename Container_t::iterator |
Type of iterator to the data. More... | |
using | BaseConstIter_t = typename Container_t::const_iterator |
Type of constant iterator to the data. More... | |
Private Member Functions | |
size_type | index (ID_t const &id) const |
Returns the internal index of the specified ID in the storage area. More... | |
ID_t | ID (size_type const index) const |
Returns the ID corresponding to a internal index in the storage area. More... | |
Private Attributes | |
Mapper_t | fMapper |
Mapping of IDs to indices. More... | |
Container_t | fData |
Data storage. More... | |
Container status query | |
size_type | size () const |
Returns the number of elements in the container. More... | |
size_type | capacity () const |
Returns the number of elements the container has memory for. More... | |
bool | empty () const |
Returns whether the container has no elements (false by assumptions). More... | |
template<std::size_t Level> | |
unsigned int | dimSize () const |
Dimensions of the Level dimension of this container. More... | |
template<typename GeoID > | |
bool | hasElement (GeoID const &id) const |
Returns whether this container hosts data for the specified ID. More... | |
template<typename GeoID = ID_t> | |
GeoID | firstID () const |
Returns the ID of the first element with GeoID type. More... | |
template<typename GeoID = ID_t> | |
GeoID | lastID () const |
Returns the ID of the last covered element with GeoID type. More... | |
Mapper_t const & | mapper () const |
Returns the mapper object used to convert ID's and container positions. More... | |
static constexpr unsigned int | dimensions () |
Dimensions of the ID of this container. More... | |
Container with one element per geometry TPC.
T | type of the contained datum |
geo::GeometryCore::makeTPCData
The container is of fixed size and can't be neither resized nor freed before destruction.
This example creates a "map" of tracks starting on each TPC:
The following assumptions should be considered unchecked, and the behavior when they are violated undefined (but note that in debug mode some of them might be actually checked):
Definition at line 32 of file GeometryDataContainers.h.
|
private |
Type of constant iterator to the data.
Definition at line 109 of file GeometryDataContainers.h.
|
private |
Type of iterator to the data.
Definition at line 106 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::const_iterator = details::GeoIDdataContainerIterator<Mapper_t, BaseConstIter_t> |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 135 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::const_pointer = typename Container_t::const_pointer |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 133 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::const_reference = typename Container_t::const_reference |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 131 of file GeometryDataContainers.h.
|
private |
Type of data container helper.
Definition at line 103 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::difference_type = typename Container_t::difference_type |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 136 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::ID_t = typename Mapper_t::ID_t |
Type used as ID for this container.
Definition at line 124 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::item_const_iterator = details::GeoIDdataContainerItemIterator<const_iterator> |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 143 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::item_iterator = details::GeoIDdataContainerItemIterator<iterator> |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 140 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::iterator = details::GeoIDdataContainerIterator<Mapper_t, BaseIter_t> |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 134 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::Mapper_t = Mapper |
Type of mapper between IDs and index.
Definition at line 122 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::pointer = typename Container_t::pointer |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 132 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::reference = typename Container_t::reference |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 130 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::size_type = typename Container_t::size_type |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 137 of file GeometryDataContainers.h.
|
private |
Type of this class.
Definition at line 100 of file GeometryDataContainers.h.
using geo::GeoIDdataContainer< T, Mapper >::value_type = typename Container_t::value_type |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 129 of file GeometryDataContainers.h.
|
default |
Default constructor: container has no room at all.
resize()
The object must be resized before being of any use.
geo::GeoIDdataContainer< T, Mapper >::GeoIDdataContainer | ( | std::initializer_list< unsigned int > | dims | ) |
Prepares the container with default-constructed data.
dims | number of elements on all levels of the container |
resize()
The size of each dimension is specified by the corresponding number, starting from the size of the outer dimension (cryostat).
The container is sized to host data for all the elements. Each element in the container is default-constructed.
Definition at line 1147 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::empty(), and geo::GeoIDdataContainer< T, Mapper >::fData.
geo::GeoIDdataContainer< T, Mapper >::GeoIDdataContainer | ( | std::initializer_list< unsigned int > | dims, |
value_type const & | defValue | ||
) |
Prepares the container initializing all its data.
dims | number of elements on all levels of the container |
defValue | the value copied to fill all entries in the container |
resize()
The size of each dimension is specified by the corresponding number, starting from the size of the outer dimension (cryostat).
The container is sized to host data for all the elements. Each element in the container is constructed as copy of defValue
.
Definition at line 1155 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::empty(), and geo::GeoIDdataContainer< T, Mapper >::fData.
Op geo::GeoIDdataContainer< T, Mapper >::apply | ( | Op && | op | ) |
Applies an operation on all elements.
Op | type of operation |
op | Operation |
The operation op
is a unary functor, i.e. an object that supports the call to op(value_type&)
.
The return values of op
calls are discarded.
Definition at line 1402 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::apply(), and geo::GeoIDdataContainer< T, Mapper >::fData.
Referenced by geo::GeoIDdataContainer< T, Mapper >::clear().
decltype(auto) geo::GeoIDdataContainer< T, Mapper >::apply | ( | Op && | op | ) | const |
Applies an operation on all elements.
Op | type of operation |
op | Operation |
The operation op
is a unary functor, i.e. an object that supports the call to op(value_type const&)
.
The return values of op
calls are discarded. Note that while the elements of this container can't be modified, the operation itself still can if not constant, and it is returned.
auto geo::GeoIDdataContainer< T, Mapper >::at | ( | ID_t const & | id | ) |
Returns the element for the specified geometry element.
std::out_of_range | if element id is not within the container range |
Definition at line 1245 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::hasElement(), and geo::GeoIDdataContainer< T, Mapper >::operator[]().
auto geo::GeoIDdataContainer< T, Mapper >::at | ( | ID_t const & | id | ) | const |
Returns the element for the specified geometry element (read-only).
std::out_of_range | if element id is not within the container range |
Definition at line 1253 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::hasElement(), and geo::GeoIDdataContainer< T, Mapper >::operator[]().
auto geo::GeoIDdataContainer< T, Mapper >::begin | ( | ) |
Returns an iterator to the beginning of the data.
Definition at line 1289 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::begin(), geo::GeoIDdataContainer< T, Mapper >::fData, and geo::GeoIDdataContainer< T, Mapper >::mapper().
Referenced by geo::GeoIDdataContainer< T, Mapper >::cbegin(), and geo::GeoIDdataContainer< T, Mapper >::item_begin().
auto geo::GeoIDdataContainer< T, Mapper >::begin | ( | ) | const |
Returns a constant iterator to the beginning of the data.
Definition at line 1303 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::begin(), geo::GeoIDdataContainer< T, Mapper >::fData, and geo::GeoIDdataContainer< T, Mapper >::mapper().
auto geo::GeoIDdataContainer< T, Mapper >::capacity | ( | ) | const |
Returns the number of elements the container has memory for.
Definition at line 1171 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::capacity(), and geo::GeoIDdataContainer< T, Mapper >::fData.
auto geo::GeoIDdataContainer< T, Mapper >::cbegin | ( | ) | const |
Returns a constant iterator to the beginning of the data.
Definition at line 1317 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::begin().
auto geo::GeoIDdataContainer< T, Mapper >::cend | ( | ) | const |
Returns a constant iterator to past the end of the data.
Definition at line 1324 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::end().
void geo::GeoIDdataContainer< T, Mapper >::clear | ( | ) |
Makes the container empty, with no usable storage space.
resize()
The container needs to be resized before it is useful again.
Definition at line 1445 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::apply(), geo::details::GeoContainerData< T >::apply(), geo::details::GeoContainerData< T >::clear(), geo::GeoIDdataContainer< T, Mapper >::fData, and geo::GeoIDdataContainer< T, Mapper >::fMapper.
|
static |
Dimensions of the ID of this container.
Definition at line 1193 of file GeometryDataContainers.h.
unsigned int geo::GeoIDdataContainer< T, Mapper >::dimSize | ( | ) | const |
Dimensions of the Level
dimension of this container.
Definition at line 1186 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::mapper().
bool geo::GeoIDdataContainer< T, Mapper >::empty | ( | ) | const |
Returns whether the container has no elements (false
by assumptions).
Definition at line 1178 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::empty(), and geo::GeoIDdataContainer< T, Mapper >::fData.
auto geo::GeoIDdataContainer< T, Mapper >::end | ( | ) |
Returns an iterator to past the end of the data.
Definition at line 1296 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::begin(), geo::details::GeoContainerData< T >::end(), geo::GeoIDdataContainer< T, Mapper >::fData, and geo::GeoIDdataContainer< T, Mapper >::mapper().
Referenced by geo::GeoIDdataContainer< T, Mapper >::cend(), and geo::GeoIDdataContainer< T, Mapper >::item_end().
auto geo::GeoIDdataContainer< T, Mapper >::end | ( | ) | const |
Returns a constant iterator to past the end of the data.
Definition at line 1310 of file GeometryDataContainers.h.
References geo::details::GeoContainerData< T >::begin(), geo::details::GeoContainerData< T >::end(), geo::GeoIDdataContainer< T, Mapper >::fData, and geo::GeoIDdataContainer< T, Mapper >::mapper().
void geo::GeoIDdataContainer< T, Mapper >::fill | ( | value_type | value | ) |
Sets all elements to the specified value
(copied).
Definition at line 1387 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, and geo::details::GeoContainerData< T >::fill().
auto geo::GeoIDdataContainer< T, Mapper >::first | ( | ) |
Returns the element for the first ID (unchecked).
Definition at line 1261 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::firstID(), and geo::GeoIDdataContainer< T, Mapper >::operator[]().
auto geo::GeoIDdataContainer< T, Mapper >::first | ( | ) | const |
Returns the element for the first ID (unchecked).
Definition at line 1268 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::firstID(), and geo::GeoIDdataContainer< T, Mapper >::operator[]().
GeoID geo::GeoIDdataContainer< T, Mapper >::firstID | ( | ) | const |
Returns the ID of the first element with GeoID type.
Definition at line 1209 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::mapper().
Referenced by geo::GeoIDdataContainer< T, Mapper >::first().
bool geo::GeoIDdataContainer< T, Mapper >::hasElement | ( | GeoID const & | id | ) | const |
Returns whether this container hosts data for the specified ID.
Definition at line 1201 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::mapper().
Referenced by geo::GeoIDdataContainer< T, Mapper >::at(), readout::TPCsetDataContainer< T >::hasCryostat(), readout::ROPDataContainer< T >::hasCryostat(), readout::ROPDataContainer< T >::hasROP(), readout::TPCsetDataContainer< T >::hasTPCset(), and readout::ROPDataContainer< T >::hasTPCset().
|
private |
Returns the ID corresponding to a internal index in the storage area.
Definition at line 1468 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::index(), and geo::GeoIDdataContainer< T, Mapper >::mapper().
|
private |
Returns the internal index of the specified ID in the storage area.
Definition at line 1461 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::mapper().
Referenced by geo::GeoIDdataContainer< T, Mapper >::ID().
auto geo::GeoIDdataContainer< T, Mapper >::item_begin | ( | ) |
Returns an item iterator to the beginning of the data.
Definition at line 1331 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::begin().
Referenced by geo::GeoIDdataContainer< T, Mapper >::item_cbegin(), and geo::GeoIDdataContainer< T, Mapper >::items().
auto geo::GeoIDdataContainer< T, Mapper >::item_begin | ( | ) | const |
Returns a item constant iterator to the beginning of the data.
Definition at line 1345 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::begin().
auto geo::GeoIDdataContainer< T, Mapper >::item_cbegin | ( | ) | const |
Returns a item constant iterator to the beginning of the data.
Definition at line 1359 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::item_begin().
auto geo::GeoIDdataContainer< T, Mapper >::item_cend | ( | ) | const |
Returns a item constant iterator to past the end of the data.
Definition at line 1366 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::item_end().
auto geo::GeoIDdataContainer< T, Mapper >::item_end | ( | ) |
Returns an item iterator to past the end of the data.
Definition at line 1338 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::end().
Referenced by geo::GeoIDdataContainer< T, Mapper >::item_cend(), and geo::GeoIDdataContainer< T, Mapper >::items().
auto geo::GeoIDdataContainer< T, Mapper >::item_end | ( | ) | const |
Returns a item constant iterator to past the end of the data.
Definition at line 1352 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::end().
auto geo::GeoIDdataContainer< T, Mapper >::items | ( | ) |
Returns an object suitable for a range-for loop with item_iterator
.
Definition at line 1373 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::item_begin(), and geo::GeoIDdataContainer< T, Mapper >::item_end().
auto geo::GeoIDdataContainer< T, Mapper >::items | ( | ) | const |
Returns an object suitable for a range-for loop with item_const_iterator
.
Definition at line 1380 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::item_begin(), and geo::GeoIDdataContainer< T, Mapper >::item_end().
auto geo::GeoIDdataContainer< T, Mapper >::last | ( | ) |
Returns the element for the last ID (unchecked).
Definition at line 1275 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::lastID(), and geo::GeoIDdataContainer< T, Mapper >::operator[]().
auto geo::GeoIDdataContainer< T, Mapper >::last | ( | ) | const |
Returns the element for the last ID (unchecked).
Definition at line 1282 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::lastID(), and geo::GeoIDdataContainer< T, Mapper >::operator[]().
GeoID geo::GeoIDdataContainer< T, Mapper >::lastID | ( | ) | const |
Returns the ID of the last covered element with GeoID type.
Definition at line 1217 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::mapper().
Referenced by geo::GeoIDdataContainer< T, Mapper >::last().
auto geo::GeoIDdataContainer< T, Mapper >::mapper | ( | ) | const |
Returns the mapper object used to convert ID's and container positions.
Definition at line 1224 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fMapper.
Referenced by geo::GeoIDdataContainer< T, Mapper >::begin(), geo::GeoIDdataContainer< T, Mapper >::dimSize(), geo::GeoIDdataContainer< T, Mapper >::end(), geo::GeoIDdataContainer< T, Mapper >::firstID(), geo::GeoIDdataContainer< T, Mapper >::hasElement(), geo::GeoIDdataContainer< T, Mapper >::ID(), geo::GeoIDdataContainer< T, Mapper >::index(), geo::GeoIDdataContainer< T, Mapper >::lastID(), geo::GeoIDdataContainer< T, Mapper >::operator[](), geo::GeoIDdataContainer< T, Mapper >::resize(), and geo::GeoIDdataContainer< T, Mapper >::resizeAs().
auto geo::GeoIDdataContainer< T, Mapper >::operator[] | ( | ID_t const & | id | ) |
Returns the element for the specified geometry element.
Definition at line 1231 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, and geo::GeoIDdataContainer< T, Mapper >::mapper().
Referenced by geo::GeoIDdataContainer< T, Mapper >::at(), geo::GeoIDdataContainer< T, Mapper >::first(), and geo::GeoIDdataContainer< T, Mapper >::last().
auto geo::GeoIDdataContainer< T, Mapper >::operator[] | ( | ID_t const & | id | ) | const |
Returns the element for the specified geometry element (read-only).
Definition at line 1238 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, and geo::GeoIDdataContainer< T, Mapper >::mapper().
void geo::GeoIDdataContainer< T, Mapper >::reset | ( | ) |
Sets all the elements to a default-constructed value_type
.
Definition at line 1394 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, and geo::details::GeoContainerData< T >::reset().
void geo::GeoIDdataContainer< T, Mapper >::resize | ( | std::initializer_list< unsigned int > | dims | ) |
Prepares the container with default-constructed data.
dims | number of elements on all levels of the container |
The size of each dimension is specified by the corresponding number, starting from the size of the outer dimension (cryostat).
The container is sized to host data for all the elements. Each new element in the container is default-constructed. Existing data is not touched, but it may be rearranged in a non-straightforward way.
Definition at line 1409 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, geo::GeoIDdataContainer< T, Mapper >::fMapper, geo::GeoIDdataContainer< T, Mapper >::mapper(), geo::details::GeoContainerData< T >::resize(), and geo::GeoIDdataContainer< T, Mapper >::size().
Referenced by readout::TPCsetDataContainer< T >::resize(), and readout::ROPDataContainer< T >::resize().
void geo::GeoIDdataContainer< T, Mapper >::resize | ( | std::initializer_list< unsigned int > | dims, |
value_type const & | defValue | ||
) |
Prepares the container initializing all its data.
dims | number of elements on all levels of the container |
defValue | the value copied to fill all entries in the container |
The size of each dimension is specified by the corresponding number, starting from the size of the outer dimension (cryostat).
The container is sized to host data for all the elements. Each new element in the container is constructed as copy of defValue
. Existing data is not touched, but it may be rearranged in a non-straightforward way.
Definition at line 1417 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, geo::GeoIDdataContainer< T, Mapper >::fMapper, geo::GeoIDdataContainer< T, Mapper >::mapper(), geo::details::GeoContainerData< T >::resize(), and geo::GeoIDdataContainer< T, Mapper >::size().
void geo::GeoIDdataContainer< T, Mapper >::resizeAs | ( | GeoIDdataContainer< OT, Mapper_t > const & | other | ) |
Prepares the container with default-constructed data.
other | data collection to take dimensions from |
The size of each dimension is taken by the matching one in other
.
The container is sized to host data for all the elements. Each new element in the container is default-constructed. Existing data is not touched, but it may be rearranged in a non-straightforward way.
Definition at line 1427 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, geo::GeoIDdataContainer< T, Mapper >::fMapper, geo::GeoIDdataContainer< T, Mapper >::mapper(), geo::details::GeoContainerData< T >::resize(), and geo::GeoIDdataContainer< T, Mapper >::size().
void geo::GeoIDdataContainer< T, Mapper >::resizeAs | ( | GeoIDdataContainer< OT, Mapper_t > const & | other, |
value_type const & | defValue | ||
) |
Prepares the container initializing all its data.
other | data collection to take dimensions from |
defValue | the value copied to fill all entries in the container |
The size of each dimension is taken by the matching one in other
.
The container is sized to host data for all the elements. Each new element in the container is constructed as copy of defValue
. Existing data is not touched, but it may be rearranged in a non-straightforward way.
Definition at line 1436 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, geo::GeoIDdataContainer< T, Mapper >::fMapper, geo::GeoIDdataContainer< T, Mapper >::mapper(), geo::details::GeoContainerData< T >::resize(), and geo::GeoIDdataContainer< T, Mapper >::size().
auto geo::GeoIDdataContainer< T, Mapper >::size | ( | ) | const |
Returns the number of elements in the container.
Definition at line 1164 of file GeometryDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::fData, and geo::details::GeoContainerData< T >::size().
Referenced by geo::GeoIDdataContainer< T, Mapper >::resize(), and geo::GeoIDdataContainer< T, Mapper >::resizeAs().
|
private |
Data storage.
Definition at line 476 of file GeometryDataContainers.h.
Referenced by geo::GeoIDdataContainer< T, Mapper >::apply(), geo::GeoIDdataContainer< T, Mapper >::begin(), geo::GeoIDdataContainer< T, Mapper >::capacity(), geo::GeoIDdataContainer< T, Mapper >::clear(), geo::GeoIDdataContainer< T, Mapper >::empty(), geo::GeoIDdataContainer< T, Mapper >::end(), geo::GeoIDdataContainer< T, Mapper >::fill(), geo::GeoIDdataContainer< T, Mapper >::GeoIDdataContainer(), geo::GeoIDdataContainer< T, Mapper >::operator[](), geo::GeoIDdataContainer< T, Mapper >::reset(), geo::GeoIDdataContainer< T, Mapper >::resize(), geo::GeoIDdataContainer< T, Mapper >::resizeAs(), and geo::GeoIDdataContainer< T, Mapper >::size().
|
private |
Mapping of IDs to indices.
Definition at line 474 of file GeometryDataContainers.h.
Referenced by geo::GeoIDdataContainer< T, Mapper >::clear(), geo::GeoIDdataContainer< T, Mapper >::mapper(), geo::GeoIDdataContainer< T, Mapper >::resize(), and geo::GeoIDdataContainer< T, Mapper >::resizeAs().