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); }
77 template <std::
size_t L>
81 template <std::
size_t A>
87 = std::numeric_limits<TPCsetID_t>::max();
109 explicit operator std::string()
const {
return toString(); }
122 template <std::
size_t Index = 0U>
125 template <std::
size_t Index = 0U>
128 template <std::
size_t Above>
175 template <std::
size_t L>
179 template <std::
size_t A>
188 constexpr
ROPID() =
default;
205 explicit operator std::string()
const {
return toString(); }
218 template <std::
size_t Index = 0U>
221 template <std::
size_t Index = 0U>
224 template <std::
size_t Above>
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.
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
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.
static constexpr int ThreeWayComparison(T a, T b)
Returns < 0 if a < b, 0 if a == b, > 0 if a > b.
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).
static constexpr Level_t NLevels
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 ROPID()=default
Default constructor: an invalid plane ID.
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).
static constexpr auto Level
Level of this element.
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.
constexpr CryostatID()=default
Default constructor: an invalid cryostat.
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 constexpr Level_t Channel
std::string toString() const
Human-readable representation of the ROP ID.
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).
static constexpr auto Level
Level of this element.
then echo File list $list not found else cat $list while read file do echo $file sed s
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).
constexpr TPCsetID()=default
Default constructor: an invalid TPC set ID.
void ParentID_t
Type of the parent ID (none!).
std::string toString() const
Human-readable representation of the TPC set ID.
static constexpr Level_t Cryostat
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
constexpr TPCsetID const & asTPCsetID() const
Conversion to TPCsetID (for convenience of notation).
The data type to uniquely identify a cryostat.