All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geo_types.h
Go to the documentation of this file.
1 /**
2  * @defgroup Geometry Detector geometry information
3  * @file larcoreobj/SimpleTypesAndConstants/geo_types.h
4  * @brief Definition of data types for geometry description.
5  * @author Brian Rebel (brebel@fnal.gov)
6  * @see larcoreobj/SimpleTypesAndConstants/geo_types.cxx
7  * @ingroup Geometry
8  *
9  * This library depends only on standard C++.
10  *
11  */
12 
13 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_H
14 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_H
15 
16 
17 // C++ standard libraries
18 #include <climits>
19 #include <cmath>
20 #include <string>
21 #include <sstream>
22 #include <iosfwd> // std::ostream
23 #include <limits> // std::numeric_limits<>
24 
25 
26 namespace geo {
27  namespace details {
28  /// Write the argument into a string
29  template <typename T>
30  std::string writeToString(T const& value);
31 
32  /// Whether `ID` represents an element on top of the hierarchy.
33  template <typename ID>
34  constexpr bool isTopGeoElementID = std::is_void_v<typename ID::ParentID_t>;
35 
36  template <typename ID>
37  constexpr std::size_t geoElementLevel() {
38  if constexpr(isTopGeoElementID<ID>) return 0U;
39  else return geoElementLevel<typename ID::ParentID_t>() + 1U;
40  } // geoElementLevel()
41 
42  template <typename ID, std::size_t Index, typename = void>
44 
45  template <std::size_t Index, typename ID>
47 
48  template <typename ID, std::size_t UpIndex>
50 
51  template <std::size_t UpIndex, typename ID>
53 
54  template <std::size_t Index, typename ID>
55  constexpr auto getAbsIDindex(ID const& id)
56  {
57  static_assert(Index <= ID::Level, "Index not available for this type.");
58  if constexpr (Index == ID::Level) return id.deepestIndex();
59  else return getAbsIDindex<Index>(id.parentID());
60  }
61 
62  template <std::size_t Index, typename ID>
63  auto& getAbsIDindex(ID& id)
64  {
65  static_assert(Index <= ID::Level, "Index not available for this type.");
66  if constexpr (Index == ID::Level) return id.deepestIndex();
67  else return getAbsIDindex<Index>(id.parentID());
68  }
69 
70  template <std::size_t UpIndex, typename ID>
71  auto getRelIDindex(ID const& id)
72  {
73  static_assert
74  (UpIndex <= ID::Level, "Index not available for this type.");
75  if constexpr (UpIndex == 0) return id.deepestIndex();
76  else return getRelIDindex<UpIndex - 1U>(id.parentID());
77  }
78 
79  } // namespace details
80 } // namespace geo
81 
82 // BEGIN Geometry --------------------------------------------------------------
83 /**
84  * @addtogroup Geometry
85  * @see `geo::GeometryCore`
86  *
87  * The description of the detector as seen by LArSoft is accessed via LArSoft
88  * "geometry system".
89  *
90  * A high level explanation of the geometry description is present in the
91  * official [LArSoft collaboration web site](http://larsoft.org), at the bottom
92  * of which further sources are detailed.
93  *
94  * The geometry system revolves around the `geo::GeometryCore` service provider,
95  * which is the hub to access all the geometry information.
96  * The information accessible via this interface include:
97  * * geometric description of the TPC components (wires, cryostats...)
98  * * geometric description of the optical detectors
99  * * geometric description of the "auxiliary" detectors (i.e. every detector
100  * which is not the two above)
101  * * a ROOT representation of the detector geometry
102  * * relation between readout channels and physical components (especially TPC
103  * readout channels vs. wires)
104  * * tools to navigate this information
105  * * ... and a load more stuff.
106  *
107  * The service provider can be obtained including `larcore/Geometry/Geometry.h`
108  * header and calling:
109  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
110  * auto const& geom = *(lar::providerFrom<geo::Geometry>());
111  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112  *
113  */
114 /// @{
115 namespace geo {
116 
117  // --- BEGIN -- Geometry enumerators -----------------------------------------
118  /// @name Geometry enumerators
119  /// @{
120 
121  typedef enum coordinates {
122  kXCoord, ///< X coordinate.
123  kYCoord, ///< Y coordinate.
124  kZCoord ///< Z coordinate.
125  } Coord_t;
126 
127  /// Enumerate the possible plane projections
128  typedef enum _plane_proj {
129  kU, ///< Planes which measure U.
130  kV, ///< Planes which measure V.
131  kW, ///< Planes which measure W (third view for Bo, MicroBooNE, etc).
132  kZ=kW, ///< Planes which measure Z direction.
133  kY, ///< Planes which measure Y direction.
134  kX, ///< Planes which measure X direction.
135  k3D, ///< 3-dimensional objects, potentially hits, clusters, prongs, etc.
136  kUnknown ///< Unknown view.
137  } View_t;
138 
139  typedef enum _plane_orient {
140  kHorizontal, ///< Planes that are in the horizontal plane.
141  kVertical ///< Planes that are in the vertical plane (e.g. ArgoNeuT).
142  } Orient_t;
143 
144  typedef enum _plane_sigtype {
145  kInduction, ///< Signal from induction planes.
146  kCollection, ///< Signal from collection planes.
147  kMysteryType ///< Who knows?
148  } SigType_t;
149 
150 
151  /**
152  * @brief Drift direction: positive or negative
153  *
154  * Do not use this type to distinguish different drift axes: e.g., negative
155  * x drift and negative z drift are both by `kNeg`.
156  */
157  typedef enum driftdir {
158  kUnknownDrift, ///< Drift direction is unknown.
159  kPos, ///< Drift towards positive values.
160  kNeg, ///< Drift towards negative values.
161  kPosX = kPos, ///< Drift towards positive X values.
162  kNegX = kNeg ///< Drift towards negative X values.
164 
165 
166  /// Numerical description of geometry element "level".
167  /// The "detector" level is noticeably missing.
168  struct ElementLevel {
169 
170  using Level_t = std::size_t;
171 
172  static constexpr Level_t Cryostat = 0U;
173  static constexpr Level_t OpDet = 1U;
174  static constexpr Level_t TPC = 1U;
175  static constexpr Level_t Plane = 2U;
176  static constexpr Level_t Wire = 3U;
177  static constexpr Level_t NLevels = 4U;
178 
179  }; // struct ElementLevel
180 
181 
182  /// @}
183  // --- END -- Geometry enumerators -------------------------------------------
184 
185 
186  /// @{
187  /// @name Geometry element IDs
188 
189  /// The data type to uniquely identify a cryostat.
190  struct CryostatID {
191  using CryostatID_t = unsigned int; ///< Type for the ID number.
192 
193  using ThisID_t = CryostatID; ///< Type of this ID.
194  using ParentID_t = void; ///< Type of the parent ID (none!).
195 
196  /// Type of the ID with the specified level `L`.
197  template <std::size_t L>
199 
200  /// Type of the ID `A` levels above this one.
201  template <std::size_t A>
203 
204 
205  // not constexpr because we would need an implementation file to define it
206  /// Special code for an invalid ID.
207  static constexpr CryostatID_t InvalidID
208  = std::numeric_limits<CryostatID_t>::max();
209 
210 
211  bool isValid = false;///< Whether this ID points to a valid element.
212  CryostatID_t Cryostat = InvalidID; ///< Index of cryostat.
213 
214  /// Default constructor: an invalid cryostat.
215  constexpr CryostatID() = default;
216 
217  /// Constructor: valid ID of cryostat with index c
218  explicit constexpr CryostatID(CryostatID_t c): isValid(true), Cryostat(c) {}
219 
220  /// Constructor: valid ID of cryostat with index c
221  constexpr CryostatID(CryostatID_t c, bool valid)
222  : isValid(valid), Cryostat(c) {}
223 
224  /// @{
225  /// @name ID validity
226 
227  /// Returns true if the ID is valid
228  explicit constexpr operator bool() const { return isValid; }
229 
230  /// Returns true if the ID is not valid
231  constexpr bool operator! () const { return !isValid; }
232 
233  /// Sets the validity of the ID.
234  void setValidity(bool valid) { isValid = valid; }
235 
236  /// Sets the ID as valid.
237  void markValid() { setValidity(true); }
238 
239  /// Sets the ID as invalid.
240  void markInvalid() { setValidity(false); }
241  /// @}
242 
243  // comparison operators are out of class
244 
245  //@{
246  /// Human-readable representation of the cryostat ID.
247  std::string toString() const { return details::writeToString(*this); }
248  explicit operator std::string() const { return toString(); }
249  //@}
250 
251  // the following four methods are useful for (templated) abstraction
252  /// Returns the value of the deepest ID available (cryostat's).
253  constexpr auto const& deepestIndex() const { return Cryostat; }
254  /// Returns the deepest ID available (cryostat's).
255  auto& deepestIndex() { return Cryostat; }
256  /// Return the parent ID of this one (void).
257  constexpr ParentID_t parentID() const {}
258  /// Return the parent ID of this one (void).
260  /// Returns the index level `Index` of this type.
261  template <std::size_t Index = 0U>
262  constexpr auto getIndex() const;
263  /// Returns the index level `Index` of this type.
264  template <std::size_t Index = 0U>
265  auto& writeIndex();
266  /// Returns the index `Above` levels higher than `Level`.
267  template <std::size_t Above>
268  constexpr auto getRelIndex() const;
269 
270  /// Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger
271  constexpr int cmp(CryostatID const& other) const
272  { return ThreeWayComparison(deepestIndex(), other.deepestIndex()); }
273 
274  /// Conversion to CryostatID (for convenience of notation).
275  constexpr CryostatID const& asCryostatID() const { return *this; }
276  /// Conversion to CryostatID (for convenience of notation).
277  CryostatID& asCryostatID() { return *this; }
278  /// Conversion to CryostatID (for convenience of notation).
279  constexpr CryostatID const& asConstCryostatID() { return *this; }
280 
281  /// Level of this element.
282  static constexpr auto Level = geo::ElementLevel::Cryostat;
283 
284  /// Return the value of the invalid ID as a r-value
285  static constexpr CryostatID_t getInvalidID()
286  { return CryostatID::InvalidID; }
287 
288  /// Returns < 0 if a < b, 0 if a == b, > 0 if a > b
289  template <typename T>
290  static constexpr int ThreeWayComparison(T a, T b)
291  { return (a == b)? 0: ((a < b)? -1: +1); }
292 
293  }; // struct CryostatID
294 
295 
296  /// The data type to uniquely identify a optical detector.
297  struct OpDetID: public CryostatID {
298  using OpDetID_t = unsigned int; ///< Type for the ID number.
299 
300  using ThisID_t = OpDetID; ///< Type of this ID.
301  using ParentID_t = CryostatID; ///< Type of the parent ID.
302 
303  /// Type of the ID with the specified level `L`.
304  template <std::size_t L>
306 
307  /// Type of the ID `A` levels above this one.
308  template <std::size_t A>
310 
311 
312  // not constexpr because we would need an implementation file to define it
313  /// Special code for an invalid ID.
314  static constexpr OpDetID_t InvalidID
315  = std::numeric_limits<OpDetID_t>::max();
316 
317 
318  /// Index of the optical detector within its cryostat.
320 
321  /// Default constructor: an invalid optical detector ID.
322  constexpr OpDetID() = default;
323 
324  /// Constructor: optical detector with index `o` in the cryostat identified
325  /// by `cryoid`
326  constexpr OpDetID(CryostatID const& cryoid, OpDetID_t o)
327  : CryostatID(cryoid), OpDet(o) {}
328 
329  /// Constructor: opdtical detector with index `o` in the cryostat index `c`
330  constexpr OpDetID(CryostatID_t c, OpDetID_t o): CryostatID(c), OpDet(o) {}
331 
332  // comparison operators are out of class
333 
334  //@{
335  /// Human-readable representation of the optical detector ID.
336  std::string toString() const { return details::writeToString(*this); }
337  explicit operator std::string() const { return toString(); }
338  //@}
339 
340  // the following two methods are useful for (templated) abstraction
341  /// Returns the value of the deepest ID available (OpDet's).
342  constexpr auto const& deepestIndex() const { return OpDet; }
343  /// Returns the deepest ID available (OpDet's).
344  auto& deepestIndex() { return OpDet; }
345  /// Return the parent ID of this one (a cryostat ID).
346  constexpr ParentID_t const& parentID() const { return *this; }
347  /// Return the parent ID of this one (a cryostat ID).
348  ParentID_t& parentID() { return *this; }
349  /// Returns the index level `Index` of this type.
350  template <std::size_t Index = 0U>
351  constexpr auto getIndex() const;
352  /// Returns the index level `Index` of this type.
353  template <std::size_t Index = 0U>
354  auto& writeIndex();
355  /// Returns the index `Above` levels higher than `Level`.
356  template <std::size_t Above>
357  constexpr auto getRelIndex() const;
358 
359  /// Conversion to OpDetID (for convenience of notation).
360  constexpr OpDetID const& asOpDetID() const { return *this; }
361  /// Conversion to OpDetID (for convenience of notation).
362  OpDetID& asOpDetID() { return *this; }
363  /// Conversion to OpDetID (for convenience of notation).
364  constexpr OpDetID const& asConstOpDetID() { return *this; }
365 
366  /// Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger
367  constexpr int cmp(OpDetID const& other) const
368  {
369  int cmp_res = CryostatID::cmp(other);
370  if (cmp_res == 0) // same cryostat: compare optical detectors
371  return ThreeWayComparison(deepestIndex(), other.deepestIndex());
372  else // return the order of cryostats
373  return cmp_res;
374  } // cmp()
375 
376  /// Level of this element.
377  static constexpr auto Level = geo::ElementLevel::OpDet;
378 
379  /// Return the value of the invalid optical detector ID as a r-value
380  static constexpr OpDetID_t getInvalidID() { return OpDetID::InvalidID; }
381 
382  }; // struct OpDetID
383 
384 
385  /// The data type to uniquely identify a TPC.
386  struct TPCID: public CryostatID {
387  using TPCID_t = unsigned int; ///< Type for the ID number.
388 
389  using ThisID_t = TPCID; ///< Type of this ID.
390  using ParentID_t = CryostatID; ///< Type of the parent ID.
391 
392  /// Type of the ID with the specified level `L`.
393  template <std::size_t L>
395 
396  /// Type of the ID `A` levels above this one.
397  template <std::size_t A>
399 
400 
401  // not constexpr because we would need an implementation file to define it
402  /// Special code for an invalid ID.
403  static constexpr TPCID_t InvalidID = std::numeric_limits<TPCID_t>::max();
404 
405 
406  TPCID_t TPC = InvalidID; ///< Index of the TPC within its cryostat.
407 
408  /// Default constructor: an invalid TPC ID.
409  constexpr TPCID() = default;
410 
411  /// Constructor: TPC with index t in the cryostat identified by cryoid
412  constexpr TPCID(CryostatID const& cryoid, TPCID_t t)
413  : CryostatID(cryoid), TPC(t) {}
414 
415  /// Constructor: TPC with index t in the cryostat index c
416  constexpr TPCID(CryostatID_t c, TPCID_t t): CryostatID(c), TPC(t) {}
417 
418  // comparison operators are out of class
419 
420  //@{
421  /// Human-readable representation of the TPC ID.
422  std::string toString() const { return details::writeToString(*this); }
423  explicit operator std::string() const { return toString(); }
424  //@}
425 
426  // the following two methods are useful for (templated) abstraction
427  /// Returns the value of the deepest ID available (TPC's).
428  constexpr auto const& deepestIndex() const { return TPC; }
429  /// Returns the deepest ID available (TPC's).
430  auto& deepestIndex() { return TPC; }
431  /// Return the parent ID of this one (a cryostat ID).
432  constexpr ParentID_t const& parentID() const { return *this; }
433  /// Return the parent ID of this one (a cryostat ID).
434  ParentID_t& parentID() { return *this; }
435  /// Returns the index level `Index` of this type.
436  template <std::size_t Index = 0U>
437  constexpr auto getIndex() const;
438  /// Returns the index level `Index` of this type.
439  template <std::size_t Index = 0U>
440  auto& writeIndex();
441  /// Returns the index `Above` levels higher than `Level`.
442  template <std::size_t Above>
443  constexpr auto getRelIndex() const;
444 
445  /// Conversion to TPCID (for convenience of notation).
446  constexpr TPCID const& asTPCID() const { return *this; }
447  /// Conversion to TPCID (for convenience of notation).
448  TPCID& asTPCID() { return *this; }
449  /// Conversion to TPCID (for convenience of notation).
450  constexpr TPCID const& asConstTPCID() { return *this; }
451 
452  /// Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger
453  constexpr int cmp(TPCID const& other) const
454  {
455  int cmp_res = CryostatID::cmp(other);
456  if (cmp_res == 0) // same cryostat: compare TPC
457  return ThreeWayComparison(deepestIndex(), other.deepestIndex());
458  else // return the order of cryostats
459  return cmp_res;
460  } // cmp()
461 
462  /// Level of this element.
463  static constexpr auto Level = geo::ElementLevel::TPC;
464 
465  /// Return the value of the invalid TPC ID as a r-value
466  static constexpr TPCID_t getInvalidID() { return TPCID::InvalidID; }
467 
468  }; // struct TPCID
469 
470 
471  /// The data type to uniquely identify a Plane.
472  struct PlaneID: public TPCID {
473  using PlaneID_t = unsigned int; ///< Type for the ID number.
474 
475  using ThisID_t = PlaneID; ///< Type of this ID.
476  using ParentID_t = TPCID; ///< Type of the parent ID.
477 
478  /// Type of the ID with the specified level `L`.
479  template <std::size_t L>
481 
482  /// Type of the ID `A` levels above this one.
483  template <std::size_t A>
485 
486 
487  // not constexpr because we would need an implementation file to define it
488  /// Special code for an invalid ID.
489  static constexpr PlaneID_t InvalidID
490  = std::numeric_limits<PlaneID_t>::max();
491 
492 
493  PlaneID_t Plane = InvalidID; ///< Index of the plane within its TPC.
494 
495  /// Default constructor: an invalid plane ID.
496  constexpr PlaneID() = default;
497 
498  /// Constructor: plane with index p in the TPC identified by tpcid
499  constexpr PlaneID(TPCID const& tpcid, PlaneID_t p)
500  : TPCID(tpcid), Plane(p) {}
501 
502  /// Constructor: plane with index p in the cryostat index c, TPC index t
504  : TPCID(c, t), Plane(p) {}
505 
506  // comparison operators are out of class
507 
508  //@{
509  /// Human-readable representation of the plane ID.
510  std::string toString() const { return details::writeToString(*this); }
511  explicit operator std::string() const { return toString(); }
512  //@}
513 
514  // the following two methods are useful for (templated) abstraction
515  /// Returns the value of the deepest ID available (plane's).
516  constexpr auto const& deepestIndex() const { return Plane; }
517  /// Returns the deepest ID available (plane's).
518  auto& deepestIndex() { return Plane; }
519  /// Return the parent ID of this one (a TPC ID).
520  constexpr ParentID_t const& parentID() const { return *this; }
521  /// Return the parent ID of this one (a TPC ID).
522  ParentID_t& parentID() { return *this; }
523  /// Returns the index level `Index` of this type.
524  template <std::size_t Index = 0U>
525  constexpr auto getIndex() const;
526  /// Returns the index level `Index` of this type.
527  template <std::size_t Index = 0U>
528  auto& writeIndex();
529  /// Returns the index `Above` levels higher than `Level`.
530  template <std::size_t Above>
531  constexpr auto getRelIndex() const;
532 
533  /// Conversion to PlaneID (for convenience of notation).
534  constexpr PlaneID const& asPlaneID() const { return *this; }
535  /// Conversion to PlaneID (for convenience of notation).
536  PlaneID& asPlaneID() { return *this; }
537  /// Conversion to PlaneID (for convenience of notation).
538  constexpr PlaneID const& asConstPlaneID() { return *this; }
539 
540  /// Returns < 0 if this is smaller than other, 0 if equal, > 0 if larger
541  constexpr int cmp(PlaneID const& other) const
542  {
543  int cmp_res = TPCID::cmp(other);
544  if (cmp_res == 0) // same TPC: compare plane
545  return ThreeWayComparison(deepestIndex(), other.deepestIndex());
546  else // return the order of planes
547  return cmp_res;
548  } // cmp()
549 
550  /// Level of this element.
551  static constexpr auto Level = geo::ElementLevel::Plane;
552 
553  /// Return the value of the invalid plane ID as a r-value
554  static constexpr PlaneID_t getInvalidID() { return PlaneID::InvalidID; }
555 
556  }; // struct PlaneID
557 
558 
559  // The data type to uniquely identify a code wire segment.
560  struct WireID: public PlaneID {
561  using WireID_t = unsigned int; ///< Type for the ID number.
562 
563  using ThisID_t = WireID; ///< Type of this ID.
564  using ParentID_t = PlaneID; ///< Type of the parent ID.
565 
566  /// Type of the ID with the specified level `L`.
567  template <std::size_t L>
569 
570  /// Type of the ID `A` levels above this one.
571  template <std::size_t A>
573 
574 
575  // not constexpr because we would need an implementation file to define it
576  /// Special code for an invalid ID.
577  static constexpr WireID_t InvalidID = std::numeric_limits<WireID_t>::max();
578 
579 
580  WireID_t Wire = InvalidID; ///< Index of the wire within its plane.
581 
582  /// Default constructor: an invalid TPC ID.
583  constexpr WireID() = default;
584 
585  /// Constructor: wire with index w in the plane identified by planeid
586  constexpr WireID(PlaneID const& planeid, WireID_t w)
587  : PlaneID(planeid), Wire(w) {}
588 
589  /// Constructor: wire with index w in cryostat index c, TPC index t,
590  /// plane index p
592  PlaneID(c, t, p), Wire(w) {}
593 
594  //@{
595  /// Human-readable representation of the wire ID.
596  std::string toString() const { return details::writeToString(*this); }
597  explicit operator std::string() const { return toString(); }
598  //@}
599 
600  // the following two methods are useful for (templated) abstraction
601  /// Returns the value of the deepest ID available (wire's).
602  constexpr auto const& deepestIndex() const { return Wire; }
603  /// Returns the deepest ID available (wire's).
604  auto& deepestIndex() { return Wire; }
605  /// Return the parent ID of this one (a plane ID).
606  constexpr ParentID_t const& parentID() const { return *this; }
607  /// Return the parent ID of this one (a plane ID).
608  ParentID_t& parentID() { return *this; }
609  /// Returns the index level `Index` of this type.
610  template <std::size_t Index = 0U>
611  constexpr auto getIndex() const;
612  /// Returns the index level `Index` of this type.
613  template <std::size_t Index = 0U>
614  auto& writeIndex();
615  /// Returns the index `Above` levels higher than `Level`.
616  template <std::size_t Above>
617  constexpr auto getRelIndex() const;
618 
619  /// Conversion to WireID (for convenience of notation).
620  constexpr WireID const& asWireID() const { return *this; }
621  /// Conversion to WireID (for convenience of notation).
622  WireID& asWireID() { return *this; }
623  /// Conversion to WireID (for convenience of notation).
624  constexpr WireID const& asConstWireID() { return *this; }
625 
626  /// Returns < 0 if this is smaller than tpcid, 0 if equal, > 0 if larger
627  constexpr int cmp(WireID const& other) const
628  {
629  int cmp_res = PlaneID::cmp(other);
630  if (cmp_res == 0) // same plane: compare wires
631  return ThreeWayComparison(deepestIndex(), other.deepestIndex());
632  else // return the order of wire
633  return cmp_res;
634  } // cmp()
635 
636  /// Backward compatibility; use the wire directly or a explicit cast instead
637  /// @todo Remove the instances of geo::WireID::planeID() in the code
638  constexpr PlaneID const& planeID() const { return *this; }
639 
640  /// Level of this element.
641  static constexpr auto Level = geo::ElementLevel::Wire;
642 
643  /// Return the value of the invalid wire ID as a r-value
644  static constexpr WireID_t getInvalidID() { return WireID::InvalidID; }
645 
646  }; // struct WireID
647 
648 
649  //----------------------------------------------------------------------------
650  //--- ID output operators
651  //---
652  /// Generic output of CryostatID to stream
653  inline std::ostream& operator<< (std::ostream& out, CryostatID const& cid) {
654  out << "C:" << cid.Cryostat;
655  return out;
656  } // operator<< (CryostatID)
657 
658 
659  /// Generic output of OpDetID to stream.
660  inline std::ostream& operator<< (std::ostream& out, OpDetID const& oid) {
661  out << oid.asCryostatID() << " O:" << oid.OpDet;
662  return out;
663  } // operator<< (OpDetID)
664 
665 
666  /// Generic output of TPCID to stream
667  inline std::ostream& operator<< (std::ostream& out, TPCID const& tid) {
668  out << ((CryostatID const&) tid) << " T:" << tid.TPC;
669  return out;
670  } // operator<< (TPCID)
671 
672 
673  /// Generic output of PlaneID to stream
674  inline std::ostream& operator<< (std::ostream& out, PlaneID const& pid) {
675  out << ((TPCID const&) pid) << " P:" << pid.Plane;
676  return out;
677  } // operator<< (PlaneID)
678 
679 
680  /// Generic output of WireID to stream
681  inline std::ostream& operator<< (std::ostream& out, WireID const& wid) {
682  out << ((PlaneID const&) wid) << " W:" << wid.Wire;
683  return out;
684  } // operator<< (WireID)
685 
686  /// @}
687  // Geometry element IDs
688 
689  //----------------------------------------------------------------------------
690  //--- ID comparison operators
691  //---
692 
693  /// @{
694  /// @name ID comparison operators
695  /// @details The result of comparison with invalid IDs is undefined.
696 
697  /// Comparison: the IDs point to the same cryostat (validity is ignored)
698  inline constexpr bool operator== (CryostatID const& a, CryostatID const& b)
699  { return a.Cryostat == b.Cryostat; }
700 
701  /// Comparison: the IDs point to different cryostats (validity is ignored)
702  inline constexpr bool operator!= (CryostatID const& a, CryostatID const& b)
703  { return a.Cryostat != b.Cryostat; }
704 
705  /// Order cryostats with increasing ID
706  inline constexpr bool operator< (CryostatID const& a, CryostatID const& b)
707  { return a.Cryostat < b.Cryostat; }
708 
709 
710  /// Comparison: the IDs point to same optical detector (validity is ignored)
711  inline constexpr bool operator== (OpDetID const& a, OpDetID const& b)
712  { return (a.asCryostatID() == b.asCryostatID()) && (a.OpDet == b.OpDet); }
713 
714  /// Comparison: IDs point to different optical detectors (validity is ignored)
715  inline constexpr bool operator!= (OpDetID const& a, OpDetID const& b)
716  { return (a.asCryostatID() != b.asCryostatID()) || (a.OpDet != b.OpDet); }
717 
718  /// Order OpDetID in increasing Cryo, then OpDet
719  inline constexpr bool operator< (OpDetID const& a, OpDetID const& b) {
720  int cmp_res = a.asCryostatID().cmp(b);
721  if (cmp_res == 0) // same cryostat: compare optical detectors
722  return a.OpDet < b.OpDet;
723  else // return the order of cryostats
724  return cmp_res < 0;
725  } // operator< (OpDetID, OpDetID)
726 
727 
728  /// Comparison: the IDs point to the same TPC (validity is ignored)
729  inline constexpr bool operator== (TPCID const& a, TPCID const& b) {
730  return
731  (static_cast<CryostatID const&>(a) == static_cast<CryostatID const&>(b))
732  && (a.TPC == b.TPC);
733  } // operator== (TPCID, TPCID)
734 
735  /// Comparison: the IDs point to different TPCs (validity is ignored)
736  inline constexpr bool operator!= (TPCID const& a, TPCID const& b) {
737  return
738  (static_cast<CryostatID const&>(a) != static_cast<CryostatID const&>(b))
739  || (a.TPC != b.TPC);
740  } // operator!= (TPCID, TPCID)
741 
742  /// Order TPCID in increasing Cryo, then TPC
743  inline constexpr bool operator< (TPCID const& a, TPCID const& b) {
744  int cmp_res = (static_cast<CryostatID const&>(a)).cmp(b);
745  if (cmp_res == 0) // same cryostat: compare TPC
746  return a.TPC < b.TPC;
747  else // return the order of cryostats
748  return cmp_res < 0;
749  } // operator< (TPCID, TPCID)
750 
751 
752  /// Comparison: the IDs point to the same plane (validity is ignored)
753  inline constexpr bool operator== (PlaneID const& a, PlaneID const& b) {
754  return
755  (static_cast<TPCID const&>(a) == static_cast<TPCID const&>(b))
756  && (a.Plane == b.Plane);
757  } // operator== (PlaneID, PlaneID)
758 
759  /// Comparison: the IDs point to different planes (validity is ignored)
760  inline constexpr bool operator!= (PlaneID const& a, PlaneID const& b) {
761  return
762  (static_cast<TPCID const&>(a) != static_cast<TPCID const&>(b))
763  || (a.Plane != b.Plane);
764  } // operator!= (PlaneID, PlaneID)
765 
766  /// Order PlaneID in increasing TPC, then plane
767  inline constexpr bool operator< (PlaneID const& a, PlaneID const& b) {
768  int cmp_res = (static_cast<TPCID const&>(a)).cmp(b);
769  if (cmp_res == 0) // same TPC: compare plane
770  return a.Plane < b.Plane;
771  else // return the order of TPC
772  return cmp_res < 0;
773  } // operator< (PlaneID, PlaneID)
774 
775 
776  /// Comparison: the IDs point to the same wire (validity is ignored)
777  inline constexpr bool operator== (WireID const& a, WireID const& b) {
778  return
779  (static_cast<PlaneID const&>(a) == static_cast<PlaneID const&>(b))
780  && (a.Wire == b.Wire);
781  } // operator== (WireID, WireID)
782 
783  /// Comparison: the IDs point to different wires (validity is ignored)
784  inline constexpr bool operator!= (WireID const& a, WireID const& b) {
785  return
786  (static_cast<PlaneID const&>(a) != static_cast<PlaneID const&>(b))
787  || (a.Wire != b.Wire);
788  } // operator!= (WireID, WireID)
789 
790  // Order WireID in increasing plane, then wire
791  inline constexpr bool operator< (WireID const& a, WireID const& b) {
792  int cmp_res = (static_cast<PlaneID const&>(a)).cmp(b);
793  if (cmp_res == 0) // same plane: compare wire
794  return a.Wire < b.Wire;
795  else // return the order of planes
796  return cmp_res < 0;
797  } // operator< (WireID, WireID)
798 
799  /// @}
800 
801 
802  //----------------------------------------------------------------------------
804  double y; ///< y position of intersection
805  double z; ///< z position of intersection
806  unsigned int TPC; ///< TPC of intersection
807 
808  // In APAs, we want this to increase in the direction wireID
809  // index increases in: moving inward vertically towards y=0
810  bool operator<( const WireIDIntersection& otherIntersect ) const {
811  return std::abs( y ) > std::abs( otherIntersect.y );
812  }
813  };
814 
815 
816  //----------------------------------------------------------------------------
817  /// Returns the name of the specified signal type.
818  std::string SignalTypeName(geo::SigType_t sigType);
819 
820 
821  //----------------------------------------------------------------------------
822 
823 
824 } // namespace geo
825 /// @}
826 // END Geometry ----------------------------------------------------------------
827 
828 
829 namespace geo {
830  namespace details {
831 
832  //--------------------------------------------------------------------------
833  template <typename ID, std::size_t Index, typename /* = void */>
834  struct AbsIDtypeStruct {
835  static_assert(Index <= ID::Level, "Requested ID index is not available.");
836  using type
838  }; // AbsIDtypeStruct<>
839 
840 
841  template <typename ID, std::size_t Index>
842  struct AbsIDtypeStruct<ID, Index, std::enable_if_t<(Index == ID::Level)>> {
843  using type = ID;
844  };
845 
846 
847  //--------------------------------------------------------------------------
848  template <typename ID, std::size_t UpIndex>
849  struct RelIDtypeStruct {
850  static_assert
851  (UpIndex <= ID::Level, "Requested parent ID index is not available.");
852  using type
853  = typename RelIDtypeStruct<typename ID::ParentID_t, UpIndex - 1U>::type;
854  }; // RelIDtypeStruct<>
855 
856 
857  template <typename ID>
858  struct RelIDtypeStruct<ID, 0U> {
859  using type = ID;
860  };
861 
862  //--------------------------------------------------------------------------
863  template <typename T>
864  inline std::string writeToString(T const& value) {
865  std::ostringstream sstr;
866  sstr << value;
867  return sstr.str();
868  } // writeToString()
869 
870 
871  //--------------------------------------------------------------------------
872 
873  } // namespace details
874 
875 } // namespace geo
876 
877 //------------------------------------------------------------------------------
878 //--- template implementation
879 //------------------------------------------------------------------------------
880 template <std::size_t Index /* = 0U */>
881 constexpr auto geo::CryostatID::getIndex() const {
882  static_assert
883  (Index <= Level, "This ID type does not have the requested Index level.");
884  return details::getAbsIDindex<Index>(*this);
885 } // geo::CryostatID::getIndex() const
886 
887 template <std::size_t Index /* = 0U */>
889  static_assert
890  (Index <= Level, "This ID type does not have the requested Index level.");
891  return details::getAbsIDindex<Index>(*this);
892 } // geo::CryostatID::writeIndex()
893 
894 template <std::size_t Above>
895 constexpr auto geo::CryostatID::getRelIndex() const {
896  static_assert
897  (Above <= Level, "This ID type does not have the requested Index level.");
898  return getIndex<Level - Above>();
899 } // geo::CryostatID::getRelIndex()
900 
901 
902 //------------------------------------------------------------------------------
903 template <std::size_t Index /* = 0U */>
904 constexpr auto geo::OpDetID::getIndex() const {
905  static_assert
906  (Index <= Level, "This ID type does not have the requested Index level.");
907  return details::getAbsIDindex<Index>(*this);
908 } // geo::OpDetID::getIndex() const
909 
910 template <std::size_t Index /* = 0U */>
912  static_assert
913  (Index <= Level, "This ID type does not have the requested Index level.");
914  return details::getAbsIDindex<Index>(*this);
915 } // geo::OpDetID::writeIndex()
916 
917 template <std::size_t Above>
918 constexpr auto geo::OpDetID::getRelIndex() const {
919  static_assert
920  (Above <= Level, "This ID type does not have the requested Index level.");
921  return getIndex<Level - Above>();
922 } // geo::OpDetID::getRelIndex()
923 
924 
925 //------------------------------------------------------------------------------
926 template <std::size_t Index /* = 0U */>
927 constexpr auto geo::TPCID::getIndex() const {
928  static_assert
929  (Index <= Level, "This ID type does not have the requested Index level.");
930  return details::getAbsIDindex<Index>(*this);
931 } // geo::TPCID::getIndex() const
932 
933 template <std::size_t Index /* = 0U */>
935  static_assert
936  (Index <= Level, "This ID type does not have the requested Index level.");
937  return details::getAbsIDindex<Index>(*this);
938 } // geo::TPCID::writeIndex()
939 
940 template <std::size_t Above>
941 constexpr auto geo::TPCID::getRelIndex() const {
942  static_assert
943  (Above <= Level, "This ID type does not have the requested Index level.");
944  return getIndex<Level - Above>();
945 } // geo::TPCID::getRelIndex()
946 
947 
948 //------------------------------------------------------------------------------
949 template <std::size_t Index /* = 0U */>
950 constexpr auto geo::PlaneID::getIndex() const {
951  static_assert
952  (Index <= Level, "This ID type does not have the requested Index level.");
953  return details::getAbsIDindex<Index>(*this);
954 } // geo::PlaneID::getIndex() const
955 
956 template <std::size_t Index /* = 0U */>
958  static_assert
959  (Index <= Level, "This ID type does not have the requested Index level.");
960  return details::getAbsIDindex<Index>(*this);
961 } // geo::PlaneID::writeIndex()
962 
963 template <std::size_t Above>
964 constexpr auto geo::PlaneID::getRelIndex() const {
965  static_assert
966  (Above <= Level, "This ID type does not have the requested Index level.");
967  return getIndex<Level - Above>();
968 } // geo::PlaneID::getRelIndex()
969 
970 
971 //------------------------------------------------------------------------------
972 template <std::size_t Index /* = 0U */>
973 constexpr auto geo::WireID::getIndex() const {
974  static_assert
975  (Index <= Level, "This ID type does not have the requested Index level.");
976  return details::getAbsIDindex<Index>(*this);
977 } // geo::WireID::getIndex() const
978 
979 template <std::size_t Index /* = 0U */>
981  static_assert
982  (Index <= Level, "This ID type does not have the requested Index level.");
983  return details::getAbsIDindex<Index>(*this);
984 } // geo::WireID::writeIndex()
985 
986 template <std::size_t Above>
987 constexpr auto geo::WireID::getRelIndex() const {
988  static_assert
989  (Above <= Level, "This ID type does not have the requested Index level.");
990  return getIndex<Level - Above>();
991 } // geo::WireID::getRelIndex()
992 
993 
994 //------------------------------------------------------------------------------
995 
996 #endif // LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_H
constexpr CryostatID(CryostatID_t c)
Constructor: valid ID of cryostat with index c.
Definition: geo_types.h:218
static constexpr OpDetID_t getInvalidID()
Return the value of the invalid optical detector ID as a r-value.
Definition: geo_types.h:380
ParentID_t & parentID()
Return the parent ID of this one (a plane ID).
Definition: geo_types.h:608
constexpr int cmp(TPCID const &other) const
Returns &lt; 0 if this is smaller than other, 0 if equal, &gt; 0 if larger.
Definition: geo_types.h:453
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:904
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
coordinates
Definition: geo_types.h:121
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:973
double z
z position of intersection
Definition: geo_types.h:805
constexpr WireID const & asWireID() const
Conversion to WireID (for convenience of notation).
Definition: geo_types.h:620
typename RelIDtypeStruct< ID, UpIndex >::type RelIDtype
Definition: geo_types.h:52
Drift direction is unknown.
Definition: geo_types.h:158
static constexpr TPCID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:403
Who knows?
Definition: geo_types.h:147
_plane_orient
Definition: geo_types.h:139
TPCID & asTPCID()
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:448
std::string toString() const
Human-readable representation of the plane ID.
Definition: geo_types.h:510
auto & writeIndex()
Returns the index level Index of this type.
Definition: geo_types.h:911
static constexpr Level_t NLevels
Definition: geo_types.h:177
constexpr PlaneID(TPCID const &tpcid, PlaneID_t p)
Constructor: plane with index p in the TPC identified by tpcid.
Definition: geo_types.h:499
details::AbsIDtype< L, ThisID_t > ID_t
Type of the ID with the specified level L.
Definition: geo_types.h:198
void setValidity(bool valid)
Sets the validity of the ID.
Definition: geo_types.h:234
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
auto & writeIndex()
Returns the index level Index of this type.
Definition: geo_types.h:934
static constexpr int ThreeWayComparison(T a, T b)
Returns &lt; 0 if a &lt; b, 0 if a == b, &gt; 0 if a &gt; b.
Definition: geo_types.h:290
constexpr std::size_t geoElementLevel()
Definition: geo_types.h:37
Planes which measure V.
Definition: geo_types.h:130
constexpr WireID(PlaneID const &planeid, WireID_t w)
Constructor: wire with index w in the plane identified by planeid.
Definition: geo_types.h:586
Drift towards positive values.
Definition: geo_types.h:159
Unknown view.
Definition: geo_types.h:136
enum geo::_plane_orient Orient_t
std::string toString() const
Human-readable representation of the optical detector ID.
Definition: geo_types.h:336
constexpr bool operator<(CryostatID const &a, CryostatID const &b)
Order cryostats with increasing ID.
Definition: geo_types.h:706
constexpr int cmp(OpDetID const &other) const
Returns &lt; 0 if this is smaller than other, 0 if equal, &gt; 0 if larger.
Definition: geo_types.h:367
_plane_sigtype
Definition: geo_types.h:144
auto & deepestIndex()
Returns the deepest ID available (plane&#39;s).
Definition: geo_types.h:518
ParentID_t & parentID()
Return the parent ID of this one (a TPC ID).
Definition: geo_types.h:522
pdgs p
Definition: selectors.fcl:22
constexpr WireID const & asConstWireID()
Conversion to WireID (for convenience of notation).
Definition: geo_types.h:624
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:473
Planes which measure X direction.
Definition: geo_types.h:134
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
X coordinate.
Definition: geo_types.h:122
CryostatID & asCryostatID()
Conversion to CryostatID (for convenience of notation).
Definition: geo_types.h:277
constexpr bool operator==(CryostatID const &a, CryostatID const &b)
Comparison: the IDs point to the same cryostat (validity is ignored)
Definition: geo_types.h:698
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:950
OpDetID & asOpDetID()
Conversion to OpDetID (for convenience of notation).
Definition: geo_types.h:362
constexpr WireID(CryostatID_t c, TPCID_t t, PlaneID_t p, WireID_t w)
Definition: geo_types.h:591
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
static constexpr bool
_plane_proj
Enumerate the possible plane projections.
Definition: geo_types.h:128
Planes which measure Z direction.
Definition: geo_types.h:132
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (plane&#39;s).
Definition: geo_types.h:516
static constexpr WireID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:577
constexpr auto getRelIndex() const
Returns the index Above levels higher than Level.
Definition: geo_types.h:941
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
enum geo::coordinates Coord_t
static constexpr auto Level
Level of this element.
Definition: geo_types.h:463
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a cryostat ID).
Definition: geo_types.h:432
Drift towards negative X values.
Definition: geo_types.h:162
unsigned int TPC
TPC of intersection.
Definition: geo_types.h:806
constexpr bool operator!() const
Returns true if the ID is not valid.
Definition: geo_types.h:231
static constexpr Level_t Plane
Definition: geo_types.h:175
typename AbsIDtypeStruct< typename ID::ParentID_t, Index >::type type
Definition: geo_types.h:837
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (wire&#39;s).
Definition: geo_types.h:602
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (OpDet&#39;s).
Definition: geo_types.h:342
auto & deepestIndex()
Returns the deepest ID available (TPC&#39;s).
Definition: geo_types.h:430
Planes which measure Y direction.
Definition: geo_types.h:133
details::RelIDtype< A, ThisID_t > UpperID_t
Type of the ID A levels above this one.
Definition: geo_types.h:202
constexpr int cmp(WireID const &other) const
Returns &lt; 0 if this is smaller than tpcid, 0 if equal, &gt; 0 if larger.
Definition: geo_types.h:627
constexpr TPCID(CryostatID_t c, TPCID_t t)
Constructor: TPC with index t in the cryostat index c.
Definition: geo_types.h:416
3-dimensional objects, potentially hits, clusters, prongs, etc.
Definition: geo_types.h:135
process_name gaushit a
static constexpr auto Level
Level of this element.
Definition: geo_types.h:282
std::string writeToString(T const &value)
Write the argument into a string.
Definition: geo_types.h:864
static constexpr CryostatID_t getInvalidID()
Return the value of the invalid ID as a r-value.
Definition: geo_types.h:285
T abs(T value)
Planes which measure U.
Definition: geo_types.h:129
static constexpr auto Level
Level of this element.
Definition: geo_types.h:551
constexpr bool isTopGeoElementID
Whether ID represents an element on top of the hierarchy.
Definition: geo_types.h:34
auto & deepestIndex()
Returns the deepest ID available (cryostat&#39;s).
Definition: geo_types.h:255
OpDetID_t OpDet
Index of the optical detector within its cryostat.
Definition: geo_types.h:319
typename AbsIDtypeStruct< ID, Index >::type AbsIDtype
Definition: geo_types.h:46
constexpr PlaneID()=default
Default constructor: an invalid plane ID.
auto & deepestIndex()
Returns the deepest ID available (wire&#39;s).
Definition: geo_types.h:604
Planes that are in the horizontal plane.
Definition: geo_types.h:140
static constexpr TPCID_t getInvalidID()
Return the value of the invalid TPC ID as a r-value.
Definition: geo_types.h:466
constexpr TPCID const & asConstTPCID()
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:450
driftdir
Drift direction: positive or negative.
Definition: geo_types.h:157
static constexpr Level_t OpDet
Definition: geo_types.h:173
enum geo::driftdir DriftDirection_t
Drift direction: positive or negative.
Signal from induction planes.
Definition: geo_types.h:145
constexpr CryostatID()=default
Default constructor: an invalid cryostat.
Planes that are in the vertical plane (e.g. ArgoNeuT).
Definition: geo_types.h:141
Z coordinate.
Definition: geo_types.h:124
constexpr bool operator!=(CryostatID const &a, CryostatID const &b)
Comparison: the IDs point to different cryostats (validity is ignored)
Definition: geo_types.h:702
static constexpr Level_t TPC
Definition: geo_types.h:174
auto & writeIndex()
Returns the index level Index of this type.
Definition: geo_types.h:888
enum geo::_plane_sigtype SigType_t
static constexpr auto Level
Level of this element.
Definition: geo_types.h:641
constexpr CryostatID const & asConstCryostatID()
Conversion to CryostatID (for convenience of notation).
Definition: geo_types.h:279
Y coordinate.
Definition: geo_types.h:123
std::string toString() const
Human-readable representation of the cryostat ID.
Definition: geo_types.h:247
typename std::enable_if< B, T >::type enable_if_t
Definition: json.hpp:2191
void markValid()
Sets the ID as valid.
Definition: geo_types.h:237
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:927
constexpr CryostatID const & asCryostatID() const
Conversion to CryostatID (for convenience of notation).
Definition: geo_types.h:275
constexpr PlaneID const & asPlaneID() const
Conversion to PlaneID (for convenience of notation).
Definition: geo_types.h:534
std::string toString() const
Human-readable representation of the wire ID.
Definition: geo_types.h:596
PlaneID & asPlaneID()
Conversion to PlaneID (for convenience of notation).
Definition: geo_types.h:536
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
static constexpr Level_t Cryostat
Definition: geo_types.h:172
j template void())
Definition: json.hpp:3108
constexpr ParentID_t parentID() const
Return the parent ID of this one (void).
Definition: geo_types.h:257
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:240
constexpr auto getRelIndex() const
Returns the index Above levels higher than Level.
Definition: geo_types.h:987
constexpr CryostatID(CryostatID_t c, bool valid)
Constructor: valid ID of cryostat with index c.
Definition: geo_types.h:221
ParentID_t & parentID()
Return the parent ID of this one (a cryostat ID).
Definition: geo_types.h:434
constexpr auto getRelIndex() const
Returns the index Above levels higher than Level.
Definition: geo_types.h:895
constexpr auto getAbsIDindex(ID const &id)
Definition: geo_types.h:55
constexpr TPCID const & asTPCID() const
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:446
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:503
static constexpr WireID_t getInvalidID()
Return the value of the invalid wire ID as a r-value.
Definition: geo_types.h:644
typename RelIDtypeStruct< typename ID::ParentID_t, UpIndex-1U >::type type
Definition: geo_types.h:853
auto & writeIndex()
Returns the index level Index of this type.
Definition: geo_types.h:957
unsigned int CryostatID_t
Type for the ID number.
Definition: geo_types.h:191
unsigned int OpDetID_t
Type for the ID number.
Definition: geo_types.h:298
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a cryostat ID).
Definition: geo_types.h:346
unsigned int TPCID_t
Type for the ID number.
Definition: geo_types.h:387
Drift towards positive X values.
Definition: geo_types.h:161
bool operator<(const WireIDIntersection &otherIntersect) const
Definition: geo_types.h:810
static constexpr OpDetID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:315
double y
y position of intersection
Definition: geo_types.h:804
WireID & asWireID()
Conversion to WireID (for convenience of notation).
Definition: geo_types.h:622
static constexpr Level_t Wire
Definition: geo_types.h:176
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a plane ID).
Definition: geo_types.h:606
constexpr OpDetID()=default
Default constructor: an invalid optical detector ID.
Drift towards negative values.
Definition: geo_types.h:160
constexpr OpDetID const & asOpDetID() const
Conversion to OpDetID (for convenience of notation).
Definition: geo_types.h:360
ParentID_t & parentID()
Return the parent ID of this one (a cryostat ID).
Definition: geo_types.h:348
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (TPC&#39;s).
Definition: geo_types.h:428
constexpr OpDetID(CryostatID const &cryoid, OpDetID_t o)
Definition: geo_types.h:326
constexpr PlaneID const & asConstPlaneID()
Conversion to PlaneID (for convenience of notation).
Definition: geo_types.h:538
void ParentID_t
Type of the parent ID (none!).
Definition: geo_types.h:194
constexpr WireID()=default
Default constructor: an invalid TPC ID.
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:561
constexpr auto getRelIndex() const
Returns the index Above levels higher than Level.
Definition: geo_types.h:964
temporary value
static constexpr CryostatID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:208
auto getRelIDindex(ID const &id)
Definition: geo_types.h:71
constexpr OpDetID(CryostatID_t c, OpDetID_t o)
Constructor: opdtical detector with index o in the cryostat index c
Definition: geo_types.h:330
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:131
constexpr PlaneID const & planeID() const
Definition: geo_types.h:638
static constexpr auto Level
Level of this element.
Definition: geo_types.h:377
static constexpr PlaneID_t InvalidID
Special code for an invalid ID.
Definition: geo_types.h:490
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
auto & writeIndex()
Returns the index level Index of this type.
Definition: geo_types.h:980
The data type to uniquely identify a optical detector.
Definition: geo_types.h:297
constexpr auto getRelIndex() const
Returns the index Above levels higher than Level.
Definition: geo_types.h:918
constexpr int cmp(CryostatID const &other) const
Returns &lt; 0 if this is smaller than other, 0 if equal, &gt; 0 if larger.
Definition: geo_types.h:271
auto & deepestIndex()
Returns the deepest ID available (OpDet&#39;s).
Definition: geo_types.h:344
static constexpr PlaneID_t getInvalidID()
Return the value of the invalid plane ID as a r-value.
Definition: geo_types.h:554
constexpr OpDetID const & asConstOpDetID()
Conversion to OpDetID (for convenience of notation).
Definition: geo_types.h:364
std::size_t Level_t
Definition: geo_types.h:170
std::string toString() const
Human-readable representation of the TPC ID.
Definition: geo_types.h:422
std::ostream & operator<<(std::ostream &out, CryostatID const &cid)
Generic output of CryostatID to stream.
Definition: geo_types.h:653
constexpr TPCID(CryostatID const &cryoid, TPCID_t t)
Constructor: TPC with index t in the cryostat identified by cryoid.
Definition: geo_types.h:412
constexpr int cmp(PlaneID const &other) const
Returns &lt; 0 if this is smaller than other, 0 if equal, &gt; 0 if larger.
Definition: geo_types.h:541
constexpr auto getIndex() const
Returns the index level Index of this type.
Definition: geo_types.h:881
constexpr TPCID()=default
Default constructor: an invalid TPC ID.
ParentID_t parentID()
Return the parent ID of this one (void).
Definition: geo_types.h:259
BEGIN_PROLOG don t mess with this pandoraTrackGausCryoW true
std::string SignalTypeName(geo::SigType_t sigType)
Returns the name of the specified signal type.
Definition: geo_types.cxx:19
The data type to uniquely identify a cryostat.
Definition: geo_types.h:190
constexpr ParentID_t const & parentID() const
Return the parent ID of this one (a TPC ID).
Definition: geo_types.h:520
Signal from collection planes.
Definition: geo_types.h:146
constexpr auto const & deepestIndex() const
Returns the value of the deepest ID available (cryostat&#39;s).
Definition: geo_types.h:253