LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 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...
 
Mapping transformations
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...
 
Mapping modification
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...
 

Private Types

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

Indexer status query

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...
 
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 31 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 55 of file ReadoutIDmapper.h.

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

Definition at line 59 of file ReadoutIDmapper.h.

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

Definition at line 60 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 73 of file ReadoutIDmapper.h.

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

Member Function Documentation

void geo::GeoIDmapper< readout::TPCsetID , Index >::clear ( )
inherited

Sets all dimension sizes to 0.

See also
resize()

The mapping needs to be resized before it is useful again.

static constexpr unsigned int geo::GeoIDmapper< readout::TPCsetID , Index >::dimensions ( )
staticinherited

Dimensions of the ID of this mapping.

unsigned int geo::GeoIDmapper< readout::TPCsetID , Index >::dimSize ( ) const
inherited

Dimensions of the Level dimension of this mapping.

bool geo::GeoIDmapper< readout::TPCsetID , Index >::empty ( ) const
inherited

Returns whether the mapping has no elements (false by assumptions).

GeoID geo::GeoIDmapper< readout::TPCsetID , Index >::firstID ( ) const
inherited

Returns the ID of the first element with GeoID type.

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 103 of file ReadoutIDmapper.h.

103 { return BaseMapper_t::hasElement(cryoid); }
bool hasElement(GeoID const &id) const
Returns whether this mapping hosts data for the specified ID.
bool geo::GeoIDmapper< readout::TPCsetID , Index >::hasElement ( GeoID const &  id) const
inherited
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 106 of file ReadoutIDmapper.h.

107  {
108  return BaseMapper_t::hasElement(tpcsetid);
109  }
bool hasElement(GeoID const &id) const
Returns whether this mapping hosts data for the specified ID.
ID_t geo::GeoIDmapper< readout::TPCsetID , Index >::ID ( index_type const  index) const
inherited

Returns the ID corresponding to the specified linear index.

index_type geo::GeoIDmapper< readout::TPCsetID , Index >::index ( ID_t const &  id) const
inherited

Returns the linear index corresponding to the specified ID.

GeoID geo::GeoIDmapper< readout::TPCsetID , Index >::lastID ( ) const
inherited

Returns the ID of the last covered element with GeoID type.

index_type geo::GeoIDmapper< readout::TPCsetID , Index >::operator() ( ID_t const &  id) const
inherited

Returns the linear index corresponding to the specified ID.

ID_t geo::GeoIDmapper< readout::TPCsetID , Index >::operator() ( index_type const  index) const
inherited

Returns the ID corresponding to the specified linear index.

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 90 of file ReadoutIDmapper.h.

91  {
92  BaseMapper_t::resize({nCryo, nTPCsets});
93  }
void resize(std::initializer_list< unsigned int > dims)
Resizes the mapping to accommodate the specified dimension sizes.
void geo::GeoIDmapper< readout::TPCsetID , Index >::resize ( std::initializer_list< unsigned int >  dims)
inherited

Resizes the mapping to accommodate the specified dimension sizes.

Parameters
dimsnumber of elements on all levels of the mapping
See also
resizeAs()

The size of each dimension is specified by the corresponding number, starting from the size of the outer dimension (cryostat).

Referenced by readout::TPCsetIDmapper<>::resize(), readout::ROPIDmapper<>::resize(), readout::ROPIDmapper<>::ROPIDmapper(), and readout::TPCsetIDmapper<>::TPCsetIDmapper().

void geo::GeoIDmapper< readout::TPCsetID , Index >::resizeAs ( geo::GeoIDmapper< OIDType, OIndex > const &  other)
inherited

Resizes the mapping to reflect the one from another mapping.

Parameters
otherID mapping to take dimensions from

The size of each dimension is taken by the matching one in other.

index_type geo::GeoIDmapper< readout::TPCsetID , Index >::size ( void  ) const
inherited

Returns the number of elements in the mapping.


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