LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Container with one element per geometry wire plane. 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 | |
PlaneDataContainer (unsigned int nCryo, unsigned int nTPCs, unsigned int nPlanes) | |
Prepares the container with default-constructed data. More... | |
PlaneDataContainer (unsigned int nCryo, unsigned int nTPCs, unsigned int nPlanes, 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... | |
bool | hasPlane (geo::PlaneID const &id) const |
Returns whether this container hosts data for the specified plane. More... | |
geo::PlaneID | firstID () const |
Returns the ID of the first TPC. More... | |
geo::PlaneID | lastID () const |
Returns the ID of the last covered TPC. More... | |
Element access | |
reference | operator[] (geo::PlaneID const &id) |
Returns the element for the specified wire plane. More... | |
const_reference | operator[] (geo::PlaneID const &id) const |
Returns the element for the specified wire plane (read-only). More... | |
reference | at (geo::PlaneID const &id) |
const_reference | at (geo::PlaneID 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 |
using | PlaneNo_t = geo::PlaneID::PlaneID_t |
Private Member Functions | |
size_type | index (CryostatNo_t cryo, TPCNo_t tpc, PlaneNo_t plane) const |
Returns the internal index of the specified TPC in the storage area. More... | |
size_type | index (geo::PlaneID const &id) const |
Returns the internal index of the specified TPC in the storage area. More... | |
geo::PlaneID | 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, PlaneNo_t nPlanes) |
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 per cryostat. More... | |
PlaneNo_t | fNPlanes |
Number of planes per TPC. More... | |
Container_t | fData |
Data storage area. More... | |
Container with one element per geometry wire plane.
T | type of the contained datum |
geo::GeometryCore::makePlaneData
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 273 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::const_iterator = typename Container_t::const_iterator |
Definition at line 289 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::const_pointer = typename Container_t::const_pointer |
Definition at line 287 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::const_reference = typename Container_t::const_reference |
Definition at line 285 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::const_reverse_iterator = typename Container_t::const_reverse_iterator |
Definition at line 291 of file GeometryDataContainers.h.
|
private |
Definition at line 275 of file GeometryDataContainers.h.
|
private |
Definition at line 424 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::difference_type = typename Container_t::difference_type |
Definition at line 292 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::iterator = typename Container_t::iterator |
Definition at line 288 of file GeometryDataContainers.h.
|
private |
Definition at line 426 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::pointer = typename Container_t::pointer |
Definition at line 286 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::reference = typename Container_t::reference |
Definition at line 284 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::reverse_iterator = typename Container_t::reverse_iterator |
Definition at line 290 of file GeometryDataContainers.h.
using geo::PlaneDataContainer< T >::size_type = typename Container_t::size_type |
Definition at line 293 of file GeometryDataContainers.h.
|
private |
Definition at line 425 of file GeometryDataContainers.h.
|
inline |
Prepares the container with default-constructed data.
nCryo | number of cryostats |
nTPCs | number of TPCs per cryostat |
nPlanes | number of planes per TPC |
The container is sized to host data for nCryo
cryostats, each with nTPCs
TPCs, each one with fNPlanes
wire planes. Each element in the container is default-constructed.
Definition at line 308 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 |
nPlanes | number of planes per TPC |
defValue | the value to be replicated |
The container is sized to host data for nCryo
cryostats, each with nTPCs
TPCs, and each of them with fNPlanes
planes. Each element in the container is a copy of defValue.
Definition at line 331 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::empty().
|
inline |
Returns the element for the specified wire plane.
std::out_of_range | if the id is not within the container range |
Definition at line 392 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::operator[]().
|
inline |
Returns the element for the specified wire plane (read-only).
std::out_of_range | if the id is not within the container range |
Definition at line 400 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::operator[]().
|
inlinestaticprivate |
Returns whether the specified value is between 0
and the upper limit.
Definition at line 460 of file GeometryDataContainers.h.
|
inline |
Returns the number of elements the container has memory for.
Definition at line 350 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData.
|
inlineprivate |
Computes the expected size of this container.
Definition at line 450 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::computeSize().
|
inlinestaticprivate |
Returns the size of a container with the specified dimensions.
Definition at line 455 of file GeometryDataContainers.h.
|
inline |
Returns whether the container has no elements (false
by assumptions).
Definition at line 353 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData.
|
inline |
Returns the element for the first TPC (unchecked).
Definition at line 408 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 411 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 368 of file GeometryDataContainers.h.
|
inline |
Returns whether this container hosts data for the specified cryostat.
Definition at line 356 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::bounded(), geo::CryostatID::Cryostat, and geo::TPCDataContainer< T >::fNCryo.
|
inline |
Returns whether this container hosts data for the specified plane.
Definition at line 364 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::bounded(), and geo::TPCDataContainer< T >::hasTPC().
|
inline |
Returns whether this container hosts data for the specified TPC.
Definition at line 360 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::bounded(), geo::TPCDataContainer< T >::fNTPCs, and geo::TPCDataContainer< T >::hasCryostat().
|
inlineprivate |
Returns the ID of the TPC at the specified index (unchecked!)
Definition at line 443 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 435 of file GeometryDataContainers.h.
|
inlineprivate |
Returns the internal index of the specified TPC in the storage area.
Definition at line 439 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::index().
|
inline |
Returns the element for the last TPC (unchecked).
Definition at line 415 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 418 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 371 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fNCryo, and geo::TPCDataContainer< T >::fNTPCs.
|
inline |
Returns the element for the specified wire plane.
Definition at line 383 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData, and geo::TPCDataContainer< T >::index().
|
inline |
Returns the element for the specified wire plane (read-only).
Definition at line 387 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 347 of file GeometryDataContainers.h.
References geo::TPCDataContainer< T >::fData.
|
private |
Data storage area.
Definition at line 432 of file GeometryDataContainers.h.
|
private |
Number of cryostats.
Definition at line 428 of file GeometryDataContainers.h.
|
private |
Number of planes per TPC.
Definition at line 430 of file GeometryDataContainers.h.
|
private |
Number of TPCs per cryostat.
Definition at line 429 of file GeometryDataContainers.h.