17 #include "cetlib_except/exception.h"
20 #include <boost/test/unit_test.hpp>
30 void CheckMatchingTPClevelIDs
39 void CheckMatchingPlaneLevelIDs
42 CheckMatchingTPClevelIDs(ropID, planeID);
43 BOOST_TEST(planeID.
Plane == ropID.
ROP);
95 BOOST_TEST(geom->NTPCsets({}) == 0U);
96 BOOST_TEST(!geom->HasTPCset({}));
97 BOOST_TEST(!geom->TPCtoTPCset({}).isValid);
98 BOOST_TEST(geom->TPCsetToTPCs({}).
empty());
99 BOOST_TEST(geom->NROPs({}) == 0U);
100 BOOST_TEST(!geom->HasROP({}));
101 BOOST_TEST(geom->ROPtoTPCs({}).
empty());
107 BOOST_TEST(geom->MaxTPCsets() == geom->MaxTPCs());
110 BOOST_TEST(geom->MaxROPs() == geom->MaxPlanes());
114 BOOST_TEST(geom->NTPCsets(NonexistingCryostatID) == 0U);
120 BOOST_TEST_CHECKPOINT(
"cryostat: " << std::string(cryostatID));
126 unsigned int const NTPCsets = geom->NTPCsets(ROcryostatID);
127 BOOST_TEST(NTPCsets == geom->NTPC(cryostatID));
132 BOOST_TEST(!geom->HasTPCset(NonexistingTPCsetID));
133 BOOST_TEST(geom->NROPs(NonexistingTPCsetID) == 0U);
142 for (
geo::TPCID const& tpcID: geom->IterateTPCIDs()) {
143 BOOST_TEST_CHECKPOINT(
"TPC: " << std::string(tpcID));
147 CheckMatchingTPClevelIDs(tpcsetID, tpcID);
150 std::vector<geo::TPCID>
TPCs = geom->TPCsetToTPCs(tpcsetID);
151 BOOST_TEST(TPCs.size() == 1U);
152 BOOST_TEST(TPCs.front() == tpcID);
155 unsigned int const NROPs = geom->NROPs(tpcsetID);
156 BOOST_TEST(NROPs == geom->Nplanes(tpcID));
159 for (
unsigned int iROPinTPCset = 0; iROPinTPCset < NROPs; ++iROPinTPCset) {
163 BOOST_TEST_CHECKPOINT(
"ROP: " << std::string(ropID));
166 BOOST_TEST(geom->HasROP(ropID));
169 std::vector<geo::TPCID> TPCs = geom->ROPtoTPCs(ropID);
170 BOOST_TEST(TPCs.size() == 1U);
171 BOOST_TEST(TPCs.front() == tpcID);
206 BOOST_TEST(geom->Nchannels({}) == 0U);
207 BOOST_TEST(!geom->WirePlaneToROP({}).isValid);
208 BOOST_TEST(geom->ROPtoWirePlanes({}).
empty());
209 BOOST_TEST(geom->ROPtoTPCs({}).
empty());
216 for (
geo::TPCID const& tpcID: geom->IterateTPCIDs()) {
217 BOOST_TEST_CHECKPOINT(
"TPC: " << std::string(tpcID));
221 unsigned int const NROPs = geom->NROPs(tpcsetID);
225 BOOST_TEST(!geom->HasROP(NonexistingROPID));
239 for (
geo::PlaneID const& planeID: geom->IteratePlaneIDs()) {
240 BOOST_TEST_MESSAGE(
"plane: " << std::string(planeID));
244 CheckMatchingPlaneLevelIDs(ropID, planeID);
254 std::vector<geo::PlaneID>
const PlanesInROP = geom->ROPtoWirePlanes(ropID);
255 BOOST_TEST(PlanesInROP.size() == 1U);
256 BOOST_TEST(PlanesInROP.front() == planeID);
259 unsigned int const NChannels = geom->Nchannels(ropID);
260 BOOST_TEST(NChannels == geom->Nwires(planeID));
263 std::vector<geo::TPCID>
const TPCs = geom->ROPtoTPCs(ropID);
264 BOOST_TEST(TPCs.size() == 1U);
265 BOOST_TEST(TPCs.front() == planeID.asTPCID());
273 unsigned int iChannelInROP = 0; iChannelInROP <
NChannels; ++iChannelInROP
277 BOOST_TEST_CHECKPOINT(
"channel: " << channelID);
280 std::vector<geo::WireID>
const ChannelWires
281 = geom->ChannelToWire(channelID);
282 BOOST_TEST(ChannelWires.size() == 1U);
283 BOOST_TEST(ChannelWires.front() == planeID);
286 readout::ROPID const ChannelROPID = geom->ChannelToROP(channelID);
287 BOOST_TEST(ChannelROPID == ropID);
317 unsigned int const NChannels = geom->Nchannels();
318 for (
unsigned int iChannel = 0; iChannel <
NChannels; ++iChannel) {
321 BOOST_TEST_MESSAGE(
"channel: " << channel);
323 BOOST_TEST(geom->HasChannel(iChannel));
void ChannelMappingTest() const
Tests channel mappings (very, very partial)
Classes identifying readout-related concepts.
void ROPMappingTest() const
Tests ROP mappings.
unsigned int ROPID_t
Type for the ID number.
BEGIN_PROLOG opflashtpc1 TPCs
unsigned short TPCsetID_t
Type for the ID number.
The data type to uniquely identify a Plane.
bool isValid
Whether this ID points to a valid element.
Class identifying a set of TPC sharing readout channels.
CryostatID_t Cryostat
Index of cryostat.
Access the description of detector geometry.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
ROPID_t ROP
Index of the readout plane within its TPC set.
constexpr bool isValidChannelID(raw::ChannelID_t channel)
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.
Class identifying a set of planes sharing readout channels.
TPCsetID_t TPCset
Index of the TPC set within its cryostat.
Tests the standard channel mapping algorithm.
virtual unsigned int Run()
Executes the test.
void TPCsetMappingTest() const
Tests TPCset mappings.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
TPCID_t TPC
Index of the TPC within its cryostat.
bool empty(FixedBins< T, C > const &) noexcept
The data type to uniquely identify a cryostat.