11 #ifndef LARCOREALG_GEOMETRY_GEOMETRYDATACONTAINERS_H 12 #define LARCOREALG_GEOMETRY_GEOMETRYDATACONTAINERS_H 78 using pointer =
typename Container_t::pointer ;
101 { assert(!
empty()); }
123 { assert(!
empty()); }
174 throw std::out_of_range(
"No data for " + std::string(
id));
182 throw std::out_of_range(
"No data for " + std::string(
id));
213 {
return (fNTPCs * cryo) + tpc; }
217 {
return index(
id.Cryostat,
id.TPC); }
221 {
return { index /
fNCryo, index % fNCryo }; }
228 {
return nCryo * nTPCs; }
231 template <
typename Value,
typename Upper>
233 {
return (v >= 0) && (
static_cast<size_type>(v) < upper); }
272 template <
typename T>
286 using pointer =
typename Container_t::pointer ;
308 (
unsigned int nCryo,
unsigned int nTPCs,
unsigned int nPlanes)
313 { assert(!
empty()); }
332 unsigned int nCryo,
unsigned int nTPCs,
unsigned int nPlanes,
339 { assert(!
empty()); }
395 throw std::out_of_range(
"No data for " + std::string(
id));
403 throw std::out_of_range(
"No data for " + std::string(
id));
436 {
return ((cryo) * fNTPCs + tpc) * fNPlanes + plane; }
440 {
return index(
id.Cryostat,
id.TPC,
id.
Plane); }
446 { index /
fNCryo, index % fNCryo / fNPlanes, index % fNPlanes };
456 {
return nCryo * nTPCs * nPlanes; }
459 template <
typename Value,
typename Upper>
461 {
return (v >= 0) && (
static_cast<size_type>(v) < upper); }
473 #endif // LARCOREALG_GEOMETRY_GEOMETRYDATACONTAINERS_H size_type size() const
Returns the number of elements in the container.
typename Container_t::const_pointer const_pointer
std::vector< T > Container_t
size_type index(geo::PlaneID const &id) const
Returns the internal index of the specified TPC in the storage area.
typename Container_t::const_iterator const_iterator
reference operator[](geo::TPCID const &id)
Returns the element for the specified TPC.
typename Container_t::pointer pointer
reference at(geo::PlaneID const &id)
size_type index(CryostatNo_t cryo, TPCNo_t tpc) const
Returns the internal index of the specified TPC in the storage area.
typename Container_t::const_reverse_iterator const_reverse_iterator
geo::PlaneID::PlaneID_t PlaneNo_t
size_type capacity() const
Returns the number of elements the container has memory for.
reference operator[](geo::PlaneID const &id)
Returns the element for the specified wire plane.
unsigned int CryostatID_t
Type for the ID number.
PlaneNo_t fNPlanes
Number of planes per TPC.
bool hasCryostat(geo::CryostatID const &cryoid) const
Returns whether this container hosts data for the specified cryostat.
typename Container_t::const_reference const_reference
The data type to uniquely identify a Plane.
bool empty() const
Returns whether the container has no elements (false by assumptions).
TPCDataContainer(unsigned int nCryo, unsigned int nTPCs)
Prepares the container with default-constructed data.
typename Container_t::pointer pointer
CryostatID_t Cryostat
Index of cryostat.
typename Container_t::size_type size_type
Container with one element per geometry wire plane.
geo::PlaneID firstID() const
Returns the ID of the first TPC.
const_reference at(geo::PlaneID const &id) const
reference last()
Returns the element for the last TPC (unchecked).
geo::TPCID lastID() const
Returns the ID of the last covered TPC.
std::vector< T > Container_t
bool hasTPC(geo::TPCID const &id) const
Returns whether this container hosts data for the specified TPC.
const_reference last() const
Returns the element for the last TPC (unchecked).
unsigned int PlaneID_t
Type for the ID number.
CryostatNo_t fNCryo
Number of cryostats.
Container with one element per geometry TPC.
bool hasPlane(geo::PlaneID const &id) const
Returns whether this container hosts data for the specified plane.
typename Container_t::size_type size_type
typename Container_t::reference reference
static size_type computeSize(CryostatNo_t nCryo, TPCNo_t nTPCs)
Returns the size of a container with the specified dimensions.
size_type index(geo::TPCID const &id) const
Returns the internal index of the specified TPC in the storage area.
typename Container_t::const_reference const_reference
geo::PlaneID ID(size_type index) const
Returns the ID of the TPC at the specified index (unchecked!)
bool hasCryostat(geo::CryostatID const &cryoid) const
Returns whether this container hosts data for the specified cryostat.
unsigned int TPCID_t
Type for the ID number.
const_reference operator[](geo::PlaneID const &id) const
Returns the element for the specified wire plane (read-only).
size_type size() const
Returns the number of elements in the container.
const_reference operator[](geo::TPCID const &id) const
Returns the element for the specified TPC (read-only).
static bool bounded(Value v, Upper upper)
Returns whether the specified value is between 0 and the upper limit.
bool empty() const
Returns whether the container has no elements (false by assumptions).
typename Container_t::const_reverse_iterator const_reverse_iterator
geo::TPCID firstID() const
Returns the ID of the first TPC.
TPCNo_t fNTPCs
Number of TPCs.
typename Container_t::iterator iterator
typename Container_t::difference_type difference_type
The data type to uniquely identify a TPC.
typename Container_t::const_pointer const_pointer
geo::TPCID::TPCID_t TPCNo_t
Container_t fData
Data storage area.
Definition of data types for geometry description.
bool hasTPC(geo::TPCID const &id) const
Returns whether this container hosts data for the specified TPC.
typename Container_t::reverse_iterator reverse_iterator
TPCNo_t fNTPCs
Number of TPCs per cryostat.
typename Container_t::difference_type difference_type
reference last()
Returns the element for the last TPC (unchecked).
reference first()
Returns the element for the first TPC (unchecked).
CryostatNo_t fNCryo
Number of cryostats.
geo::CryostatID::CryostatID_t CryostatNo_t
reference first()
Returns the element for the first TPC (unchecked).
typename Container_t::reverse_iterator reverse_iterator
TPCDataContainer(unsigned int nCryo, unsigned int nTPCs, T const &defValue)
Prepares the container with copies of the specified default value.
geo::TPCID::TPCID_t TPCNo_t
const_reference first() const
Returns the element for the first TPC (unchecked).
static bool bounded(Value v, Upper upper)
Returns whether the specified value is between 0 and the upper limit.
size_type capacity() const
Returns the number of elements the container has memory for.
typename Container_t::iterator iterator
geo::CryostatID::CryostatID_t CryostatNo_t
const_reference at(geo::TPCID const &id) const
typename Container_t::const_iterator const_iterator
PlaneDataContainer(unsigned int nCryo, unsigned int nTPCs, unsigned int nPlanes, T const &defValue)
Prepares the container with copies of the specified default value.
const_reference last() const
Returns the element for the last TPC (unchecked).
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.
reference at(geo::TPCID const &id)
geo::PlaneID lastID() const
Returns the ID of the last covered TPC.
recob::tracking::Plane Plane
size_type computeSize() const
Computes the expected size of this container.
Namespace collecting geometry-related classes utilities.
size_type computeSize() const
Computes the expected size of this container.
const_reference first() const
Returns the element for the first TPC (unchecked).
geo::TPCID ID(size_type index) const
Returns the ID of the TPC at the specified index (unchecked!)
Container_t fData
Data storage area.
The data type to uniquely identify a cryostat.
typename Container_t::reference reference