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);
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));
133 BOOST_TEST(
geom->
NROPs(NonexistingTPCsetID) == 0U);
143 BOOST_TEST_CHECKPOINT(
"TPC: " <<
std::string(tpcID));
147 CheckMatchingTPClevelIDs(tpcsetID, tpcID);
151 BOOST_TEST(TPCs.size() == 1U);
152 BOOST_TEST(TPCs.front() == tpcID);
155 unsigned int const NROPs =
geom->
NROPs(tpcsetID);
159 for (
unsigned int iROPinTPCset = 0; iROPinTPCset < NROPs; ++iROPinTPCset) {
163 BOOST_TEST_CHECKPOINT(
"ROP: " <<
std::string(ropID));
170 BOOST_TEST(TPCs.size() == 1U);
171 BOOST_TEST(TPCs.front() == tpcID);
217 BOOST_TEST_CHECKPOINT(
"TPC: " <<
std::string(tpcID));
221 unsigned int const NROPs =
geom->
NROPs(tpcsetID);
240 BOOST_TEST_MESSAGE(
"plane: " <<
std::string(planeID));
244 CheckMatchingPlaneLevelIDs(ropID, planeID);
255 BOOST_TEST(PlanesInROP.size() == 1U);
256 BOOST_TEST(PlanesInROP.front() == planeID);
260 BOOST_TEST(NChannels ==
geom->
Nwires(planeID));
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
282 BOOST_TEST(ChannelWires.size() == 1U);
283 BOOST_TEST(ChannelWires.front() == planeID);
287 BOOST_TEST(ChannelROPID == ropID);
318 for (
unsigned int iChannel = 0; iChannel < NChannels; ++iChannel) {
321 BOOST_TEST_MESSAGE(
"channel: " << channel);
std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const
Returns a list of ID of TPCs the specified ROP spans.
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.
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.
unsigned int MaxROPs() const
Returns the largest number of ROPs a TPC set in the detector has.
Class identifying a set of TPC sharing readout channels.
unsigned int NTPCsets(readout::CryostatID const &cryoid) const
Returns the total number of TPC sets in the specified cryostat.
readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const
Returns the ID of the ROP planeid belongs to.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
CryostatID_t Cryostat
Index of cryostat.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const
Returns the ID of the TPC set tpcid belongs to.
IteratorBox< TPC_id_iterator,&GeometryCore::begin_TPC_id,&GeometryCore::end_TPC_id > IterateTPCIDs() const
Enables ranged-for loops on all TPC IDs of the detector.
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
IteratorBox< plane_id_iterator,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs() const
Enables ranged-for loops on all plane IDs of the detector.
bool HasROP(readout::ROPID const &ropid) const
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
ROPID_t ROP
Index of the readout plane within its TPC set.
raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const
Returns the ID of the first channel in the specified readout plane.
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.
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
readout::ROPID ChannelToROP(raw::ChannelID_t channel) const
Tests the standard channel mapping algorithm.
virtual unsigned int Run()
Executes the test.
GeometryCore const * geom
pointer to the geometry description
unsigned int MaxTPCsets() const
Returns the largest number of TPC sets any cryostat in the detector has.
IteratorBox< cryostat_id_iterator,&GeometryCore::begin_cryostat_id,&GeometryCore::end_cryostat_id > IterateCryostatIDs() const
Enables ranged-for loops on all cryostat IDs of the detector.
std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const
Returns a list of ID of planes belonging to the specified ROP.
void TPCsetMappingTest() const
Tests TPCset mappings.
Access the description of detector geometry.
unsigned int NROPs(readout::TPCsetID const &tpcsetid) const
Returns the total number of ROP in the specified TPC set.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
TPCID_t TPC
Index of the TPC within its cryostat.
std::vector< geo::TPCID > TPCsetToTPCs(readout::TPCsetID const &tpcsetid) const
Returns a list of ID of TPCs belonging to the specified TPC set.
unsigned int MaxTPCs() const
Returns the largest number of TPCs a cryostat in the detector has.
bool HasChannel(raw::ChannelID_t channel) const
Returns whether the specified channel exists and is valid.
The data type to uniquely identify a cryostat.
bool HasTPCset(readout::TPCsetID const &tpcsetid) const