8 #ifndef LARCOREALG_GEOMETRY_DETAILS_EXTRACTMAXGEOMETRYELEMENTS_H 9 #define LARCOREALG_GEOMETRY_DETAILS_EXTRACTMAXGEOMETRYELEMENTS_H 41 template <std::
size_t Levels = 4U>
43 std::vector<CryostatGeo>
const& Cryostats,
44 WireReadoutGeom
const& wireReadoutGeom);
51 template <std::size_t Levels >
53 std::vector<CryostatGeo>
const& Cryostats,
54 WireReadoutGeom
const& wireReadoutGeom)
56 static_assert(Levels > 0U);
57 static_assert(Levels <= 4U);
59 std::array<unsigned int, Levels> maxElements;
62 auto setMax = [&maxElements](std::size_t index,
unsigned int value) {
63 if (maxElements[index] <
value) maxElements[index] =
value;
66 setMax(0U, Cryostats.size());
67 if constexpr (Levels > 1U) {
68 for (CryostatGeo
const& cryo : Cryostats) {
69 setMax(1U, cryo.NTPC());
70 if constexpr (Levels > 2U) {
71 for (TPCGeo
const& TPC : cryo.IterateTPCs()) {
72 setMax(2U, wireReadoutGeom.Nplanes(TPC.ID()));
73 if constexpr (Levels > 3U) {
74 for (PlaneGeo
const& plane : wireReadoutGeom.Iterate<PlaneGeo>(TPC.ID())) {
75 setMax(3U, plane.Nwires());
88 #endif // LARCOREALG_GEOMETRY_DETAILS_EXTRACTMAXGEOMETRYELEMENTS_H Encapsulate the construction of a single cyostat .
static std::array< unsigned int, Levels > extractMaxGeometryElements(std::vector< CryostatGeo > const &Cryostats, WireReadoutGeom const &wireReadoutGeom)
Extracts the maximum number of elements per type.
Encapsulate the construction of a single detector plane .
Interface to geometry for wire readouts .
Encapsulate the construction of a single detector plane .