Public Types | Public Member Functions | Private Types | List of all members
readout::TPCsetIDmapper< Index > Class Template Reference

Mapping for TPC set identifiers. More...

#include <ReadoutIDmapper.h>

Inheritance diagram for readout::TPCsetIDmapper< Index >:
geo::GeoIDmapper< readout::TPCsetID, Index >

Public Types

using ID_t = typename BaseMapper_t::ID_t
 
using index_type = typename BaseMapper_t::index_type
 
- Public Types inherited from geo::GeoIDmapper< readout::TPCsetID, Index >
using ID_t = readout::TPCsetID
 Type used as ID for this mapping. More...
 
using index_type = Index
 Type of flat index. More...
 

Public Member Functions

 TPCsetIDmapper (unsigned int nCryo, unsigned int nTPCsets)
 Prepares the mapping with the specified sizes. More...
 
Mapping modification
void resize (unsigned int nCryo, unsigned int nTPCsets)
 Prepares the mapping for the specified sizes. More...
 
Mapping status query
bool hasCryostat (geo::CryostatID const &cryoid) const
 Returns whether this mapping covers the specified cryostat. More...
 
bool hasTPCset (readout::TPCsetID const &tpcsetid) const
 Returns whether this mapping covers the specified TPC set. More...
 
- Public Member Functions inherited from geo::GeoIDmapper< readout::TPCsetID, Index >
 GeoIDmapper ()
 Default constructor: all dimensions empty. More...
 
 GeoIDmapper (std::initializer_list< unsigned int > dims)
 Prepares the indexer. More...
 
index_type index (ID_t const &id) const
 Returns the linear index corresponding to the specified ID. More...
 
ID_t ID (index_type const index) const
 Returns the ID corresponding to the specified linear index. More...
 
index_type operator() (ID_t const &id) const
 Returns the linear index corresponding to the specified ID. More...
 
ID_t operator() (index_type const index) const
 Returns the ID corresponding to the specified linear index. More...
 
void resize (std::initializer_list< unsigned int > dims)
 Resizes the mapping to accommodate the specified dimension sizes. More...
 
void resizeAs (geo::GeoIDmapper< OIDType, OIndex > const &other)
 Resizes the mapping to reflect the one from another mapping. More...
 
void clear ()
 Sets all dimension sizes to 0. More...
 
index_type size () const
 Returns the number of elements in the mapping. More...
 
bool empty () const
 Returns whether the mapping has no elements (false by assumptions). More...
 
unsigned int dimSize () const
 Dimensions of the Level dimension of this mapping. More...
 
bool hasElement (GeoID const &id) const
 Returns whether this mapping 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...
 

Private Types

using BaseMapper_t = geo::GeoIDmapper< readout::TPCsetID, Index >
 Base class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geo::GeoIDmapper< readout::TPCsetID, Index >
static constexpr unsigned int dimensions ()
 Dimensions of the ID of this mapping. More...
 

Detailed Description

template<typename Index>
class readout::TPCsetIDmapper< Index >

Mapping for TPC set identifiers.


Template Parameters
Index(default: std::size_t) type of flat index
See also
geo::GeoIDmapper

A customized version of geo::GeoIDmapper offering TPC set ID-specific interface.

Definition at line 32 of file ReadoutIDmapper.h.

Member Typedef Documentation

template<typename Index>
using readout::TPCsetIDmapper< Index >::BaseMapper_t = geo::GeoIDmapper<readout::TPCsetID, Index>
private

Base class.

Definition at line 59 of file ReadoutIDmapper.h.

template<typename Index>
using readout::TPCsetIDmapper< Index >::ID_t = typename BaseMapper_t::ID_t

Definition at line 64 of file ReadoutIDmapper.h.

template<typename Index>
using readout::TPCsetIDmapper< Index >::index_type = typename BaseMapper_t::index_type

Definition at line 65 of file ReadoutIDmapper.h.

Constructor & Destructor Documentation

template<typename Index>
readout::TPCsetIDmapper< Index >::TPCsetIDmapper ( unsigned int  nCryo,
unsigned int  nTPCsets 
)
inline

Prepares the mapping with the specified sizes.

Parameters
nCryonumber of cryostats
nTPCsetsnumber of TPCsets per cryostat

The mapping is sized to map nCryo cryostats, each with nTPCsets TPC sets.

Definition at line 79 of file ReadoutIDmapper.h.

80  : BaseMapper_t({ nCryo, nTPCsets })
81  {}
geo::GeoIDmapper< readout::TPCsetID, Index > BaseMapper_t
Base class.

Member Function Documentation

template<typename Index>
bool readout::TPCsetIDmapper< Index >::hasCryostat ( geo::CryostatID const &  cryoid) const
inline

Returns whether this mapping covers the specified cryostat.

Definition at line 111 of file ReadoutIDmapper.h.

112  { return BaseMapper_t::hasElement(cryoid); }
bool hasElement(GeoID const &id) const
Returns whether this mapping hosts data for the specified ID.
template<typename Index>
bool readout::TPCsetIDmapper< Index >::hasTPCset ( readout::TPCsetID const &  tpcsetid) const
inline

Returns whether this mapping covers the specified TPC set.

Definition at line 115 of file ReadoutIDmapper.h.

116  { return BaseMapper_t::hasElement(tpcsetid); }
bool hasElement(GeoID const &id) const
Returns whether this mapping hosts data for the specified ID.
template<typename Index>
void readout::TPCsetIDmapper< Index >::resize ( unsigned int  nCryo,
unsigned int  nTPCsets 
)
inline

Prepares the mapping for the specified sizes.

Parameters
nCryonumber of cryostats
nTPCsetsnumber of TPC sets
See also
resizeAs()

The mapping is sized to map nCryo cryostats, each with nTPCsets TPC sets.

Definition at line 99 of file ReadoutIDmapper.h.

100  { BaseMapper_t::resize({ nCryo, nTPCsets }); }
void resize(std::initializer_list< unsigned int > dims)
Resizes the mapping to accommodate the specified dimension sizes.

The documentation for this class was generated from the following file: