8 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_H 9 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_H 27 template <std::
size_t Index,
typename ID>
30 template <std::
size_t UpIndex,
typename ID>
33 template <std::
size_t Index,
typename ID>
36 return geo::details::getAbsIDindex<Index, ID>(id);
39 template <std::
size_t Index,
typename ID>
42 return geo::details::getAbsIDindex<Index, ID>(id);
55 static constexpr
Level_t ReadoutPlane = 2U;
79 template <std::
size_t L>
83 template <std::
size_t A>
87 static constexpr
TPCsetID_t InvalidID = std::numeric_limits<TPCsetID_t>::max();
107 explicit operator std::string()
const {
return toString(); }
120 template <std::
size_t Index = 0U>
121 constexpr
auto getIndex()
const;
123 template <std::
size_t Index = 0U>
126 template <std::
size_t Above>
127 constexpr
auto getRelIndex()
const;
141 return ThreeWayComparison(TPCset, other.
TPCset);
171 template <std::
size_t L>
175 template <std::
size_t A>
179 static constexpr
ROPID_t InvalidID = std::numeric_limits<ROPID_t>::max();
184 constexpr
ROPID() =
default;
199 explicit operator std::string()
const {
return toString(); }
212 template <std::
size_t Index = 0U>
213 constexpr
auto getIndex()
const;
215 template <std::
size_t Index = 0U>
218 template <std::
size_t Above>
219 constexpr
auto getRelIndex()
const;
233 return ThreeWayComparison(ROP, other.
ROP);
321 template <std::size_t Index >
324 static_assert(Index <=
Level,
"This ID type does not have the requested Index level.");
325 return details::getAbsIDindex<Index>(*this);
328 template <std::size_t Index >
331 static_assert(Index <=
Level,
"This ID type does not have the requested Index level.");
332 return details::getAbsIDindex<Index>(*this);
335 template <std::
size_t Above>
338 static_assert(Above <=
Level,
"This ID type does not have the requested Index level.");
339 return getIndex<
Level - Above>();
343 template <std::size_t Index >
346 static_assert(Index <=
Level,
"This ID type does not have the requested Index level.");
347 return details::getAbsIDindex<Index>(*this);
350 template <std::size_t Index >
353 static_assert(Index <=
Level,
"This ID type does not have the requested Index level.");
354 return details::getAbsIDindex<Index>(*this);
357 template <std::
size_t Above>
360 static_assert(Above <=
Level,
"This ID type does not have the requested Index level.");
361 return getIndex<
Level - Above>();
366 #endif // LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_H
constexpr int cmp(TPCsetID const &other) const
Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger.
constexpr bool operator<(TPCsetID const &a, TPCsetID const &b)
Order TPCsetID in increasing Cryo, then TPC set.
typename RelIDtypeStruct< ID, UpIndex >::type RelIDtype
std::ostream & operator<<(std::ostream &out, TPCsetID const &sid)
Generic output of TPCsetID to stream.
auto & deepestIndex()
Returns the deepest ID available (readout plane's).
static constexpr ROPID_t getInvalidID()
Return the value of the invalid ROP ID as a r-value.
constexpr TPCsetID(CryostatID const &cryoid, TPCsetID_t s)
constexpr auto getRelIndex() const
Returns the index Above levels higher than Level.
details::AbsIDtype< L, ThisID_t > ID_t
Type of the ID with the specified level L.
unsigned int ROPID_t
Type for the ID number.
IDparameter< readout::ROPID > ROPID
Member type of validated readout::ROPID parameter.
geo::details::AbsIDtype< Index, ID > AbsIDtype
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (TPC set's).
constexpr int cmp(ROPID const &other) const
Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger.
unsigned short TPCsetID_t
Type for the ID number.
constexpr auto getIndex() const
Returns the index level Index of this type.
Class identifying a set of TPC sharing readout channels.
geo::ElementLevel::Level_t Level_t
auto & writeIndex()
Returns the index level Index of this type.
details::RelIDtype< A, ThisID_t > UpperID_t
Type of the ID A levels above this one.
ROPID & asROPID()
Conversion to ROPID (for convenience of notation).
constexpr auto getIndex() const
Returns the index level Index of this type.
static constexpr TPCsetID_t InvalidID
Special code for an invalid ID.
geo::details::RelIDtype< UpIndex, ID > RelIDtype
std::string writeToString(T const &value)
Write the argument into a string.
ParentID_t & parentID()
Return the parent ID of this one (a TPC set ID).
typename AbsIDtypeStruct< ID, Index >::type AbsIDtype
auto & deepestIndex()
Returns the deepest ID available (TPC set's).
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a TPC set ID).
constexpr ROPID(TPCsetID const &tpcsetid, ROPID_t r)
ParentID_t & parentID()
Return the parent ID of this one (a cryostat ID).
ROPID_t ROP
Index of the readout plane within its TPC set.
IDparameter< readout::TPCsetID > TPCsetID
Member type of validated readout::TPCsetID parameter.
constexpr ROPID const & asROPID() const
Conversion to ROPID (for convenience of notation).
constexpr CryostatID const & asCryostatID() const
Conversion to CryostatID (for convenience of notation).
Definition of data types for geometry description.
constexpr bool operator==(TPCsetID const &a, TPCsetID const &b)
Comparison: the IDs point to the same TPC set (validity is ignored)
constexpr auto getRelIndex() const
Returns the index Above levels higher than Level.
Class identifying a set of planes sharing readout channels.
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
constexpr TPCsetID(CryostatID_t c, TPCsetID_t s)
Constructor: TPC set with index s in the cryostat index c.
constexpr TPCsetID const & asConstTPCsetID()
Conversion to TPCsetID (for convenience of notation).
unsigned int CryostatID_t
Type for the ID number.
static constexpr Level_t TPCset
TPCsetID & asTPCsetID()
Conversion to TPCsetID (for convenience of notation).
constexpr auto getAbsIDindex(ID const &id)
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a cryostat ID).
constexpr ROPID const & asConstROPID()
Conversion to ROPID (for convenience of notation).
static constexpr TPCsetID_t getInvalidID()
Return the value of the invalid TPC ID as a r-value.
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (readout plane's).
void ParentID_t
Type of the parent ID (none!).
constexpr ROPID(CryostatID_t c, TPCsetID_t s, ROPID_t r)
auto & writeIndex()
Returns the index level Index of this type.
constexpr int cmp(CryostatID const &other) const
Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger.
static constexpr ROPID_t InvalidID
Special code for an invalid ID.
constexpr bool operator!=(TPCsetID const &a, TPCsetID const &b)
Comparison: the IDs point to different TPC sets (validity is ignored)
std::string writeToString(T const &value)
static constexpr Level_t ReadoutPlane
geo::CryostatID CryostatID
constexpr TPCsetID const & asTPCsetID() const
Conversion to TPCsetID (for convenience of notation).
The data type to uniquely identify a cryostat.