LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Container with one element per readout TPC set. More...
#include "ReadoutDataContainers.h"
Public Types | |
using | value_type = typename BaseContainer_t::value_type |
using | Mapper_t = readout::TPCsetIDmapper<> |
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 | 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 | |
TPCsetDataContainer ()=default | |
Default constructor: empty container. More... | |
TPCsetDataContainer (unsigned int nCryo, unsigned int nTPCsets) | |
Prepares the container with default-constructed data. More... | |
TPCsetDataContainer (unsigned int nCryo, unsigned int nTPCsets, value_type const &defValue) | |
Prepares the container with copies of the specified default value. More... | |
Container modification | |
void | resize (unsigned int nCryo, unsigned int nTPCsets) |
Prepares the container with default-constructed data. More... | |
void | resize (unsigned int nCryo, unsigned int nTPCsets, T const &defValue) |
Prepares the container initializing all its data. More... | |
Container status query | |
bool | hasCryostat (readout::CryostatID const &cryoid) const |
Returns whether this container hosts data for the specified cryostat. More... | |
bool | hasTPCset (readout::TPCsetID const &tpcsetid) const |
Returns whether this container hosts data for the specified TPC set. 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... | |
const_iterator | begin () const |
Returns a constant iterator to the beginning of the data. More... | |
iterator | end () |
Returns an iterator to past the end 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_const_iterator | item_begin () const |
Returns a item constant 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_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... | |
Op | apply (Op &&op) |
Applies an operation on all elements. More... | |
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... | |
void | resizeAs (geo::GeoIDdataContainer< OT, Mapper_t > const &other) |
Prepares the container with default-constructed data. More... | |
void | resizeAs (geo::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 | BaseContainer_t = geo::GeoIDdataContainer< T, readout::TPCsetIDmapper<>> |
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... | |
unsigned int | dimSize () const |
Dimensions of the Level dimension of this container. More... | |
bool | hasElement (GeoID const &id) const |
Returns whether this container hosts data for the specified ID. More... | |
GeoID | firstID () const |
Returns the ID of the first element with GeoID type. More... | |
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 readout TPC set.
T | type of the contained datum |
The container is of fixed size and can't be neither resized nor freed before destruction.
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 22 of file ReadoutDataContainers.h.
|
private |
Definition at line 59 of file ReadoutDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 138 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 136 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 134 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 141 of file GeometryDataContainers.h.
|
inherited |
Type used as ID for this container.
Definition at line 127 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 148 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 145 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 137 of file GeometryDataContainers.h.
|
inherited |
Type of mapper between IDs and index.
Definition at line 125 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 135 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 133 of file GeometryDataContainers.h.
|
inherited |
Special iterator dereferencing to pairs ( ID, value ) (see items()
).
Definition at line 142 of file GeometryDataContainers.h.
using readout::TPCsetDataContainer< T >::value_type = typename BaseContainer_t::value_type |
Definition at line 62 of file ReadoutDataContainers.h.
|
default |
|
inline |
Prepares the container with default-constructed data.
nCryo | number of cryostats |
nTPCsets | number of TPC sets |
The container is sized to host data for nCryo
cryostats, each with nTPCsets
TPC sets. Each element in the container is default-constructed.
Definition at line 82 of file ReadoutDataContainers.h.
|
inline |
Prepares the container with copies of the specified default value.
nCryo | number of cryostats |
nTPCsets | number of TPC sets |
defValue | the value to be replicated |
The container is sized to host data for nCryo
cryostats, each with nTPCsets
TPC sets. Each element in the container is a copy of defValue.
Definition at line 100 of file ReadoutDataContainers.h.
|
inherited |
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.
|
inherited |
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.
|
inherited |
Returns the element for the specified geometry element.
std::out_of_range | if element id is not within the container range |
|
inherited |
Returns the element for the specified geometry element (read-only).
std::out_of_range | if element id is not within the container range |
|
inherited |
Returns an iterator to the beginning of the data.
|
inherited |
Returns a constant iterator to the beginning of the data.
|
inherited |
Returns the number of elements the container has memory for.
|
inherited |
Returns a constant iterator to the beginning of the data.
|
inherited |
Returns a constant iterator to past the end of the data.
|
inherited |
Makes the container empty, with no usable storage space.
resize()
The container needs to be resized before it is useful again.
|
staticinherited |
Dimensions of the ID of this container.
|
inherited |
Dimensions of the Level
dimension of this container.
|
inherited |
Returns whether the container has no elements (false
by assumptions).
|
inherited |
Returns an iterator to past the end of the data.
|
inherited |
Returns a constant iterator to past the end of the data.
|
inherited |
Sets all elements to the specified value
(copied).
|
inherited |
Returns the element for the first ID (unchecked).
|
inherited |
Returns the element for the first ID (unchecked).
|
inherited |
Returns the ID of the first element with GeoID type.
|
inline |
Returns whether this container hosts data for the specified cryostat.
Definition at line 155 of file ReadoutDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::hasElement().
|
inherited |
Returns whether this container hosts data for the specified ID.
|
inline |
Returns whether this container hosts data for the specified TPC set.
Definition at line 161 of file ReadoutDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::hasElement().
|
inherited |
Returns an item iterator to the beginning of the data.
|
inherited |
Returns a item constant iterator to the beginning of the data.
|
inherited |
Returns a item constant iterator to the beginning of the data.
|
inherited |
Returns a item constant iterator to past the end of the data.
|
inherited |
Returns an item iterator to past the end of the data.
|
inherited |
Returns a item constant iterator to past the end of the data.
|
inherited |
Returns an object suitable for a range-for loop with item_iterator
.
|
inherited |
Returns an object suitable for a range-for loop with item_const_iterator
.
|
inherited |
Returns the element for the last ID (unchecked).
|
inherited |
Returns the element for the last ID (unchecked).
|
inherited |
Returns the ID of the last covered element with GeoID type.
|
inherited |
Returns the mapper object used to convert ID's and container positions.
|
inherited |
Returns the element for the specified geometry element.
|
inherited |
Returns the element for the specified geometry element (read-only).
|
inherited |
Sets all the elements to a default-constructed value_type
.
|
inline |
Prepares the container with default-constructed data.
nCryo | number of cryostats |
nTPCsets | number of TPC sets |
The container is sized to host data for nCryo
cryostats, each with nTPCsets
TPC sets. Each 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 120 of file ReadoutDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::resize().
|
inline |
Prepares the container initializing all its data.
nCryo | number of cryostats |
nTPCsets | number of TPC sets |
defValue | the value copied to fill all entries in the container |
The container is sized to host data for nCryo
cryostats, each with nTPCsets
TPC sets. Each element in the container is a copy of defValue
.
Existing data is not touched, but it may be rearranged in a non-straightforward way.
Definition at line 142 of file ReadoutDataContainers.h.
References geo::GeoIDdataContainer< T, Mapper >::resize().
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
Returns the number of elements in the container.