LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
helpers.cxx
Go to the documentation of this file.
3 
4 namespace geo::details {
5 
6  unsigned int NSiblings(GeometryCore const* geom, CryostatID const& id)
7  {
8  return geom->NSiblingElements(id);
9  }
10 
11  unsigned int NSiblings(GeometryCore const* geom, TPCID const& id)
12  {
13  return geom->NSiblingElements(id);
14  }
15 
16  unsigned int NSiblings(GeometryCore const* geom, PlaneID const& id)
17  {
18  return geom->NSiblingElements(id);
19  }
20 
21  unsigned int NSiblings(GeometryCore const* geom, WireID const& id)
22  {
23  return geom->NSiblingElements(id);
24  }
25 
26  unsigned int NSiblings(GeometryCore const* geom, readout::TPCsetID const& id)
27  {
28  return geom->NSiblingElements(id);
29  }
30 
31  unsigned int NSiblings(GeometryCore const* geom, readout::ROPID const& id)
32  {
33  return geom->NSiblingElements(id);
34  }
35 
36  CryostatGeo const* getElementPtr(GeometryCore const* geom, CryostatID const& id)
37  {
38  assert(geom);
39  return geom->GetElementPtr(id);
40  }
41 
42  TPCGeo const* getElementPtr(GeometryCore const* geom, TPCID const& id)
43  {
44  assert(geom);
45  return geom->GetElementPtr(id);
46  }
47 
48  PlaneGeo const* getElementPtr(GeometryCore const* geom, PlaneID const& id)
49  {
50  assert(geom);
51  return geom->GetElementPtr(id);
52  }
53 
54  WireGeo const* getElementPtr(GeometryCore const* geom, WireID const& id)
55  {
56  assert(geom);
57  return geom->GetElementPtr(id);
58  }
59 
60  bool validElement(GeometryCore const* geom, CryostatID const& id)
61  {
62  return geom && getElementPtr(geom, id) != nullptr;
63  }
64 
65  bool validElement(GeometryCore const* geom, TPCID const& id)
66  {
67  return geom && getElementPtr(geom, id) != nullptr;
68  }
69 
70  bool validElement(GeometryCore const* geom, PlaneID const& id)
71  {
72  return geom && getElementPtr(geom, id) != nullptr;
73  }
74 
75  bool validElement(GeometryCore const* geom, WireID const& id)
76  {
77  return geom && getElementPtr(geom, id) != nullptr;
78  }
79 
80 }
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:114
bool validElement(GeometryCore const *geom, CryostatID const &id)
Definition: helpers.cxx:60
CryostatGeo const * getElementPtr(GeometryCore const *geom, CryostatID const &id)
Definition: helpers.cxx:36
CryostatGeo const * GetElementPtr(CryostatID const &cryoid) const
Returns the specified cryostat.
Definition: GeometryCore.h:481
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
Geometry information for a single TPC.
Definition: TPCGeo.h:36
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:72
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
unsigned int NSiblings(GeometryCore const *geom, CryostatID const &id)
Definition: helpers.cxx:6
Access the description of detector geometry.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
unsigned int NSiblingElements(CryostatID const &) const
Returns the number of cryostats in the detector.
Definition: GeometryCore.h:432
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
Class identifying a set of planes sharing readout channels.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:192