LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
ReadoutIterationPolicy.h
Go to the documentation of this file.
1 #ifndef LARCOREALG_GEOMETRY_DETAILS_READOUTITERATIONPOLICY_H
2 #define LARCOREALG_GEOMETRY_DETAILS_READOUTITERATIONPOLICY_H
3 
4 // LArSoft libraries
8 
9 namespace geo::details {
11  public:
12  ReadoutIterationPolicy() = default; // Required for subranges
13  ReadoutIterationPolicy(GeometryCore const* geom, WireReadoutGeom const* wireReadoutGeom);
14 
16  unsigned int NSiblings(PlaneID const& id) const;
17  unsigned int NSiblings(WireID const& id) const;
18  unsigned int NSiblings(readout::TPCsetID const& id) const;
19  unsigned int NSiblings(readout::ROPID const& id) const;
20 
21  template <typename GeoID>
22  GeoID GetEndID() const;
23 
24  template <typename GeoID, typename ContextID>
25  GeoID GetEndID(ContextID const& id) const;
26 
27  private:
28  PlaneID EndPlaneID() const;
29  PlaneID EndPlaneID(CryostatID const& id) const;
30  PlaneID EndPlaneID(TPCID const& id) const;
31 
32  WireID EndWireID() const;
33  WireID EndWireID(CryostatID const& id) const;
34  WireID EndWireID(TPCID const& id) const;
35  WireID EndWireID(PlaneID const& id) const;
36 
38  readout::TPCsetID EndTPCsetID(CryostatID const& id) const;
39 
40  readout::ROPID EndROPID() const;
41  readout::ROPID EndROPID(CryostatID const& id) const;
42  readout::ROPID EndROPID(readout::TPCsetID const& id) const;
43 
44  GeometryCore const* fGeom{nullptr};
46  };
47 
48  // PlaneID
49  template <>
50  inline PlaneID ReadoutIterationPolicy::GetEndID<PlaneID>() const
51  {
52  return EndPlaneID();
53  }
54 
55  template <>
56  inline PlaneID ReadoutIterationPolicy::GetEndID<PlaneID, CryostatID>(CryostatID const& id) const
57  {
58  return EndPlaneID(id);
59  }
60 
61  template <>
62  inline PlaneID ReadoutIterationPolicy::GetEndID<PlaneID, TPCID>(TPCID const& id) const
63  {
64  return EndPlaneID(id);
65  }
66 
67  // WireID
68  template <>
69  inline WireID ReadoutIterationPolicy::GetEndID<WireID>() const
70  {
71  return EndWireID();
72  }
73 
74  template <>
75  inline WireID ReadoutIterationPolicy::GetEndID<WireID, CryostatID>(CryostatID const& id) const
76  {
77  return EndWireID(id);
78  }
79 
80  template <>
81  inline WireID ReadoutIterationPolicy::GetEndID<WireID, TPCID>(TPCID const& id) const
82  {
83  return EndWireID(id);
84  }
85 
86  template <>
87  inline WireID ReadoutIterationPolicy::GetEndID<WireID, PlaneID>(PlaneID const& id) const
88  {
89  return EndWireID(id);
90  }
91 
92  // TPCsetID
93  template <>
94  inline readout::TPCsetID ReadoutIterationPolicy::GetEndID<readout::TPCsetID>() const
95  {
96  return EndTPCsetID();
97  }
98 
99  template <>
100  inline readout::TPCsetID ReadoutIterationPolicy::GetEndID<readout::TPCsetID, CryostatID>(
101  CryostatID const& id) const
102  {
103  return EndTPCsetID(id);
104  }
105 
106  // ROPID
107  template <>
108  inline readout::ROPID ReadoutIterationPolicy::GetEndID<readout::ROPID>() const
109  {
110  return EndROPID();
111  }
112 
113  template <>
114  inline readout::ROPID ReadoutIterationPolicy::GetEndID<readout::ROPID, CryostatID>(
115  CryostatID const& id) const
116  {
117  return EndROPID(id);
118  }
119 
120  template <>
121  inline readout::ROPID ReadoutIterationPolicy::GetEndID<readout::ROPID, readout::TPCsetID>(
122  readout::TPCsetID const& id) const
123  {
124  return EndROPID(id);
125  }
126 
127  PlaneGeo const* getElementPtr(WireReadoutGeom const* wireReadoutGeom, PlaneID const& id);
128  WireGeo const* getElementPtr(WireReadoutGeom const* wireReadoutGeom, WireID const& id);
129 
130  bool validElement(WireReadoutGeom const* geom, PlaneID const& id);
131  bool validElement(WireReadoutGeom const* wireReadoutGeom, WireID const& id);
132 }
133 
134 #endif // LARCOREALG_GEOMETRY_DETAILS_READOUTITERATIONPOLICY_H
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:112
bool validElement(GeometryCore const *geom, CryostatID const &id)
CryostatGeo const * getElementPtr(GeometryCore const *geom, CryostatID const &id)
Classes identifying readout-related concepts.
unsigned int NSiblings(CryostatID const &id) const
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:54
Interface for a class providing readout channel mapping to geometry.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:67
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
Class identifying a set of planes sharing readout channels.
unsigned int NSiblings(PlaneID const &id) const
The data type to uniquely identify a cryostat.
Definition: geo_types.h:187