LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Container with one element per geometry TPC. More...
#include "GeometryDataContainers.h"
Public Types | |
STL container types. | |
using | reference = typename Container_t::reference |
using | const_reference = typename Container_t::const_reference |
using | pointer = typename Container_t::pointer |
using | const_pointer = typename Container_t::const_pointer |
using | iterator = typename Container_t::iterator |
using | const_iterator = typename Container_t::const_iterator |
using | reverse_iterator = typename Container_t::reverse_iterator |
using | const_reverse_iterator = typename Container_t::const_reverse_iterator |
using | difference_type = typename Container_t::difference_type |
using | size_type = typename Container_t::size_type |
Public Member Functions | |
TPCDataContainer (unsigned int nCryo, unsigned int nTPCs) | |
Prepares the container with default-constructed data. More... | |
TPCDataContainer (unsigned int nCryo, unsigned int nTPCs, T const &defValue) | |
Prepares the container with copies of the specified default value. 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... | |
bool | hasCryostat (geo::CryostatID const &cryoid) const |
Returns whether this container hosts data for the specified cryostat. More... | |
bool | hasTPC (geo::TPCID const &id) const |
Returns whether this container hosts data for the specified TPC. More... | |
geo::TPCID | firstID () const |
Returns the ID of the first TPC. More... | |
geo::TPCID | lastID () const |
Returns the ID of the last covered TPC. More... | |
Element access | |
reference | operator[] (geo::TPCID const &id) |
Returns the element for the specified TPC. More... | |
const_reference | operator[] (geo::TPCID const &id) const |
Returns the element for the specified TPC (read-only). More... | |
reference | at (geo::TPCID const &id) |
const_reference | at (geo::TPCID const &id) const |
reference | first () |
Returns the element for the first TPC (unchecked). More... | |
const_reference | first () const |
Returns the element for the first TPC (unchecked). More... | |
reference | last () |
Returns the element for the last TPC (unchecked). More... | |
const_reference | last () const |
Returns the element for the last TPC (unchecked). More... | |
Private Types | |
using | Container_t = std::vector< T > |
using | CryostatNo_t = geo::CryostatID::CryostatID_t |
using | TPCNo_t = geo::TPCID::TPCID_t |
Private Member Functions | |
size_type | index (CryostatNo_t cryo, TPCNo_t tpc) const |
Returns the internal index of the specified TPC in the storage area. More... | |
size_type | index (geo::TPCID const &id) const |
Returns the internal index of the specified TPC in the storage area. More... | |
geo::TPCID | ID (size_type index) const |
Returns the ID of the TPC at the specified index (unchecked!) More... | |
size_type | computeSize () const |
Computes the expected size of this container. More... | |
Static Private Member Functions | |
static size_type | computeSize (CryostatNo_t nCryo, TPCNo_t nTPCs) |
Returns the size of a container with the specified dimensions. More... | |
template<typename Value , typename Upper > | |
static bool | bounded (Value v, Upper upper) |
Returns whether the specified value is between 0 and the upper limit. More... | |
Private Attributes | |
CryostatNo_t | fNCryo |
Number of cryostats. More... | |
TPCNo_t | fNTPCs |
Number of TPCs. More... | |
Container_t | fData |
Data storage area. 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 65 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::const_iterator = typename Container_t::const_iterator |
Definition at line 81 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::const_pointer = typename Container_t::const_pointer |
Definition at line 79 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::const_reference = typename Container_t::const_reference |
Definition at line 77 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::const_reverse_iterator = typename Container_t::const_reverse_iterator |
Definition at line 83 of file GeometryDataContainers.h.
|
private |
Definition at line 67 of file GeometryDataContainers.h.
|
private |
Definition at line 203 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::difference_type = typename Container_t::difference_type |
Definition at line 84 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::iterator = typename Container_t::iterator |
Definition at line 80 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::pointer = typename Container_t::pointer |
Definition at line 78 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::reference = typename Container_t::reference |
Definition at line 76 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::reverse_iterator = typename Container_t::reverse_iterator |
Definition at line 82 of file GeometryDataContainers.h.
using geo::TPCDataContainer< T >::size_type = typename Container_t::size_type |
Definition at line 85 of file GeometryDataContainers.h.
|
private |
Definition at line 204 of file GeometryDataContainers.h.
|
inline |
Prepares the container with default-constructed data.
nCryo | number of cryostats |
nTPCs | number of TPCs |
The container is sized to host data for nCryo
cryostats, each with nTPCs
TPCs. Each element in the container is default-constructed.
Definition at line 97 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::empty().
|
inline |
Prepares the container with copies of the specified default value.
nCryo | number of cryostats |
nTPCs | number of TPCs |
defValue | the value to be replicated |
The container is sized to host data for nCryo
cryostats, each with nTPCs
TPCs. Each element in the container is a copy of defValue.
Definition at line 119 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::empty().
|
inline |
Returns the element for the specified TPC.
std::out_of_range | if the TPC id is not within the container range |
Definition at line 171 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::hasTPC(), and geo::TPCDataContainer< T >::operator[]().
|
inline |
Returns the element for the specified TPC (read-only).
std::out_of_range | if the TPC id is not within the container range |
Definition at line 179 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::hasTPC(), and geo::TPCDataContainer< T >::operator[]().
|
inlinestaticprivate |
Returns whether the specified value is between 0
and the upper limit.
Definition at line 232 of file GeometryDataContainers.h.
Referenced by geo::TPCDataContainer< T >::hasCryostat(), geo::PlaneDataContainer< T >::hasCryostat(), geo::PlaneDataContainer< T >::hasPlane(), geo::TPCDataContainer< T >::hasTPC(), and geo::PlaneDataContainer< T >::hasTPC().
|
inline |
Returns the number of elements the container has memory for.
Definition at line 134 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData.
|
inlineprivate |
Computes the expected size of this container.
Definition at line 224 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::computeSize().
Referenced by geo::TPCDataContainer< T >::computeSize(), and geo::PlaneDataContainer< T >::computeSize().
|
inlinestaticprivate |
Returns the size of a container with the specified dimensions.
Definition at line 227 of file GeometryDataContainers.h.
|
inline |
Returns whether the container has no elements (false
by assumptions).
Definition at line 137 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData.
Referenced by geo::PlaneDataContainer< T >::PlaneDataContainer(), and geo::TPCDataContainer< T >::TPCDataContainer().
|
inline |
Returns the element for the first TPC (unchecked).
Definition at line 187 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::firstID(), and geo::TPCDataContainer< T >::operator[]().
|
inline |
Returns the element for the first TPC (unchecked).
Definition at line 190 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::firstID(), and geo::TPCDataContainer< T >::operator[]().
|
inline |
Returns the ID of the first TPC.
Definition at line 148 of file GeometryDataContainers.h.
Referenced by geo::TPCDataContainer< T >::first(), and geo::PlaneDataContainer< T >::first().
|
inline |
Returns whether this container hosts data for the specified cryostat.
Definition at line 140 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::bounded(), geo::CryostatID::Cryostat, and geo::TPCDataContainer< T >::fNCryo.
Referenced by geo::TPCDataContainer< T >::hasTPC(), and geo::PlaneDataContainer< T >::hasTPC().
|
inline |
Returns whether this container hosts data for the specified TPC.
Definition at line 144 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::bounded(), geo::TPCDataContainer< T >::fNTPCs, and geo::TPCDataContainer< T >::hasCryostat().
Referenced by geo::TPCDataContainer< T >::at(), and geo::PlaneDataContainer< T >::hasPlane().
|
inlineprivate |
Returns the ID of the TPC at the specified index (unchecked!)
Definition at line 220 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fNCryo.
|
inlineprivate |
Returns the internal index of the specified TPC in the storage area.
Definition at line 212 of file GeometryDataContainers.h.
Referenced by geo::TPCDataContainer< T >::index(), geo::PlaneDataContainer< T >::index(), geo::TPCDataContainer< T >::operator[](), and geo::PlaneDataContainer< T >::operator[]().
|
inlineprivate |
Returns the internal index of the specified TPC in the storage area.
Definition at line 216 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::index().
|
inline |
Returns the element for the last TPC (unchecked).
Definition at line 194 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::lastID(), and geo::TPCDataContainer< T >::operator[]().
|
inline |
Returns the element for the last TPC (unchecked).
Definition at line 197 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::lastID(), and geo::TPCDataContainer< T >::operator[]().
|
inline |
Returns the ID of the last covered TPC.
Definition at line 151 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fNCryo, and geo::TPCDataContainer< T >::fNTPCs.
Referenced by geo::TPCDataContainer< T >::last(), and geo::PlaneDataContainer< T >::last().
|
inline |
Returns the element for the specified TPC.
Definition at line 162 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData, and geo::TPCDataContainer< T >::index().
Referenced by geo::TPCDataContainer< T >::at(), geo::PlaneDataContainer< T >::at(), geo::TPCDataContainer< T >::first(), geo::PlaneDataContainer< T >::first(), geo::TPCDataContainer< T >::last(), and geo::PlaneDataContainer< T >::last().
|
inline |
Returns the element for the specified TPC (read-only).
Definition at line 166 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData, and geo::TPCDataContainer< T >::index().
|
inline |
Returns the number of elements in the container.
Definition at line 131 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData.
|
private |
Data storage area.
Definition at line 209 of file GeometryDataContainers.h.
Referenced by geo::TPCDataContainer< T >::capacity(), geo::PlaneDataContainer< T >::capacity(), geo::TPCDataContainer< T >::empty(), geo::PlaneDataContainer< T >::empty(), geo::TPCDataContainer< T >::operator[](), geo::PlaneDataContainer< T >::operator[](), geo::TPCDataContainer< T >::size(), and geo::PlaneDataContainer< T >::size().
|
private |
Number of cryostats.
Definition at line 206 of file GeometryDataContainers.h.
Referenced by geo::TPCDataContainer< T >::hasCryostat(), geo::PlaneDataContainer< T >::hasCryostat(), geo::TPCDataContainer< T >::ID(), geo::PlaneDataContainer< T >::ID(), geo::TPCDataContainer< T >::lastID(), and geo::PlaneDataContainer< T >::lastID().
|
private |
Number of TPCs.
Definition at line 207 of file GeometryDataContainers.h.
Referenced by geo::TPCDataContainer< T >::hasTPC(), geo::PlaneDataContainer< T >::hasTPC(), geo::TPCDataContainer< T >::lastID(), and geo::PlaneDataContainer< T >::lastID().