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

Mapping for sensitive plane identifiers. More...

#include "GeometryIDmapper.h"

Inheritance diagram for geo::PlaneIDmapper< Index >:
geo::GeoIDmapper< geo::PlaneID, Index >

Public Types

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

Public Member Functions

 PlaneIDmapper (unsigned int nCryo, unsigned int nTPCs, unsigned int nPlanes)
 Prepares the mapping with the specified sizes. More...
 
Mapping modification
void resize (unsigned int nCryo, unsigned int nTPCs, unsigned int nPlanes)
 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 (geo::TPCID const &tpcid) const
 Returns whether this mapping covers the specified TPC. More...
 
bool hasPlane (geo::PlaneID const &planeid) const
 Returns whether this mapping covers the specified 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< geo::PlaneID, 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 geo::PlaneIDmapper< Index >

Mapping for sensitive plane identifiers.


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

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

Definition at line 34 of file GeometryIDmapper.h.

Member Typedef Documentation

template<typename Index>
using geo::PlaneIDmapper< Index >::BaseMapper_t = geo::GeoIDmapper<geo::PlaneID, Index>
private

Base class.

Definition at line 321 of file GeometryIDmapper.h.

template<typename Index>
using geo::PlaneIDmapper< Index >::ID_t = typename BaseMapper_t::ID_t

Definition at line 325 of file GeometryIDmapper.h.

template<typename Index>
using geo::PlaneIDmapper< Index >::index_type = typename BaseMapper_t::index_type

Definition at line 326 of file GeometryIDmapper.h.

Constructor & Destructor Documentation

template<typename Index>
geo::PlaneIDmapper< Index >::PlaneIDmapper ( unsigned int  nCryo,
unsigned int  nTPCs,
unsigned int  nPlanes 
)
inline

Prepares the mapping with the specified sizes.

Parameters
nCryonumber of cryostats
nTPCsnumber of TPCs per cryostat
nPlanesnumber of planes per TPC

The mapping is sized to map nCryo cryostats, each with nTPCs TPCs, each one with nPlanes wire planes.

Definition at line 340 of file GeometryIDmapper.h.

341  : BaseMapper_t({nCryo, nTPCs, nPlanes})
342  {}
geo::GeoIDmapper< geo::PlaneID, Index > BaseMapper_t
Base class.

Member Function Documentation

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

Dimensions of the ID of this mapping.

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

Dimensions of the Level dimension of this mapping.

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

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

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

Returns the ID of the first element with GeoID type.

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

Returns whether this mapping covers the specified cryostat.

Definition at line 373 of file GeometryIDmapper.h.

373 { return BaseMapper_t::hasElement(cryoid); }
bool hasElement(GeoID const &id) const
Returns whether this mapping hosts data for the specified ID.
bool geo::GeoIDmapper< geo::PlaneID , Index >::hasElement ( GeoID const &  id) const
inherited

Returns whether this mapping hosts data for the specified ID.

template<typename Index>
bool geo::PlaneIDmapper< Index >::hasPlane ( geo::PlaneID const &  planeid) const
inline

Returns whether this mapping covers the specified plane.

Definition at line 379 of file GeometryIDmapper.h.

379 { return BaseMapper_t::hasElement(planeid); }
bool hasElement(GeoID const &id) const
Returns whether this mapping hosts data for the specified ID.
template<typename Index>
bool geo::PlaneIDmapper< Index >::hasTPC ( geo::TPCID const &  tpcid) const
inline

Returns whether this mapping covers the specified TPC.

Definition at line 376 of file GeometryIDmapper.h.

376 { return BaseMapper_t::hasElement(tpcid); }
bool hasElement(GeoID const &id) const
Returns whether this mapping hosts data for the specified ID.
ID_t geo::GeoIDmapper< geo::PlaneID , Index >::ID ( index_type const  index) const
inherited

Returns the ID corresponding to the specified linear index.

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

Returns the linear index corresponding to the specified ID.

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

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

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

Returns the linear index corresponding to the specified ID.

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

Returns the ID corresponding to the specified linear index.

void geo::GeoIDmapper< geo::PlaneID , 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 geo::PlaneIDmapper< Index >::resize ( unsigned int  nCryo,
unsigned int  nTPCs,
unsigned int  nPlanes 
)
inline

Prepares the mapping for the specified sizes.

Parameters
nCryonumber of cryostats
nTPCsnumber of TPCs
nPlanesnumber of planes per TPC
See also
resizeAs()

The mapping is sized to map nCryo cryostats, each with nTPCs TPCs, each one with nPlanes wire planes.

Definition at line 360 of file GeometryIDmapper.h.

361  {
362  BaseMapper_t::resize({nCryo, nTPCs, nPlanes});
363  }
void resize(std::initializer_list< unsigned int > dims)
Resizes the mapping to accommodate the specified dimension sizes.
void geo::GeoIDmapper< geo::PlaneID , 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< geo::PlaneID , Index >::size ( void  ) const
inherited

Returns the number of elements in the mapping.


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