Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
readout::ROPID Struct Reference

Class identifying a set of planes sharing readout channels. More...

#include <readout_types.h>

Inheritance diagram for readout::ROPID:
readout::TPCsetID geo::CryostatID

Public Types

using ROPID_t = unsigned int
 Type for the ID number. More...
 
using ThisID_t = ROPID
 Type of this ID. More...
 
using ParentID_t = TPCsetID
 Type of the parent ID. More...
 
template<std::size_t L>
using ID_t = details::AbsIDtype< L, ThisID_t >
 Type of the ID with the specified level L. More...
 
template<std::size_t A>
using UpperID_t = details::RelIDtype< A, ThisID_t >
 Type of the ID A levels above this one. More...
 
- Public Types inherited from readout::TPCsetID
using TPCsetID_t = unsigned short
 Type for the ID number. More...
 
using ThisID_t = TPCsetID
 Type of this ID. More...
 
using ParentID_t = CryostatID
 Type of the parent ID. More...
 
template<std::size_t L>
using ID_t = details::AbsIDtype< L, ThisID_t >
 Type of the ID with the specified level L. More...
 
template<std::size_t A>
using UpperID_t = details::RelIDtype< A, ThisID_t >
 Type of the ID A levels above this one. More...
 
- Public Types inherited from geo::CryostatID
using CryostatID_t = unsigned int
 Type for the ID number. More...
 
using ThisID_t = CryostatID
 Type of this ID. More...
 
using ParentID_t = void
 Type of the parent ID (none!). More...
 
template<std::size_t L>
using ID_t = details::AbsIDtype< L, ThisID_t >
 Type of the ID with the specified level L. More...
 
template<std::size_t A>
using UpperID_t = details::RelIDtype< A, ThisID_t >
 Type of the ID A levels above this one. More...
 

Public Member Functions

constexpr ROPID ()=default
 Default constructor: an invalid plane ID. More...
 
constexpr ROPID (TPCsetID const &tpcsetid, ROPID_t r)
 
constexpr ROPID (CryostatID_t c, TPCsetID_t s, ROPID_t r)
 
