LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
geo_types.h
Go to the documentation of this file.
1 
13 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_H
14 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_H
15 
16 // C++ standard libraries
17 #include <climits>
18 #include <cmath>
19 #include <iosfwd> // std::ostream
20 #include <limits> // std::numeric_limits<>
21 #include <sstream>
22 #include <string>
23 #include <tuple>
24 #include <type_traits>
25 
26 namespace geo::details {
28  template <typename T>
29  std::string writeToString(T const& value);
30 
31  template <typename T, typename = void>
32  struct has_parent : std::false_type {};
33 
34  template <typename T>
35  struct has_parent<T, std::void_t<typename T::ParentID_t>> : std::true_type {};
36 
38  template <typename ID>
40 
41  template <typename T>
42  constexpr auto index_impl(std::size_t& index)
43  {
44  if constexpr (has_parent<T>::value) { index_impl<typename T::ParentID_t>(++index); }
45  }
46 
47  template <typename T>
48  constexpr auto const index_for()
49  {
50  std::size_t index{};
51  index_impl<T>(index);
52  return index;
53  }
54 
55  template <typename ID, std::size_t Index, typename = void>
57 
58  template <std::size_t Index, typename ID>
60 
61  template <std::size_t Index, typename ID>
62  constexpr auto getAbsIDindex(ID const& id)
63  {
64  static_assert(Index <= ID::Level, "Index not available for this type.");
65  if constexpr (Index == ID::Level)
66  return id.deepestIndex();
67  else
68  return getAbsIDindex<Index>(id.parentID());
69  }
70 
71  template <std::size_t Index, typename ID>
72  auto& getAbsIDindex(ID& id)
73  {
74  static_assert(Index <= ID::Level, "Index not available for this type.");
75  if constexpr (Index == ID::Level)
76  return id.deepestIndex();
77  else
78  return getAbsIDindex<Index>(id.parentID());
79  }
80 
81 } // namespace geo::details
82 
83 // BEGIN Geometry --------------------------------------------------------------
115 namespace geo {
117 
118  // --- BEGIN -- Geometry enumerators -----------------------------------------
121 
122  enum class Coordinate { X, Y, Z };
123  std::ostream& operator<<(std::ostream& os, Coordinate);
124  constexpr int to_int(Coordinate const coord) noexcept
125  {
126  return static_cast<int>(coord);
127  }
128 
130  typedef enum _plane_proj {
131  kU,
132  kV,
133  kW,
134  kZ = kW,
135  kY,
136  kX,
137  k3D,
139  } View_t;
140 
141  typedef enum _plane_orient {
144  } Orient_t;
145 
146  typedef enum _plane_sigtype {
150  } SigType_t;
151 
155  enum class DriftSign {
156  Unknown,
157  Positive,
158  Negative
159  };
160  std::ostream& operator<<(std::ostream& os, DriftSign);
161 
162  constexpr int to_int(DriftSign const sign)
163  {
164  switch (sign) {
165  case DriftSign::Positive: return 1;
166  case DriftSign::Negative: return -1;
167  case DriftSign::Unknown: break;
168  }
169  return 0;
170  }
171 
172  struct DriftAxis {
175  };
176  bool operator==(DriftAxis a, DriftAxis b);
177  bool operator!=(DriftAxis a, DriftAxis b);
178  std::ostream& operator<<(std::ostream& os, DriftAxis);
179 
181  // --- END -- Geometry enumerators -------------------------------------------
182 
185 
187  struct CryostatID {
188  using CryostatID_t = unsigned int;
189 
190  // not constexpr because we would need an implementation file to define it
192  static constexpr CryostatID_t InvalidID = std::numeric_limits<CryostatID_t>::max();
193 
194  bool isValid = false;
195  CryostatID_t Cryostat = InvalidID;
196 
198  constexpr CryostatID() = default;
199 
201  explicit constexpr CryostatID(CryostatID_t c) : isValid(true), Cryostat(c) {}
202 
204  constexpr CryostatID(CryostatID_t c, bool valid) : isValid(valid), Cryostat(c) {}
205 
206  static constexpr auto first() { return CryostatID{0, true}; }
209 
211  explicit constexpr operator bool() const { return isValid; }
212 
214  void setValidity(bool valid) { isValid = valid; }
215 
217  void markValid() { setValidity(true); }
218 
220  void markInvalid() { setValidity(false); }
222 
223  // comparison operators are out of class
224 
226  std::string toString() const { return details::writeToString(*this); }
228  explicit operator std::string() const { return toString(); }
230 
231  // the following four methods are useful for (templated) abstraction
233  constexpr auto const& deepestIndex() const { return Cryostat; }
235  auto& deepestIndex() { return Cryostat; }
237  template <std::size_t Index>
238  constexpr auto getIndex() const;
239 
241  static constexpr auto Level = details::index_for<CryostatID>();
242 
244  static constexpr CryostatID_t getInvalidID() { return CryostatID::InvalidID; }
245 
246  }; // struct CryostatID
247 
249  struct OpDetID : public CryostatID {
250  using OpDetID_t = unsigned int;
251 
253 
254  // not constexpr because we would need an implementation file to define it
256  static constexpr OpDetID_t InvalidID = std::numeric_limits<OpDetID_t>::max();
257 
259  OpDetID_t OpDet = InvalidID;
260 
262  constexpr OpDetID() = default;
263 
266  constexpr OpDetID(CryostatID const& cryoid, OpDetID_t o) : CryostatID(cryoid), OpDet(o) {}
267 
269  constexpr OpDetID(CryostatID_t c, OpDetID_t o) : CryostatID(c), OpDet(o) {}
270 
271  static constexpr OpDetID first() { return OpDetID{CryostatID::first(), 0}; }
272 
273  // comparison operators are out of class
274 
276  std::string toString() const { return details::writeToString(*this); }
278  explicit operator std::string() const { return toString(); }
280 
281  // the following two methods are useful for (templated) abstraction
283  constexpr auto const& deepestIndex() const { return OpDet; }
285  auto& deepestIndex() { return OpDet; }
287  constexpr ParentID_t const& parentID() const { return *this; }
288  constexpr ParentID_t& parentID() { return *this; }
290  template <std::size_t Index>
291  constexpr auto getIndex() const;
292 
294  constexpr CryostatID const& asCryostatID() const { return parentID(); }
295  constexpr CryostatID& asCryostatID() { return parentID(); }
296 
298  static constexpr auto Level = details::index_for<OpDetID>();
299 
301  static constexpr OpDetID_t getInvalidID() { return OpDetID::InvalidID; }
302 
303  }; // struct OpDetID
304 
306  struct TPCID : public CryostatID {
307  using TPCID_t = unsigned int;
308 
310 
311  // not constexpr because we would need an implementation file to define it
313  static constexpr TPCID_t InvalidID = std::numeric_limits<TPCID_t>::max();
314 
315  TPCID_t TPC = InvalidID;
316 
318  constexpr TPCID() = default;
319 
321  constexpr TPCID(CryostatID const& cryoid, TPCID_t t) : CryostatID(cryoid), TPC(t) {}
322 
324  constexpr TPCID(CryostatID_t c, TPCID_t t) : CryostatID(c), TPC(t) {}
325 
326  TPCID next() const { return {Cryostat, TPC + 1}; }
327 
328  static constexpr auto first() { return TPCID{CryostatID::first(), 0}; }
329  static constexpr auto first(CryostatID const& id) { return TPCID{id, 0}; }
330 
331  // comparison operators are out of class
332 
334  std::string toString() const { return details::writeToString(*this); }
336  explicit operator std::string() const { return toString(); }
338 
339  // the following two methods are useful for (templated) abstraction
341  constexpr auto const& deepestIndex() const { return TPC; }
343  auto& deepestIndex() { return TPC; }
345  constexpr ParentID_t const& parentID() const { return *this; }
346  constexpr ParentID_t& parentID() { return *this; }
348  template <std::size_t Index>
349  constexpr auto getIndex() const;
350 
352  constexpr CryostatID const& asCryostatID() const { return parentID(); }
353  constexpr CryostatID& asCryostatID() { return parentID(); }
354 
356  static constexpr auto Level = details::index_for<TPCID>();
357 
359  static constexpr TPCID_t getInvalidID() { return TPCID::InvalidID; }
360 
361  }; // struct TPCID
362 
364  struct PlaneID : public TPCID {
365  using PlaneID_t = unsigned int;
366 
367  using ParentID_t = TPCID;
368 
369  // not constexpr because we would need an implementation file to define it
371  static constexpr PlaneID_t InvalidID = std::numeric_limits<PlaneID_t>::max();
372 
373  PlaneID_t Plane = InvalidID;
374 
376  constexpr PlaneID() = default;
377 
379  constexpr PlaneID(TPCID const& tpcid, PlaneID_t p) : TPCID(tpcid), Plane(p) {}
380 
382  constexpr PlaneID(CryostatID_t c, TPCID_t t, PlaneID_t p) : TPCID(c, t), Plane(p) {}
383 
384  static constexpr auto first() { return PlaneID{TPCID::first(), 0}; }
385  static constexpr auto first(CryostatID const& id) { return PlaneID{TPCID::first(id), 0}; }
386  static constexpr auto first(TPCID const& id) { return PlaneID{id, 0}; }
387 
388  // comparison operators are out of class
389 
391  std::string toString() const { return details::writeToString(*this); }
393  explicit operator std::string() const { return toString(); }
395 
396  // the following two methods are useful for (templated) abstraction
398  constexpr auto const& deepestIndex() const { return Plane; }
400  auto& deepestIndex() { return Plane; }
402  constexpr ParentID_t const& parentID() const { return *this; }
403  constexpr ParentID_t& parentID() { return *this; }
405  template <std::size_t Index>
406  constexpr auto getIndex() const;
407 
409  constexpr TPCID const& asTPCID() const { return parentID(); }
410  constexpr TPCID& asTPCID() { return parentID(); }
411 
413  static constexpr auto Level = details::index_for<PlaneID>();
414 
416  static constexpr PlaneID_t getInvalidID() { return PlaneID::InvalidID; }
417 
418  }; // struct PlaneID
419 
420  // The data type to uniquely identify a code wire segment.
421  struct WireID : public PlaneID {
422  using WireID_t = unsigned int;
423 
424  using ParentID_t = PlaneID;
425 
426  // not constexpr because we would need an implementation file to define it
428  static constexpr WireID_t InvalidID = std::numeric_limits<WireID_t>::max();
429 
430  WireID_t Wire = InvalidID;
431 
433  constexpr WireID() = default;
434 
436  constexpr WireID(PlaneID const& planeid, WireID_t w) : PlaneID(planeid), Wire(w) {}
437 
439  constexpr WireID(CryostatID_t c, TPCID_t t, PlaneID_t p, WireID_t w) : PlaneID(c, t, p), Wire(w)
440  {}
441 
442  static constexpr auto first() { return WireID{PlaneID::first(), 0}; }
443  static constexpr auto first(CryostatID const& id) { return WireID{PlaneID::first(id), 0}; }
444  static constexpr auto first(TPCID const& id) { return WireID{PlaneID::first(id), 0}; }
445  static constexpr auto first(PlaneID const& id) { return WireID{id, 0}; }
446 
448  std::string toString() const { return details::writeToString(*this); }
450  explicit operator std::string() const { return toString(); }
452 
453  // the following two methods are useful for (templated) abstraction
455  constexpr auto const& deepestIndex() const { return Wire; }
457  auto& deepestIndex() { return Wire; }
459  constexpr ParentID_t const& parentID() const { return *this; }
460  constexpr ParentID_t& parentID() { return *this; }
462  template <std::size_t Index>
463  constexpr auto getIndex() const;
464 
466  constexpr PlaneID const& asPlaneID() const { return parentID(); }
467  constexpr PlaneID& asPlaneID() { return parentID(); }
468 
471  constexpr PlaneID const& planeID() const { return *this; }
472 
474  static constexpr auto Level = details::index_for<WireID>();
475 
477  static constexpr WireID_t getInvalidID() { return WireID::InvalidID; }
478 
479  }; // struct WireID
480 
481  //----------------------------------------------------------------------------
482  //--- ID output operators
483  //---
485  inline std::ostream& operator<<(std::ostream& out, CryostatID const& cid)
486  {
487  out << "C:" << cid.Cryostat;
488  return out;
489  }
490 
492  inline std::ostream& operator<<(std::ostream& out, OpDetID const& oid)
493  {
494  out << oid.parentID() << " O:" << oid.OpDet;
495  return out;
496  }
497 
499  inline std::ostream& operator<<(std::ostream& out, TPCID const& tid)
500  {
501  out << tid.parentID() << " T:" << tid.TPC;
502  return out;
503  }
504 
506  inline std::ostream& operator<<(std::ostream& out, PlaneID const& pid)
507  {
508  out << pid.parentID() << " P:" << pid.Plane;
509  return out;
510  }
511 
513  inline std::ostream& operator<<(std::ostream& out, WireID const& wid)
514  {
515  out << wid.parentID() << " W:" << wid.Wire;
516  return out;
517  }
518 
520  // Geometry element IDs
521 
522  //----------------------------------------------------------------------------
523  //--- ID comparison operators
524  //---
525 
529 
531  inline constexpr bool operator==(CryostatID const& a, CryostatID const& b)
532  {
533  return a.Cryostat == b.Cryostat;
534  }
535 
537  inline constexpr bool operator!=(CryostatID const& a, CryostatID const& b)
538  {
539  return !(a == b);
540  }
541 
543  inline constexpr bool operator<(CryostatID const& a, CryostatID const& b)
544  {
545  return a.Cryostat < b.Cryostat;
546  }
547 
548  template <typename BaseID, typename GeoID>
549  static constexpr bool is_base_of_strict{std::is_base_of<BaseID, GeoID>{} &&
550  !std::is_same<BaseID, GeoID>{}};
551 
553  template <typename GeoID>
554  inline constexpr std::enable_if_t<is_base_of_strict<CryostatID, GeoID>, bool> operator==(
555  GeoID const& a,
556  GeoID const& b)
557  {
558  return std::tie(a.parentID(), a.deepestIndex()) == std::tie(b.parentID(), b.deepestIndex());
559  }
560 
562  template <typename GeoID>
563  inline constexpr std::enable_if_t<is_base_of_strict<CryostatID, GeoID>, bool> operator!=(
564  GeoID const& a,
565  GeoID const& b)
566  {
567  return !(a == b);
568  }
569 
571  template <typename GeoID>
572  inline constexpr std::enable_if_t<is_base_of_strict<CryostatID, GeoID>, bool> operator<(
573  GeoID const& a,
574  GeoID const& b)
575  {
576  return std::tie(a.parentID(), a.deepestIndex()) < std::tie(b.parentID(), b.deepestIndex());
577  }
578 
580 
581  //----------------------------------------------------------------------------
583  double y;
584  double z;
585  unsigned int TPC;
586 
587  // In APAs, we want this to increase in the direction wireID
588  // index increases in: moving inward vertically towards y=0
589  bool operator<(WireIDIntersection const& otherIntersect) const
590  {
591  return std::abs(y) > std::abs(otherIntersect.y);
592  }
593 
594  static constexpr WireIDIntersection invalid()
595  {
596  return {
597  std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity(), -1u};
598  }
599  };
600 
601  //----------------------------------------------------------------------------
603  std::string SignalTypeName(geo::SigType_t sigType);
604 
605  //----------------------------------------------------------------------------
606 
607 } // namespace geo
609 // END Geometry ----------------------------------------------------------------
610 
611 namespace geo::details {
612 
613  //--------------------------------------------------------------------------
614  template <typename ID, std::size_t Index, typename /* = void */>
615  struct AbsIDtypeStruct {
616  static_assert(Index <= ID::Level, "Requested ID index is not available.");
618  };
619 
620  template <typename ID, std::size_t Index>
621  struct AbsIDtypeStruct<ID, Index, std::enable_if_t<(Index == ID::Level)>> {
622  using type = ID;
623  };
624 
625  //--------------------------------------------------------------------------
626  template <typename T>
627  inline std::string writeToString(T const& value)
628  {
629  std::ostringstream sstr;
630  sstr << value;
631  return sstr.str();
632  }
633 
634  //--------------------------------------------------------------------------
635 
636 } // namespace geo::details
637 
638 //------------------------------------------------------------------------------
639 //--- template implementation
640 //------------------------------------------------------------------------------
641 template <std::size_t Index>
642 constexpr auto geo::CryostatID::getIndex() const
643 {
644  static_assert(Index <= Level, "This ID type does not have the requested Index level.");
645  return details::getAbsIDindex<Index>(*this);
646 }
647 
648 //------------------------------------------------------------------------------
649 template <std::size_t Index>
650 constexpr auto geo::OpDetID::getIndex() const
651 {
652  static_assert(Index <= Level, "This ID type does not have the requested Index level.");
653  return details::getAbsIDindex<Index>(*this);
654 }
655 
656 //------------------------------------------------------------------------------
657 template <std::size_t Index>
658 constexpr auto geo::TPCID::getIndex() const
659 {
660  static_assert(Index <= Level, "This ID type does not have the requested Index level.");
661  return details::getAbsIDindex<Index>(*this);
662 }
663 
664 //------------------------------------------------------------------------------
665 template <std::size_t Index>
666 constexpr auto geo::PlaneID::getIndex() const
667 {
668  static_assert(Index <= Level, "This ID type does not have the requested Index level.");
669  return details::getAbsIDindex<Index>(*this);
670 }
671 
672 //------------------------------------------------------------------------------
673 template <std::size_t Index>
674 constexpr auto geo::WireID::getIndex() const
675 {
676  static_assert(Index <= Level, "This ID type does not have the requested Index level.");
677  return details::getAbsIDindex<Index>(*this);
678 }
679 
680 //------------------------------------------------------------------------------
681 
682 #endif // LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_H
constexpr CryostatID(CryostatID_t c)
Constructor: valid ID of cryostat with index c.
Definition: geo_types.h:201
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
static constexpr OpDetID_t getInvalidID()
Return the value of the invalid optical detector ID as a r-value.
Definition: geo_types.h:301
DriftSign sign
Definition: geo_types.h:174
static constexpr auto first(TPCID const &id)
Definition: geo_types.h:444
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:650
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
Coordinate
Enumerate the possible plane projections.
Definition: geo_types.h:122
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:674
double z
z position of intersection
Definition: geo_types.h:584
static constexpr auto first(CryostatID const &id)
Definition: geo_types.h:443
static constexpr TPCID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:313
Who knows?
Definition: geo_types.h:149
_plane_orient
Enumerate the possible plane projections.
Definition: geo_types.h:141
constexpr PlaneID(TPCID const &tpcid, PlaneID_t p)
Constructor: plane with index p in the TPC identified by tpcid.
Definition: geo_types.h:379
constexpr ParentID_t & parentID()
Definition: geo_types.h:288
void setValidity(bool valid)
Sets the validity of the ID.
Definition: geo_types.h:214
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Planes which measure V.
Definition: geo_types.h:132
constexpr WireID(PlaneID const &planeid, WireID_t w)
Constructor: wire with index w in the plane identified by planeid.
Definition: geo_types.h:436
Unknown view.
Definition: geo_types.h:138
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
enum geo::_plane_orient Orient_t
Enumerate the possible plane projections.
constexpr bool operator<(CryostatID const &a, CryostatID const &b)
Order cryostats with increasing ID.
Definition: geo_types.h:543
_plane_sigtype
Enumerate the possible plane projections.
Definition: geo_types.h:146
auto & deepestIndex()
Returns the deepest ID available (plane&#39;s).
Definition: geo_types.h:400
Float_t Y
Definition: plot.C:37
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:365
Planes which measure X direction.
Definition: geo_types.h:136
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
bool operator==(geometry_element_iterator< Owner, Element, GEOIDITER > const &a, geometry_element_iterator< Owner, Element, GEOIDITER > const &b)
constexpr auto abs(T v)
Returns the absolute value of the argument.
constexpr TPCID & asTPCID()
Definition: geo_types.h:410
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:666
constexpr WireID(CryostatID_t c, TPCID_t t, PlaneID_t p, WireID_t w)
Constructor: wire with index w in cryostat index c, TPC index t, plane index p.
Definition: geo_types.h:439
Level
Definition: Level.h:13
bool operator<(WireIDIntersection const &otherIntersect) const
Definition: geo_types.h:589
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:195
static constexpr auto first(CryostatID const &id)
Definition: geo_types.h:329
STL namespace.
_plane_proj
Enumerate the possible plane projections.
Definition: geo_types.h:130
Planes which measure Z direction.
Definition: geo_types.h:134
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (plane&#39;s).
Definition: geo_types.h:398
static constexpr WireID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:428
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:430
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a cryostat ID).
Definition: geo_types.h:345
unsigned int TPC
TPC of intersection.
Definition: geo_types.h:585
constexpr ParentID_t & parentID()
Definition: geo_types.h:403
constexpr CryostatID & asCryostatID()
Definition: geo_types.h:295
typename AbsIDtypeStruct< typename ID::ParentID_t, Index >::type type
Definition: geo_types.h:617
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (wire&#39;s).
Definition: geo_types.h:455
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (OpDet&#39;s).
Definition: geo_types.h:283
auto & deepestIndex()
Returns the deepest ID available (TPC&#39;s).
Definition: geo_types.h:343
Planes which measure Y direction.
Definition: geo_types.h:135
constexpr CryostatID & asCryostatID()
Definition: geo_types.h:353
constexpr ParentID_t & parentID()
Definition: geo_types.h:460
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
constexpr TPCID(CryostatID_t c, TPCID_t t)
Constructor: TPC with index t in the cryostat index c.
Definition: geo_types.h:324
3-dimensional objects, potentially hits, clusters, prongs, etc.
Definition: geo_types.h:137
Float_t Z
Definition: plot.C:37
std::string writeToString(T const &value)
Write the argument into a string.
Definition: geo_types.h:627
static constexpr CryostatID_t getInvalidID()
Return the value of the invalid ID as a r-value.
Definition: geo_types.h:244
static constexpr auto first()
Definition: geo_types.h:442
static constexpr OpDetID first()
Definition: geo_types.h:271
Planes which measure U.
Definition: geo_types.h:131
constexpr bool isTopGeoElementID
Whether ID represents an element on top of the hierarchy.
Definition: geo_types.h:39
auto & deepestIndex()
Returns the deepest ID available (cryostat&#39;s).
Definition: geo_types.h:235
OpDetID_t OpDet
Index of the optical detector within its cryostat.
Definition: geo_types.h:259
typename AbsIDtypeStruct< ID, Index >::type AbsIDtype
Definition: geo_types.h:59
auto & deepestIndex()
Returns the deepest ID available (wire&#39;s).
Definition: geo_types.h:457
Planes that are in the horizontal plane.
Definition: geo_types.h:142
static constexpr TPCID_t getInvalidID()
Return the value of the invalid TPC ID as a r-value.
Definition: geo_types.h:359
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
static constexpr auto first()
Definition: geo_types.h:384
static constexpr auto first(TPCID const &id)
Definition: geo_types.h:386
Signal from induction planes.
Definition: geo_types.h:147
constexpr CryostatID const & asCryostatID() const
Conversion to CryostatID (for convenience of notation).
Definition: geo_types.h:294
Planes that are in the vertical plane (e.g. ArgoNeuT).
Definition: geo_types.h:143
static constexpr auto first(CryostatID const &id)
Definition: geo_types.h:385
std::ostream & operator<<(std::ostream &out, id_sentinel< ID > const &sentinel)
Definition: id_iterators.h:25
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
static constexpr bool is_base_of_strict
Comparison: the IDs point to the same cryostat (validity is ignored)
Definition: geo_types.h:549
constexpr CryostatID const & asCryostatID() const
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:352
Drift towards negative values.
static constexpr auto first()
Definition: geo_types.h:328
constexpr int to_int(Coordinate const coord) noexcept
Enumerate the possible plane projections.
Definition: geo_types.h:124
void markValid()
Sets the ID as valid.
Definition: geo_types.h:217
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:658
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:373
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:220
constexpr CryostatID(CryostatID_t c, bool valid)
Constructor: valid ID of cryostat with index c.
Definition: geo_types.h:204
double value
Definition: spectrum.C:18
constexpr auto getAbsIDindex(ID const &id)
Definition: geo_types.h:62
static constexpr auto first(PlaneID const &id)
Definition: geo_types.h:445
constexpr PlaneID & asPlaneID()
Definition: geo_types.h:467
constexpr PlaneID(CryostatID_t c, TPCID_t t, PlaneID_t p)
Constructor: plane with index p in the cryostat index c, TPC index t.
Definition: geo_types.h:382
static constexpr WireID_t getInvalidID()
Return the value of the invalid wire ID as a r-value.
Definition: geo_types.h:477
bool operator!=(geometry_element_iterator< Owner, Element, GEOIDITER > const &a, geometry_element_iterator< Owner, Element, GEOIDITER > const &b)
int sign(double val)
Definition: UtilFunc.cxx:104
Drift towards positive values.
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:188
DriftSign
Drift sign: positive or negative.
Definition: geo_types.h:155
unsigned int OpDetID_t
Type for the ID number.
Definition: geo_types.h:250
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a cryostat ID).
Definition: geo_types.h:287
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:307
static constexpr OpDetID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:256
double y
y position of intersection
Definition: geo_types.h:583
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a plane ID).
Definition: geo_types.h:459
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (TPC&#39;s).
Definition: geo_types.h:341
constexpr OpDetID(CryostatID const &cryoid, OpDetID_t o)
Definition: geo_types.h:266
constexpr ParentID_t & parentID()
Definition: geo_types.h:346
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:422
static constexpr WireIDIntersection invalid()
Definition: geo_types.h:594
static constexpr auto first()
Definition: geo_types.h:206
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
static constexpr CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:192
constexpr OpDetID(CryostatID_t c, OpDetID_t o)
Constructor: opdtical detector with index o in the cryostat index c
Definition: geo_types.h:269
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:133
constexpr PlaneID const & planeID() const
Definition: geo_types.h:471
static constexpr PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:371
TPCID next() const
Definition: geo_types.h:326
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:315
The data type to uniquely identify a optical detector.
Definition: geo_types.h:249
recob::tracking::Plane Plane
Definition: TrackState.h:17
Float_t X
Definition: plot.C:37
ROOT libraries.
auto & deepestIndex()
Returns the deepest ID available (OpDet&#39;s).
Definition: geo_types.h:285
static constexpr PlaneID_t getInvalidID()
Return the value of the invalid plane ID as a r-value.
Definition: geo_types.h:416
constexpr auto index_impl(std::size_t &index)
Definition: geo_types.h:42
Float_t w
Definition: plot.C:20
Coordinate coordinate
Definition: geo_types.h:173
constexpr TPCID(CryostatID const &cryoid, TPCID_t t)
Constructor: TPC with index t in the cryostat identified by cryoid.
Definition: geo_types.h:321
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:642
constexpr auto const index_for()
Definition: geo_types.h:48
Drift direction is unknown.
std::string SignalTypeName(SigType_t sigType)
Returns the name of the specified signal type.
Definition: geo_types.cxx:52
constexpr TPCID const & asTPCID() const
Conversion to PlaneID (for convenience of notation).
Definition: geo_types.h:409
The data type to uniquely identify a cryostat.
Definition: geo_types.h:187
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a TPC ID).
Definition: geo_types.h:402
Signal from collection planes.
Definition: geo_types.h:148
constexpr PlaneID const & asPlaneID() const
Conversion to WireID (for convenience of notation).
Definition: geo_types.h:466
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (cryostat&#39;s).
Definition: geo_types.h:233