LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
ReadoutIterationPolicy.cxx
Go to the documentation of this file.
4 
5 namespace geo::details {
6 
8  WireReadoutGeom const* wireReadoutGeom)
9  : GeometryIterationPolicy{geom}, fGeom{geom}, fWireReadoutGeom{wireReadoutGeom}
10  {}
11 
12  unsigned int ReadoutIterationPolicy::NSiblings(PlaneID const& id) const
13  {
15  }
16 
17  unsigned int ReadoutIterationPolicy::NSiblings(WireID const& id) const
18  {
20  }
21 
23  {
24  return fWireReadoutGeom->NTPCsets(id);
25  }
26 
27  unsigned int ReadoutIterationPolicy::NSiblings(readout::ROPID const& id) const
28  {
29  return fWireReadoutGeom->NROPs(id);
30  }
31 
32  // PlaneID
34  {
35  auto id = PlaneID::first();
36  if (fWireReadoutGeom->MaxPlanes() != 0) { id.Cryostat = fGeom->Ncryostats(); }
37  return id;
38  }
39 
41  {
42  return {EndTPCID(id), 0};
43  }
44 
46  {
47  return {GetNextID(id, *this), 0};
48  }
49 
50  // WireID
52  {
53  auto id = WireID::first();
54  if (fWireReadoutGeom->MaxWires() != 0) { id.Cryostat = fGeom->Ncryostats(); }
55  return id;
56  }
57 
59  {
60  return {EndPlaneID(id), 0};
61  }
62 
64  {
65  return {EndPlaneID(id), 0};
66  }
67 
69  {
70  return {GetNextID(id, *this), 0};
71  }
72 
73  // TPCsetID
75  {
76  return {EndCryostatID(), 0};
77  }
78 
80  {
81  return {GetNextID(id, *this), 0};
82  }
83 
84  // ROPID
86  {
87  return {EndTPCsetID(), 0};
88  }
89 
91  {
92  return {EndTPCsetID(id), 0};
93  }
94 
96  {
97  return {GetNextID(id, *this), 0};
98  }
99 
100  // ......
101  PlaneGeo const* getElementPtr(WireReadoutGeom const* wireReadoutGeom, PlaneID const& id)
102  {
103  assert(wireReadoutGeom);
104  return wireReadoutGeom->PlanePtr(id);
105  }
106 
107  WireGeo const* getElementPtr(WireReadoutGeom const* wireReadoutGeom, WireID const& id)
108  {
109  assert(wireReadoutGeom);
110  return wireReadoutGeom->WirePtr(id);
111  }
112 
113  bool validElement(WireReadoutGeom const* wireReadoutGeom, PlaneID const& id)
114  {
115  return wireReadoutGeom && getElementPtr(wireReadoutGeom, id) != nullptr;
116  }
117 
118  bool validElement(WireReadoutGeom const* wireReadoutGeom, WireID const& id)
119  {
120  return wireReadoutGeom && getElementPtr(wireReadoutGeom, id) != nullptr;
121  }
122 
123 }
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)
PlaneGeo const * PlanePtr(PlaneID const &planeid) const
Returns the specified plane.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const =0
Returns the total number of TPC sets in the specified cryostat.
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
WireGeo const * WirePtr(WireID const &wireid) const
Returns the specified wire.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:303
Access the description of the physical detector geometry.
static constexpr auto first()
Definition: geo_types.h:442
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
static constexpr auto first()
Definition: geo_types.h:384
Interface for a class providing readout channel mapping to geometry.
unsigned int MaxWires() const
Returns the total number of wires in the specified plane.
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.
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const =0
Returns the total number of ROP in the specified TPC set.
unsigned int NSiblingElements(PlaneID const &planeid) const
Returns the total number of planes in the specified TPC.
GeoID GetNextID(GeoID const &id, IterationPolicy const &policy)
Returns the ID next to the specified one.
Definition: id_iterators.h:285
Interface to geometry for wire readouts .
unsigned int NSiblings(PlaneID const &id) const
The data type to uniquely identify a cryostat.
Definition: geo_types.h:187