8 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_H 9 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_H 26 template <std::
size_t Index,
typename ID>
29 template <std::
size_t UpIndex,
typename ID>
32 template <std::
size_t Index,
typename ID>
34 {
return geo::details::getAbsIDindex<Index, ID>(id); }
36 template <std::
size_t Index,
typename ID>
38 {
return geo::details::getAbsIDindex<Index, ID>(id); }
51 static constexpr
Level_t ReadoutPlane = 2U;
77 template <std::
size_t L>
81 template <std::
size_t A>
122 template <std::
size_t Index = 0U>
123 constexpr
auto getIndex()
const;
125 template <std::
size_t Index = 0U>
128 template <std::
size_t Above>
129 constexpr
auto getRelIndex()
const;
143 return ThreeWayComparison(TPCset, other.
TPCset);
175 template <std::
size_t L>
179 template <std::
size_t A>
188 constexpr
ROPID() =
default;
218 template <std::
size_t Index = 0U>
219 constexpr
auto getIndex()
const;
221 template <std::
size_t Index = 0U>
224 template <std::
size_t Above>
225 constexpr
auto getRelIndex()
const;
239 return ThreeWayComparison(ROP, other.
ROP);
325 template <std::size_t
Index >
328 (
Index <=
Level,
"This ID type does not have the requested Index level.");
329 return details::getAbsIDindex<Index>(*this);
332 template <std::size_t
Index >
335 (
Index <=
Level,
"This ID type does not have the requested Index level.");
336 return details::getAbsIDindex<Index>(*this);
339 template <std::
size_t Above>
342 (Above <=
Level,
"This ID type does not have the requested Index level.");
343 return getIndex<
Level - Above>();
348 template <std::size_t
Index >
351 (
Index <=
Level,
"This ID type does not have the requested Index level.");
352 return details::getAbsIDindex<Index>(*this);
355 template <std::size_t
Index >
358 (
Index <=
Level,
"This ID type does not have the requested Index level.");
359 return details::getAbsIDindex<Index>(*this);
362 template <std::
size_t Above>
365 (Above <=
Level,
"This ID type does not have the requested Index level.");
366 return getIndex<
Level - Above>();
372 #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.
static void writeIndex(OutputList &ol)
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.
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).
static int max(int a, int b)
std::string toString() const
Human-readable representation of the ROP ID.
Definition of data types for geometry description.
string toString(const TVector3 &xyz, int w=9)
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!).
std::string toString() const
Human-readable representation of the TPC set ID.
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.