constexpr auto const & deepestIndex () const
 Returns the value of the deepest ID available (readout plane's). More...
 
auto & deepestIndex ()
 Returns the deepest ID available (readout plane's). More...
 
constexpr ParentID_t const & parentID () const
 Return the parent ID of this one (a TPC set ID). More...
 
ParentID_tparentID ()
 Return the parent ID of this one (a TPC set ID). More...
 
template<std::size_t Index = 0U>
constexpr auto getIndex () const
 Returns the index level Index of this type. More...
 
template<std::size_t Index = 0U>
auto & writeIndex ()
 Returns the index level Index of this type. More...
 
template<std::size_t Above>
constexpr auto getRelIndex () const
 Returns the index Above levels higher than Level. More...
 
constexpr ROPID const & asROPID () const
 Conversion to ROPID (for convenience of notation). More...
 
ROPIDasROPID ()
 Conversion to ROPID (for convenience of notation). More...
 
constexpr ROPID const & asConstROPID ()
 Conversion to ROPID (for convenience of notation). More...
 
constexpr int cmp (ROPID const &other) const
 Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger. More...
 
std::string toString () const
 Human-readable representation of the ROP ID. More...
 
 operator std::string () const
 
- Public Member Functions inherited from readout::TPCsetID
constexpr TPCsetID ()=default
 Default constructor: an invalid TPC set ID. More...
 
constexpr TPCsetID (CryostatID const &cryoid, TPCsetID_t s)
 
constexpr TPCsetID (CryostatID_t c, TPCsetID_t s)
 Constructor: TPC set with index s in the cryostat index c. More...
 
constexpr auto const & deepestIndex () const
 Returns the value of the deepest ID available (TPC set's). More...
 
auto & deepestIndex ()
 Returns the deepest ID available (TPC set's). More...
 
constexpr ParentID_t const & parentID () const
 Return the parent ID of this one (a cryostat ID). More...
 
ParentID_tparentID ()
 Return the parent ID of this one (a cryostat ID). More...
 
template<std::size_t Index = 0U>
constexpr auto getIndex () const
 Returns the index level Index of this type. More...
 
template<std::size_t Index = 0U>
auto & writeIndex ()
 Returns the index level Index of this type. More...
 
template<std::size_t Above>
constexpr auto getRelIndex () const
 Returns the index Above levels higher than Level. More...
 
constexpr TPCsetID const & asTPCsetID () const
 Conversion to TPCsetID (for convenience of notation). More...
 
TPCsetIDasTPCsetID ()
 Conversion to TPCsetID (for convenience of notation). More...
 
constexpr TPCsetID const & asConstTPCsetID ()
 Conversion to TPCsetID (for convenience of notation). More...
 
constexpr int cmp (TPCsetID const &other) const
 Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger. More...
 
std::string toString () const
 Human-readable representation of the TPC set ID. More...
 
 operator std::string () const
 
- Public Member Functions inherited from geo::CryostatID
constexpr CryostatID ()=default
 Default constructor: an invalid cryostat. More...
 
constexpr CryostatID (CryostatID_t c)
 Constructor: valid ID of cryostat with index c. More...
 
constexpr CryostatID (CryostatID_t c, bool valid)
 Constructor: valid ID of cryostat with index c. More...
 
constexpr auto const & deepestIndex () const
 Returns the value of the deepest ID available (cryostat's). More...
 
auto & deepestIndex ()
 Returns the deepest ID available (cryostat's). More...
 
constexpr ParentID_t parentID () const
 Return the parent ID of this one (void). More...
 
ParentID_t parentID ()
 Return the parent ID of this one (void). More...
 
template<std::size_t Index = 0U>
constexpr auto getIndex () const
 Returns the index level Index of this type. More...
 
template<std::size_t Index = 0U>
auto & writeIndex ()
 Returns the index level Index of this type. More...
 
template<std::size_t Above>
constexpr auto getRelIndex () const
 Returns the index Above levels higher than Level. More...
 
constexpr int cmp (CryostatID const &other) const
 Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger. More...
 
constexpr CryostatID const & asCryostatID () const
 Conversion to CryostatID (for convenience of notation). More...
 
CryostatIDasCryostatID ()
 Conversion to CryostatID (for convenience of notation). More...
 
constexpr CryostatID const & asConstCryostatID ()
 Conversion to CryostatID (for convenience of notation). More...
 
constexpr operator bool () const
 Returns true if the ID is valid. More...
 
constexpr bool operator! () const
 Returns true if the ID is not valid. More...
 
void setValidity (bool valid)
 Sets the validity of the ID. More...
 
void markValid ()
 Sets the ID as valid. More...
 
void markInvalid ()
 Sets the ID as invalid. More...
 
std::string toString () const
 Human-readable representation of the cryostat ID. More...
 
 operator std::string () const
 

Static Public Member Functions

static constexpr ROPID_t getInvalidID ()
 Return the value of the invalid ROP ID as a r-value. More...
 
- Static Public Member Functions inherited from readout::TPCsetID
static constexpr TPCsetID_t getInvalidID ()
 Return the value of the invalid TPC ID as a r-value. More...
 
- Static Public Member Functions inherited from geo::CryostatID
static constexpr CryostatID_t getInvalidID ()
 Return the value of the invalid ID as a r-value. More...
 
template<typename T >
static constexpr int ThreeWayComparison (T a, T b)
 Returns < 0 if a < b, 0 if a == b, > 0 if a > b. More...
 

Public Attributes

ROPID_t ROP = InvalidID
 Index of the readout plane within its TPC set. More...
 
- Public Attributes inherited from readout::TPCsetID
TPCsetID_t TPCset = InvalidID
 Index of the TPC set within its cryostat. More...
 
- Public Attributes inherited from geo::CryostatID
bool isValid = false
 Whether this ID points to a valid element. More...
 
CryostatID_t Cryostat = InvalidID
 Index of cryostat. More...
 

Static Public Attributes

static constexpr ROPID_t InvalidID = std::numeric_limits<ROPID_t>::max()
 Special code for an invalid ID. More...
 
static constexpr auto Level = readout::ElementLevel::ReadoutPlane
 Level of this element. More...
 
- Static Public Attributes inherited from readout::TPCsetID
static constexpr TPCsetID_t InvalidID = std::numeric_limits<TPCsetID_t>::max()
 Special code for an invalid ID. More...
 
static constexpr auto Level = readout::ElementLevel::TPCset
 Level of this element. More...
 
- Static Public Attributes inherited from geo::CryostatID
static constexpr CryostatID_t InvalidID = std::numeric_limits<CryostatID_t>::max()
 Special code for an invalid ID. More...
 
static constexpr auto Level = geo::ElementLevel::Cryostat
 Level of this element. More...
 

Detailed Description

Class identifying a set of planes sharing readout channels.

This identifier provides the TPC set location and a number representing the set of planes. This set is defined by not sharing readout channels with any other plane outside the set.

The name stands for "readout plane".

Definition at line 168 of file readout_types.h.

Member Typedef Documentation

template<std::size_t L>
using readout::ROPID::ID_t = details::AbsIDtype<L, ThisID_t>

Type of the ID with the specified level L.

Definition at line 176 of file readout_types.h.

Type of the parent ID.

Definition at line 172 of file readout_types.h.

using readout::ROPID::ROPID_t = unsigned int

Type for the ID number.

Definition at line 169 of file readout_types.h.

Type of this ID.

Definition at line 171 of file readout_types.h.

template<std::size_t A>
using readout::ROPID::UpperID_t = details::RelIDtype<A, ThisID_t>

Type of the ID A levels above this one.

Definition at line 180 of file readout_types.h.

Constructor & Destructor Documentation

constexpr readout::ROPID::ROPID ( )
default

Default constructor: an invalid plane ID.

constexpr readout::ROPID::ROPID ( TPCsetID const &  tpcsetid,
ROPID_t  r 
)
inline

Constructor: readout plane with index r in the TPC set identified by tpcsetid.

Definition at line 192 of file readout_types.h.

193  : TPCsetID(tpcsetid), ROP(r) {}
ROPID_t ROP
Index of the readout plane within its TPC set.
constexpr TPCsetID()=default
Default constructor: an invalid TPC set ID.
constexpr readout::ROPID::ROPID ( CryostatID_t  c,
TPCsetID_t  s,
ROPID_t  r 
)
inline

Constructor: readout plane with index r in the cryostat index c, TPC set index s.

Definition at line 197 of file readout_types.h.

198  : TPCsetID(c, s), ROP(r) {}
ROPID_t ROP
Index of the readout plane within its TPC set.
constexpr TPCsetID()=default
Default constructor: an invalid TPC set ID.
static QCString * s
Definition: config.cpp:1042

Member Function Documentation

constexpr ROPID const& readout::ROPID::asConstROPID ( )
inline

Conversion to ROPID (for convenience of notation).

Definition at line 232 of file readout_types.h.

232 { return *this; }
constexpr ROPID const& readout::ROPID::asROPID ( ) const
inline

Conversion to ROPID (for convenience of notation).

Definition at line 228 of file readout_types.h.

228 { return *this; }
ROPID& readout::ROPID::asROPID ( )
inline

Conversion to ROPID (for convenience of notation).

Definition at line 230 of file readout_types.h.

230 { return *this; }
constexpr int readout::ROPID::cmp ( ROPID const &  other) const
inline

Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger.

Definition at line 235 of file readout_types.h.

236  {
237  int cmp_res = TPCsetID::cmp(other);
238  if (cmp_res == 0) // same TPC set: compare plane
239  return ThreeWayComparison(ROP, other.ROP);
240  else // return the order of TPC set
241  return cmp_res;
242  } // cmp()
constexpr int cmp(TPCsetID const &other) const
Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger.
static constexpr int ThreeWayComparison(T a, T b)
Returns < 0 if a < b, 0 if a == b, > 0 if a > b.
Definition: geo_types.h:290
ROPID_t ROP
Index of the readout plane within its TPC set.
constexpr auto const& readout::ROPID::deepestIndex ( ) const
inline

Returns the value of the deepest ID available (readout plane's).

Definition at line 210 of file readout_types.h.

210 { return ROP; }
ROPID_t ROP
Index of the readout plane within its TPC set.
auto& readout::ROPID::deepestIndex ( )
inline

Returns the deepest ID available (readout plane's).

Definition at line 212 of file readout_types.h.

212 { return ROP; }
ROPID_t ROP
Index of the readout plane within its TPC set.
template<std::size_t Index>
constexpr auto readout::ROPID::getIndex ( ) const

Returns the index level Index of this type.

Definition at line 349 of file readout_types.h.

349  {
350  static_assert
351  (Index <= Level, "This ID type does not have the requested Index level.");
352  return details::getAbsIDindex<Index>(*this);
353 } // readout::ROPID::getIndex() const
unsigned int Index
static constexpr auto Level
Level of this element.
static constexpr ROPID_t readout::ROPID::getInvalidID ( )
inlinestatic

Return the value of the invalid ROP ID as a r-value.

Definition at line 248 of file readout_types.h.

248 { return ROPID::InvalidID; }
static constexpr ROPID_t InvalidID
Special code for an invalid ID.
template<std::size_t Above>
constexpr auto readout::ROPID::getRelIndex ( ) const

Returns the index Above levels higher than Level.

Definition at line 363 of file readout_types.h.

363  {
364  static_assert
365  (Above <= Level, "This ID type does not have the requested Index level.");
366  return getIndex<Level - Above>();
367 } // readout::ROPID::getRelIndex()
constexpr auto getIndex() const
Returns the index level Index of this type.
static constexpr auto Level
Level of this element.
readout::ROPID::operator std::string ( ) const
inlineexplicit

Definition at line 205 of file readout_types.h.

205 { return toString(); }
std::string toString() const
Human-readable representation of the ROP ID.
constexpr ParentID_t const& readout::ROPID::parentID ( ) const
inline

Return the parent ID of this one (a TPC set ID).

Definition at line 214 of file readout_types.h.

214 { return *this; }
ParentID_t& readout::ROPID::parentID ( )
inline

Return the parent ID of this one (a TPC set ID).

Definition at line 216 of file readout_types.h.

216 { return *this; }
std::string readout::ROPID::toString ( ) const
inline

Human-readable representation of the ROP ID.

Definition at line 204 of file readout_types.h.

204 { return details::writeToString(*this); }
std::string writeToString(T const &value)
Definition: readout_types.h:23
template<std::size_t Index>
auto & readout::ROPID::writeIndex ( )

Returns the index level Index of this type.

Definition at line 356 of file readout_types.h.

356  {
357  static_assert
358  (Index <= Level, "This ID type does not have the requested Index level.");
359  return details::getAbsIDindex<Index>(*this);
360 } // readout::ROPID::writeIndex()
unsigned int Index
static constexpr auto Level
Level of this element.

Member Data Documentation

constexpr ROPID_t readout::ROPID::InvalidID = std::numeric_limits<ROPID_t>::max()
static

Special code for an invalid ID.

Definition at line 183 of file readout_types.h.

constexpr auto readout::ROPID::Level = readout::ElementLevel::ReadoutPlane
static

Level of this element.

Definition at line 245 of file readout_types.h.

ROPID_t readout::ROPID::ROP = InvalidID

Index of the readout plane within its TPC set.

Definition at line 185 of file readout_types.h.


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