LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
readout::ROPIDmapper< Index > Class Template Reference

Mapping for readout plane identifiers. More...

#include "ReadoutIDmapper.h"

Inheritance diagram for readout::ROPIDmapper< Index >:
geo::GeoIDmapper< readout::ROPID, Index >

Public Types

using ID_t = typename BaseMapper_t::ID_t
 
using index_type = typename BaseMapper_t::index_type
 

Public Member Functions

 ROPIDmapper (unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
 Prepares the mapping with the specified sizes. More...
 
Mapping modification
void resize (unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
 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 hasTPC (readout::TPCsetID const &tpcsetid) const
 Returns whether this mapping covers the specified TPC set. More...
 
bool hasPlane (readout::ROPID const &ropid) const
 Returns whether this mapping covers the specified readout plane. 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::ROPID, 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::ROPIDmapper< Index >

Mapping for readout plane identifiers.


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

A customized version of geo::GeoIDmapper offering readout plane ID-specific interface.

Definition at line 34 of file ReadoutIDmapper.h.

Member Typedef Documentation

template<typename Index>
using readout::ROPIDmapper< Index >::BaseMapper_t = geo::GeoIDmapper<readout::ROPID, Index>
private

Base class.

Definition at line 128 of file ReadoutIDmapper.h.

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

Definition at line 132 of file ReadoutIDmapper.h.

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

Definition at line 133 of file ReadoutIDmapper.h.

Constructor & Destructor Documentation

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

Prepares the mapping with the specified sizes.

Parameters
nCryonumber of cryostats
nTPCsetsnumber of TPC sets per cryostat
nROPsnumber of readout planes per TPC set

The mapping is sized to map nCryo cryostats, each with nTPCsets TPC sets, each one with nROPs readout planes.

Definition at line 147 of file ReadoutIDmapper.h.

148  : BaseMapper_t({nCryo, nTPCsets, nROPs})
149  {}
geo::GeoIDmapper< readout::ROPID, Index > BaseMapper_t
Base class.

Member Function Documentation

void geo::GeoIDmapper< readout::ROPID , 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::ROPID , Index >::dimensions ( )
staticinherited

Dimensions of the ID of this mapping.

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

Dimensions of the Level dimension of this mapping.

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

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

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

Returns the ID of the first element with GeoID type.

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

Returns whether this mapping covers the specified cryostat.

Definition at line 180 of file ReadoutIDmapper.h.

180 { 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::ROPID , Index >::hasElement ( GeoID const &  id) const
inherited

Returns whether this mapping hosts data for the specified ID.

template<typename Index>
bool readout::ROPIDmapper< Index >::hasPlane ( readout::ROPID const &  ropid) const
inline

Returns whether this mapping covers the specified readout plane.

Definition at line 189 of file ReadoutIDmapper.h.

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

Returns whether this mapping covers the specified TPC set.

Definition at line 183 of file ReadoutIDmapper.h.

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

Returns the ID corresponding to the specified linear index.

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

Returns the linear index corresponding to the specified ID.

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

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

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

Returns the linear index corresponding to the specified ID.

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

Returns the ID corresponding to the specified linear index.

void geo::GeoIDmapper< readout::ROPID , 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).

template<typename Index>
void readout::ROPIDmapper< Index >::resize ( unsigned int  nCryo,
unsigned int  nTPCsets,
unsigned int  nROPs 
)
inline

Prepares the mapping for the specified sizes.

Parameters
nCryonumber of cryostats
nTPCsetsnumber of TPC sets per cryostat
nROPsnumber of readout planes per TPC set
See also
resizeAs()

The mapping is sized to map nCryo cryostats, each with nTPCsets TPC sets, each one with nROPs readout planes.

Definition at line 167 of file ReadoutIDmapper.h.

168  {
169  BaseMapper_t::resize({nCryo, nTPCsets, nROPs});
170  }
void resize(std::initializer_list< unsigned int > dims)
Resizes the mapping to accommodate the specified dimension sizes.
void geo::GeoIDmapper< readout::ROPID , 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::ROPID , Index >::size ( void  ) const
inherited

Returns the number of elements in the mapping.


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