16 #include <boost/test/unit_test.hpp>
20 #include <type_traits>
46 template <
typename ITER,
typename ITERID>
47 void CompareIteratorAndIteratorID(ITER iter, ITERID id_iter) {
51 "CompareIteratorAndIteratorID() requires compatible iterator types"
55 BOOST_TEST(iter == id_iter);
56 BOOST_TEST(! (iter != id_iter));
59 BOOST_TEST(iter.ID() == *id_iter);
61 auto pGeoElement = id_iter.get();
64 BOOST_TEST(iter.get() == pGeoElement);
65 BOOST_TEST(iter.operator->() == pGeoElement);
67 if (pGeoElement) BOOST_TEST(&*iter == pGeoElement);
68 else BOOST_CHECK_THROW(*iter, cet::exception);
71 BOOST_TEST(
bool(iter) ==
bool(id_iter));
75 ITERID id_iter_copy(id_iter);
78 BOOST_TEST(iter == iter_copy);
79 BOOST_TEST(iter_copy == iter);
80 BOOST_TEST(!(iter != iter_copy));
81 BOOST_TEST(!(iter_copy != iter));
84 BOOST_TEST(iter++ == id_iter++);
85 BOOST_TEST(++iter_copy == ++id_iter_copy);
87 BOOST_TEST(iter == iter_copy);
167 BOOST_TEST_CHECKPOINT
168 (
"Default created cryostat ID iterator: " << std::string(*iCryo));
174 BOOST_TEST(!(
bool(iCryo)));
188 BOOST_TEST_CHECKPOINT
189 (
"Begin-created cryostat ID iterator: " << std::string(*iCryo));
194 BOOST_TEST(
bool(iCryo));
199 geom->GetBeginID(BeginID);
202 BOOST_TEST(iCryoD == iCryo);
207 BOOST_TEST(iCryoBC == iCryo);
211 BOOST_TEST(iCryoGB == iCryo);
214 BOOST_TEST(*iCryo == BeginID);
215 BOOST_TEST(iCryo->Cryostat == BeginID.
Cryostat);
219 BOOST_TEST(iCryo.
get() == pCryo);
226 BOOST_TEST(iCryoI != iCryo);
231 BOOST_TEST(iCryoI == iCryo);
233 if (geom->Ncryostats() > 1) {
236 BOOST_TEST(iCryoI != iCryo);
249 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last cryostat ID: "
250 << std::string(*iLastCryo));
253 BOOST_TEST(
bool(iLastCryo));
254 BOOST_TEST(!!iLastCryo);
257 BOOST_TEST(*iLastCryo == LastID);
258 BOOST_TEST(iLastCryo->Cryostat == LastID.Cryostat);
259 BOOST_TEST(iLastCryo.get() == geom->CryostatPtr(LastID));
266 BOOST_TEST(!
bool(iEndCryo));
267 BOOST_TEST(!iEndCryo);
269 BOOST_TEST(iEndCryo->Cryostat == geom->Ncryostats());
270 BOOST_TEST(iEndCryo == geom->end_cryostat_id());
271 BOOST_TEST(!iEndCryo.get());
282 BOOST_TEST_CHECKPOINT
283 (
"End-created cryostat ID iterator: " << std::string(*iCryo));
285 BOOST_TEST(iCryo->Cryostat == geom->Ncryostats());
288 BOOST_TEST(!
bool(iCryo));
292 BOOST_TEST(!(iCryo.
get()));
296 BOOST_TEST(iCryoGE == iCryo);
301 BOOST_TEST(iCryo2->Cryostat == geom->Ncryostats());
302 BOOST_TEST(iCryo2 == iCryo);
388 BOOST_TEST_CHECKPOINT
389 (
"Default created cryostat iterator: " << std::string(*iCryoID));
394 BOOST_TEST(iCryo == iCryoID);
395 BOOST_TEST(!(iCryo != iCryoID));
398 BOOST_TEST(iCryo.
ID() == *iCryoID);
405 BOOST_TEST(iCryo == iCryo_copy);
406 BOOST_TEST(iCryo_copy == iCryo);
407 BOOST_TEST(!(iCryo != iCryo_copy));
408 BOOST_TEST(!(iCryo_copy != iCryo));
410 BOOST_TEST(iCryo == iCryo_copy);
419 geom->GetBeginID(BeginID);
424 BOOST_TEST_CHECKPOINT
425 (
"Begin-created cryostat iterator (" << std::string(BeginID) <<
")");
429 CompareIteratorAndIteratorID(iCryoD, iCryoID);
433 CompareIteratorAndIteratorID(iCryo, iCryoID);
438 CompareIteratorAndIteratorID(iCryoBC, iCryoID);
442 CompareIteratorAndIteratorID(iCryoGB, iCryoID);
454 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last cryostat: "
455 << std::string(LastID));
457 CompareIteratorAndIteratorID(iLastCryo, iLastCryoID);
466 CompareIteratorAndIteratorID(iEndCryo, iEndCryoID);
477 BOOST_TEST_CHECKPOINT
478 (
"End-created cryostat iterator: " << std::string(*iCryoID));
481 CompareIteratorAndIteratorID(iCryo, iCryoID);
485 CompareIteratorAndIteratorID(iCryoGE, iCryoID);
548 BOOST_TEST_CHECKPOINT
549 (
"Default created TPC ID iterator: " << std::string(*iTPC));
556 BOOST_TEST(!(
bool(iTPC)));
565 BOOST_TEST_CHECKPOINT
566 (
"Begin-created TPC ID iterator: " << std::string(*iTPC));
572 BOOST_TEST(
bool(iTPC));
577 geom->GetBeginID(BeginID);
581 BOOST_TEST(iTPCD == iTPC);
586 BOOST_TEST(iTPCBC == iTPC);
590 BOOST_TEST(iTPCGB == iTPC);
593 BOOST_TEST(*iTPC == BeginID);
594 BOOST_TEST(iTPC->Cryostat == BeginID.
Cryostat);
595 BOOST_TEST(iTPC->TPC == BeginID.
TPC);
599 BOOST_TEST(iTPC.
get() == pTPC);
611 BOOST_TEST(iTPCI != iTPC);
615 BOOST_TEST(iTPCI == iTPC);
625 ID.
TPC = geom->NTPC(ID) - 1;
630 BOOST_TEST(
bool(iTPC));
634 BOOST_TEST(*iTPC == ID);
635 BOOST_TEST(iTPC->Cryostat == ID.
Cryostat);
636 BOOST_TEST(iTPC->TPC == ID.
TPC);
637 BOOST_TEST(iTPC.
get() == geom->TPCPtr(ID));
647 LastID.
TPC = geom->NTPC(LastID) - 1;
649 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last TPC ID: "
650 << std::string(*iLastTPC));
653 BOOST_TEST(
bool(iLastTPC));
654 BOOST_TEST(!!iLastTPC);
657 BOOST_TEST(*iLastTPC == LastID);
658 BOOST_TEST(iLastTPC->Cryostat == LastID.Cryostat);
659 BOOST_TEST(iLastTPC->TPC == LastID.TPC);
660 BOOST_TEST(iLastTPC.
get() == geom->TPCPtr(LastID));
667 BOOST_TEST(!
bool(iEndTPC));
668 BOOST_TEST(!iEndTPC);
672 BOOST_TEST(iEndTPC == geom->end_TPC_id());
673 BOOST_TEST(!iEndTPC.get());
684 BOOST_TEST_CHECKPOINT
685 (
"End-created TPC ID iterator: " << std::string(*iTPC));
691 BOOST_TEST(!
bool(iTPC));
695 BOOST_TEST(!(iTPC.
get()));
699 BOOST_TEST(iTPCGE == iTPC);
706 BOOST_TEST(iTPC2 == iTPC);
787 BOOST_TEST_CHECKPOINT
788 (
"Default created TPC iterator: " << std::string(*iTPCID));
793 BOOST_TEST(iTPC == iTPCID);
794 BOOST_TEST(!(iTPC != iTPCID));
797 BOOST_TEST(iTPC.
ID() == *iTPCID);
804 BOOST_TEST(iTPC == iTPC_copy);
805 BOOST_TEST(iTPC_copy == iTPC);
806 BOOST_TEST(!(iTPC != iTPC_copy));
807 BOOST_TEST(!(iTPC_copy != iTPC));
809 BOOST_TEST(iTPC == iTPC_copy);
818 geom->GetBeginID(BeginID);
823 BOOST_TEST_CHECKPOINT
824 (
"Begin-created TPC iterator (" << std::string(BeginID) <<
")");
828 CompareIteratorAndIteratorID(iTPCD, iTPCID);
832 CompareIteratorAndIteratorID(iTPC, iTPCID);
837 CompareIteratorAndIteratorID(iTPCBC, iTPCID);
841 CompareIteratorAndIteratorID(iTPCGB, iTPCID);
851 LastID.
TPC = geom->NTPC(LastID) - 1;
854 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last TPC: "
855 << std::string(LastID));
857 CompareIteratorAndIteratorID(iLastTPC, iLastTPCID);
866 CompareIteratorAndIteratorID(iEndTPC, iEndTPCID);
877 BOOST_TEST_CHECKPOINT(
"End-created TPC iterator: " << std::string(*iTPCID));
880 CompareIteratorAndIteratorID(iTPC, iTPCID);
884 CompareIteratorAndIteratorID(iTPCGE, iTPCID);
948 BOOST_TEST_CHECKPOINT
949 (
"Default created plane ID iterator: " << std::string(*iPlane));
957 BOOST_TEST(!(
bool(iPlane)));
966 BOOST_TEST_CHECKPOINT
967 (
"Begin-created plane ID iterator: " << std::string(*iPlane));
974 BOOST_TEST(
bool(iPlane));
975 BOOST_TEST(!!iPlane);
979 geom->GetBeginID(BeginID);
984 BOOST_TEST(iPlaneD == iPlane);
989 BOOST_TEST(iPlaneBC == iPlane);
993 BOOST_TEST(iPlaneGB == iPlane);
996 BOOST_TEST(*iPlane == BeginID);
997 BOOST_TEST(iPlane->Cryostat == BeginID.
Cryostat);
998 BOOST_TEST(iPlane->TPC == BeginID.
TPC);
999 BOOST_TEST(iPlane->Plane == BeginID.
Plane);
1003 BOOST_TEST(iPlane.
get() == pPlane);
1008 const unsigned int nPlanesInC0T0 = geom->Nplanes(
geo::TPCID(0, 0));
1009 if (nPlanesInC0T0 > 1) {
1017 BOOST_TEST(iPlaneI != iPlane);
1021 BOOST_TEST(iPlaneI == iPlane);
1031 ID.
Plane = geom->Nplanes(ID) - 1;
1036 BOOST_TEST(
bool(iPlane));
1037 BOOST_TEST(!!iPlane);
1040 BOOST_TEST(*iPlane == ID);
1041 BOOST_TEST(iPlane->Cryostat == ID.
Cryostat);
1042 BOOST_TEST(iPlane->TPC == ID.
TPC);
1043 BOOST_TEST(iPlane->Plane == ID.
Plane);
1044 BOOST_TEST(iPlane.
get() == geom->PlanePtr(ID));
1048 if (ID.
TPC + 1 < geom->NTPC(ID)) {
1049 BOOST_TEST(iPlane->Cryostat == ID.
Cryostat);
1050 BOOST_TEST(iPlane->TPC == ID.
TPC + 1);
1054 BOOST_TEST(iPlane->Cryostat == ID.
Cryostat + 1);
1061 LastID.
TPC = geom->NTPC(LastID) - 1;
1062 LastID.Plane = geom->Nplanes(LastID) - 1;
1064 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last plane ID: "
1065 << std::string(*iLastPlane));
1068 BOOST_TEST(
bool(iLastPlane));
1069 BOOST_TEST(!!iLastPlane);
1072 BOOST_TEST(*iLastPlane == LastID);
1073 BOOST_TEST(iLastPlane->Cryostat == LastID.Cryostat);
1074 BOOST_TEST(iLastPlane->TPC == LastID.TPC);
1075 BOOST_TEST(iLastPlane->Plane == LastID.Plane);
1076 BOOST_TEST(iLastPlane.
get() == geom->PlanePtr(LastID));
1083 BOOST_TEST(!
bool(iEndPlane));
1084 BOOST_TEST(!iEndPlane);
1089 BOOST_TEST(iEndPlane == geom->end_plane_id());
1090 BOOST_TEST(!iEndPlane.get());
1101 BOOST_TEST_CHECKPOINT
1102 (
"End-created plane ID iterator: " << std::string(*iPlane));
1109 BOOST_TEST(!
bool(iPlane));
1110 BOOST_TEST(!iPlane);
1113 BOOST_TEST(!(iPlane.
get()));
1117 BOOST_TEST(iPlaneGE == iPlane);
1125 BOOST_TEST(iPlane2 == iPlane);
1205 BOOST_TEST_CHECKPOINT
1206 (
"Default created plane iterator: " << std::string(*iPlaneID));
1211 BOOST_TEST(iPlane == iPlaneID);
1212 BOOST_TEST(!(iPlane != iPlaneID));
1215 BOOST_TEST(iPlane.
ID() == *iPlaneID);
1222 BOOST_TEST(iPlane == iPlane_copy);
1223 BOOST_TEST(iPlane_copy == iPlane);
1224 BOOST_TEST(!(iPlane != iPlane_copy));
1225 BOOST_TEST(!(iPlane_copy != iPlane));
1227 BOOST_TEST(iPlane == iPlane_copy);
1236 geom->GetBeginID(BeginID);
1241 BOOST_TEST_CHECKPOINT
1242 (
"Begin-created plane iterator (" << std::string(BeginID) <<
")");
1246 CompareIteratorAndIteratorID(iPlaneD, iPlaneID);
1250 CompareIteratorAndIteratorID(iPlane, iPlaneID);
1255 CompareIteratorAndIteratorID(iPlaneBC, iPlaneID);
1259 CompareIteratorAndIteratorID(iPlaneGB, iPlaneID);
1269 LastID.
TPC = geom->NTPC(LastID) - 1;
1270 LastID.Plane = geom->Nplanes(LastID) - 1;
1273 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last plane: "
1274 << std::string(LastID));
1276 CompareIteratorAndIteratorID(iLastPlane, iLastPlaneID);
1285 CompareIteratorAndIteratorID(iEndPlane, iEndPlaneID);
1296 BOOST_TEST_CHECKPOINT
1297 (
"End-created plane iterator: " << std::string(*iPlaneID));
1300 CompareIteratorAndIteratorID(iPlane, iPlaneID);
1304 CompareIteratorAndIteratorID(iPlaneGE, iPlaneID);
1368 BOOST_TEST_CHECKPOINT
1369 (
"Default created wire ID iterator: " << std::string(*iWire));
1378 BOOST_TEST(!(
bool(iWire)));
1387 BOOST_TEST_CHECKPOINT
1388 (
"Begin-created wire ID iterator: " << std::string(*iWire));
1396 BOOST_TEST(
bool(iWire));
1397 BOOST_TEST(!!iWire);
1401 geom->GetBeginID(BeginID);
1407 BOOST_TEST(iWireD == iWire);
1412 BOOST_TEST(iWireBC == iWire);
1416 BOOST_TEST(iWireGB == iWire);
1419 BOOST_TEST(*iWire == BeginID);
1420 BOOST_TEST(iWire->Cryostat == BeginID.
Cryostat);
1421 BOOST_TEST(iWire->TPC == BeginID.
TPC);
1422 BOOST_TEST(iWire->Plane == BeginID.
Plane);
1423 BOOST_TEST(iWire->Wire == BeginID.
Wire);
1427 BOOST_TEST(iWire.
get() == pWire);
1432 const unsigned int nWiresInC0T0P0 = geom->Nwires(
geo::PlaneID(0, 0, 0));
1433 if (nWiresInC0T0P0 > 1) {
1443 BOOST_TEST(iWireI != iWire);
1447 BOOST_TEST(iWireI == iWire);
1457 ID.
Wire = geom->Nwires(ID) - 1;
1462 BOOST_TEST(
bool(iWire));
1463 BOOST_TEST(!!iWire);
1466 BOOST_TEST(*iWire == ID);
1467 BOOST_TEST(iWire->Cryostat == ID.
Cryostat);
1468 BOOST_TEST(iWire->TPC == ID.
TPC);
1469 BOOST_TEST(iWire->Plane == ID.
Plane);
1470 BOOST_TEST(iWire->Wire == ID.
Wire);
1471 BOOST_TEST(iWire.
get() == geom->WirePtr(ID));
1475 if (ID.
Plane + 1 < geom->Nplanes(ID)) {
1478 BOOST_TEST(iWire->Plane == ID.
Plane + 1);
1480 }
else if (ID.
TPC + 1 < geom->NTPC(ID)) {
1482 BOOST_TEST(iWire->TPC == ID.
TPC + 1);
1486 BOOST_TEST(iWire->Cryostat == ID.
Cryostat + 1);
1493 geo::WireID LastID(geom->Ncryostats() - 1, 0, 0, 0);
1494 LastID.
TPC = geom->NTPC(LastID) - 1;
1495 LastID.Plane = geom->Nplanes(LastID) - 1;
1496 LastID.Wire = geom->Nwires(LastID) - 1;
1498 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last wire ID: "
1499 << std::string(*iLastWire));
1502 BOOST_TEST(
bool(iLastWire));
1503 BOOST_TEST(!!iLastWire);
1506 BOOST_TEST(*iLastWire == LastID);
1507 BOOST_TEST(iLastWire->Cryostat == LastID.Cryostat);
1508 BOOST_TEST(iLastWire->TPC == LastID.TPC);
1509 BOOST_TEST(iLastWire->Plane == LastID.Plane);
1510 BOOST_TEST(iLastWire->Wire == LastID.Wire);
1511 BOOST_TEST(iLastWire.
get() == geom->WirePtr(LastID));
1518 BOOST_TEST(!
bool(iEndWire));
1519 BOOST_TEST(!iEndWire);
1525 BOOST_TEST(iEndWire == geom->end_wire_id());
1526 BOOST_TEST(!iEndWire.get());
1537 BOOST_TEST_CHECKPOINT
1538 (
"End-created end ID iterator: " << std::string(*iWire));
1546 BOOST_TEST(!
bool(iWire));
1550 BOOST_TEST(!(iWire.
get()));
1554 BOOST_TEST(iWireGE == iWire);
1563 BOOST_TEST(iWire2 == iWire);
1644 BOOST_TEST_CHECKPOINT
1645 (
"Default created wire iterator: " << std::string(*iWireID));
1650 BOOST_TEST(iWire == iWireID);
1651 BOOST_TEST(!(iWire != iWireID));
1654 BOOST_TEST(iWire.
ID() == *iWireID);
1661 BOOST_TEST(iWire == iWire_copy);
1662 BOOST_TEST(iWire_copy == iWire);
1663 BOOST_TEST(!(iWire != iWire_copy));
1664 BOOST_TEST(!(iWire_copy != iWire));
1666 BOOST_TEST(iWire == iWire_copy);
1675 geom->GetBeginID(BeginID);
1680 BOOST_TEST_CHECKPOINT
1681 (
"Begin-created wire iterator (" << std::string(BeginID) <<
")");
1685 CompareIteratorAndIteratorID(iWireD, iWireID);
1689 CompareIteratorAndIteratorID(iWire, iWireID);
1694 CompareIteratorAndIteratorID(iWireBC, iWireID);
1698 CompareIteratorAndIteratorID(iWireGB, iWireID);
1707 geo::WireID LastID(geom->Ncryostats() - 1, 0, 0, 0);
1708 LastID.
TPC = geom->NTPC(LastID) - 1;
1709 LastID.Plane = geom->Nplanes(LastID) - 1;
1710 LastID.Wire = geom->Nwires(LastID) - 1;
1713 BOOST_TEST_CHECKPOINT
1714 (
"Position-created iterator to last wire: " << std::string(LastID));
1716 CompareIteratorAndIteratorID(iLastWire, iLastWireID);
1725 CompareIteratorAndIteratorID(iEndWire, iEndWireID);
1736 BOOST_TEST_CHECKPOINT
1737 (
"End-created wire iterator: " << std::string(*iWireID));
1740 CompareIteratorAndIteratorID(iWire, iWireID);
1744 CompareIteratorAndIteratorID(iWireGE, iWireID);
1806 BOOST_TEST_CHECKPOINT
1807 (
"Default created TPC set ID iterator: " << std::string(*iTPCset));
1813 BOOST_TEST(!iTPCset);
1814 BOOST_TEST(!(
bool(iTPCset)));
1823 BOOST_TEST_CHECKPOINT
1824 (
"Begin-created TPC set ID iterator: " << std::string(*iTPCset));
1830 BOOST_TEST(
bool(iTPCset));
1831 BOOST_TEST(!!iTPCset);
1835 geom->GetBeginID(BeginID);
1839 BOOST_TEST(iTPCsetD == iTPCset);
1843 BOOST_TEST(iTPCsetBC == iTPCset);
1847 BOOST_TEST(iTPCsetGB == iTPCset);
1850 BOOST_TEST(*iTPCset == BeginID);
1851 BOOST_TEST(iTPCset->Cryostat == BeginID.
Cryostat);
1852 BOOST_TEST(iTPCset->TPCset == BeginID.
TPCset);
1858 if (nTPCsetsInC0 > 1) {
1864 BOOST_TEST(iTPCsetI != iTPCset);
1868 BOOST_TEST(iTPCsetI == iTPCset);
1878 ID.
TPCset = geom->NTPCsets(ID) - 1;
1883 BOOST_TEST(
bool(iTPCset));
1884 BOOST_TEST(!!iTPCset);
1887 BOOST_TEST(*iTPCset == ID);
1888 BOOST_TEST(iTPCset->Cryostat == ID.
Cryostat);
1889 BOOST_TEST(iTPCset->TPCset == ID.
TPCset);
1900 LastID.
TPCset = geom->NTPCsets(LastID) - 1;
1902 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last TPC set ID: "
1903 << std::string(*iLastTPCset));
1906 BOOST_TEST(
bool(iLastTPCset));
1907 BOOST_TEST(!!iLastTPCset);
1910 BOOST_TEST(*iLastTPCset == LastID);
1911 BOOST_TEST(iLastTPCset->Cryostat == LastID.Cryostat);
1912 BOOST_TEST(iLastTPCset->TPCset == LastID.TPCset);
1919 BOOST_TEST(!
bool(iEndTPCset));
1920 BOOST_TEST(!iEndTPCset);
1925 BOOST_TEST(iEndTPCset == geom->end_TPCset_id());
1935 BOOST_TEST_CHECKPOINT
1936 (
"End-created TPC set ID iterator: " << std::string(*iTPCset));
1943 BOOST_TEST(!
bool(iTPCset));
1944 BOOST_TEST(!iTPCset);
1948 BOOST_TEST(iTPCsetGE == iTPCset);
1956 BOOST_TEST(iTPCset2 == iTPCset);
2016 BOOST_TEST_CHECKPOINT
2017 (
"Default created readout plane ID iterator: " << std::string(*iROP));
2025 BOOST_TEST(!(
bool(iROP)));
2034 BOOST_TEST_CHECKPOINT
2035 (
"Begin-created readout plane ID iterator: " << std::string(*iROP));
2042 BOOST_TEST(
bool(iROP));
2047 geom->GetBeginID(BeginID);
2052 BOOST_TEST(iROPD == iROP);
2056 BOOST_TEST(iROPBC == iROP);
2060 BOOST_TEST(iROPGB == iROP);
2063 BOOST_TEST(*iROP == BeginID);
2064 BOOST_TEST(iROP->Cryostat == BeginID.
Cryostat);
2065 BOOST_TEST(iROP->TPCset == BeginID.
TPCset);
2066 BOOST_TEST(iROP->ROP == BeginID.
ROP);
2071 const unsigned int nReadoutPlanesInC0S0
2073 if (nReadoutPlanesInC0S0 > 1) {
2081 BOOST_TEST(iROPI != iROP);
2085 BOOST_TEST(iROPI == iROP);
2095 ID.
ROP = geom->NROPs(ID) - 1;
2100 BOOST_TEST(
bool(iROP));
2104 BOOST_TEST(*iROP == ID);
2105 BOOST_TEST(iROP->Cryostat == ID.
Cryostat);
2106 BOOST_TEST(iROP->TPCset == ID.
TPCset);
2107 BOOST_TEST(iROP->ROP == ID.
ROP);
2111 if (ID.
TPCset + 1 < (
int) geom->NTPCsets(ID)) {
2112 BOOST_TEST(iROP->Cryostat == ID.
Cryostat);
2113 BOOST_TEST(iROP->TPCset == ID.
TPCset + 1);
2117 BOOST_TEST(iROP->Cryostat == ID.
Cryostat + 1);
2124 LastID.
TPCset = geom->NTPCsets(LastID) - 1;
2125 LastID.ROP = geom->NROPs(LastID) - 1;
2127 BOOST_TEST_CHECKPOINT(
"Position-created iterator to last readout plane ID: "
2128 << std::string(*iLastROP));
2131 BOOST_TEST(
bool(iLastROP));
2132 BOOST_TEST(!!iLastROP);
2135 BOOST_TEST(*iLastROP == LastID);
2136 BOOST_TEST(iLastROP->Cryostat == LastID.Cryostat);
2137 BOOST_TEST(iLastROP->TPCset == LastID.TPCset);
2138 BOOST_TEST(iLastROP->ROP == LastID.ROP);
2145 BOOST_TEST(!
bool(iEndROP));
2146 BOOST_TEST(!iEndROP);
2152 BOOST_TEST(iEndROP == geom->end_ROP_id());
2162 BOOST_TEST_CHECKPOINT
2163 (
"End-created readout plane ID iterator: " << std::string(*iROP));
2171 BOOST_TEST(!
bool(iROP));
2176 BOOST_TEST(iROPGE == iROP);
2185 BOOST_TEST(iROP2 == iROP);
void WireIDIteratorsTest() const
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
static constexpr ROPID_t getInvalidID()
Return the value of the invalid ROP ID as a r-value.
static constexpr BeginPos_t begin_pos
Base forward iterator browsing all wire IDs in the detector.
Base forward iterator browsing all TPC IDs in the detector.
Base forward iterator browsing all readout plane IDs in the detector.
void WireIteratorsTest() const
unsigned int ROPID_t
Type for the ID number.
unsigned short TPCsetID_t
Type for the ID number.
unsigned int PlaneID_t
Type for the ID number.
void CryostatIteratorsTest() const
The data type to uniquely identify a Plane.
Geometry information for a single TPC.
Class identifying a set of TPC sharing readout channels.
static constexpr EndPos_t end_pos
CryostatID_t Cryostat
Index of cryostat.
WireID_t Wire
Index of the wire within its plane.
void TPCIDIteratorsTest() const
Geometry information for a single cryostat.
Tests the correct iteration of the geo::Geometry iterators.
void ROPIDIteratorsTest() const
Access the description of detector geometry.
static constexpr CryostatID_t getInvalidID()
Return the value of the invalid ID as a r-value.
static constexpr TPCID_t getInvalidID()
Return the value of the invalid TPC ID as a r-value.
ROPID_t ROP
Index of the readout plane within its TPC set.
ElementPtr_t get() const
Returns a pointer to plane, or nullptr if invalid.
Base forward iterator browsing all cryostat IDs in the detector.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
void TPCsetIDIteratorsTest() const
The data type to uniquely identify a TPC.
PlaneID_t Plane
Index of the plane within its TPC.
Definition of data types for geometry description.
void PlaneIDIteratorsTest() const
Class identifying a set of planes sharing readout channels.
ElementPtr_t get() const
Returns a pointer to TPC, or nullptr if invalid.
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
void PlaneIteratorsTest() const
static constexpr WireID_t getInvalidID()
Return the value of the invalid wire ID as a r-value.
unsigned int CryostatID_t
Type for the ID number.
Base forward iterator browsing all plane IDs in the detector.
unsigned int TPCID_t
Type for the ID number.
ElementPtr_t get() const
Returns a pointer to cryostat, or nullptr if invalid.
LocalID_t const & ID() const
Returns the ID of the pointed geometry element.
ElementPtr_t get() const
Returns a pointer to wire, or nullptr if invalid.
static constexpr TPCsetID_t getInvalidID()
Return the value of the invalid TPC ID as a r-value.
virtual unsigned int Run() const
Executes the test.
unsigned int WireID_t
Type for the ID number.
TPCID_t TPC
Index of the TPC within its cryostat.
Forward iterator browsing all geometry elements in the detector.
static constexpr PlaneID_t getInvalidID()
Return the value of the invalid plane ID as a r-value.
Base forward iterator browsing all TPC set IDs in the detector.
void CryostatIDIteratorsTest() const
void TPCIteratorsTest() const
The data type to uniquely identify a cryostat.