115 std::size_t
const N = NCryostats * NTPCs * NPlanes;
118 BOOST_TEST(mapper.
dimSize<0U>() == NCryostats);
119 BOOST_TEST(mapper.
dimSize<1U>() == NTPCs);
120 BOOST_TEST(mapper.
dimSize<2U>() == NPlanes);
121 BOOST_TEST(mapper.
dimSize<3U>() == 0U);
123 BOOST_TEST(!mapper.
empty());
124 BOOST_TEST(mapper.
size() ==
N);
126 auto expected_index = Mapper_t::index_type{ 0 };
127 for (
auto c: util::counter<unsigned int>(NCryostats)) {
128 for (
auto t: util::counter<unsigned int>(NTPCs)) {
129 for (
auto p: util::counter<unsigned int>(NPlanes)) {
132 BOOST_TEST(mapper.
index(expected_ID) == expected_index);
133 BOOST_TEST(mapper.
ID(expected_index) == expected_ID);
139 BOOST_TEST(mapper.
size() == expected_index);
144 BOOST_TEST( mapper.
hasPlane({ 0, 0, 0}));
145 BOOST_TEST( mapper.
hasPlane({ 0, 0, 1}));
146 BOOST_TEST(!mapper.
hasPlane({ 0, 0, 2}));
147 BOOST_TEST( mapper.
hasPlane({ 0, 1, 0}));
148 BOOST_TEST( mapper.
hasPlane({ 0, 1, 1}));
149 BOOST_TEST(!mapper.
hasPlane({ 0, 1, 2}));
150 BOOST_TEST( mapper.
hasPlane({ 0, 2, 0}));
151 BOOST_TEST( mapper.
hasPlane({ 0, 2, 1}));
152 BOOST_TEST(!mapper.
hasPlane({ 0, 2, 2}));
153 BOOST_TEST(!mapper.
hasPlane({ 0, 3, 0}));
154 BOOST_TEST(!mapper.
hasPlane({ 0, 3, 1}));
155 BOOST_TEST(!mapper.
hasPlane({ 0, 3, 2}));
156 BOOST_TEST(!mapper.
hasPlane({ 0, 4, 0}));
157 BOOST_TEST(!mapper.
hasPlane({ 0, 4, 1}));
158 BOOST_TEST(!mapper.
hasPlane({ 0, 4, 2}));
159 BOOST_TEST( mapper.
hasPlane({ 1, 0, 0}));
160 BOOST_TEST( mapper.
hasPlane({ 1, 0, 1}));
161 BOOST_TEST(!mapper.
hasPlane({ 1, 0, 2}));
162 BOOST_TEST( mapper.
hasPlane({ 1, 1, 0}));
163 BOOST_TEST( mapper.
hasPlane({ 1, 1, 1}));
164 BOOST_TEST(!mapper.
hasPlane({ 1, 1, 2}));
165 BOOST_TEST( mapper.
hasPlane({ 1, 2, 0}));
166 BOOST_TEST( mapper.
hasPlane({ 1, 2, 1}));
167 BOOST_TEST(!mapper.
hasPlane({ 1, 2, 2}));
168 BOOST_TEST(!mapper.
hasPlane({ 1, 3, 0}));
169 BOOST_TEST(!mapper.
hasPlane({ 1, 3, 1}));
170 BOOST_TEST(!mapper.
hasPlane({ 1, 3, 2}));
171 BOOST_TEST(!mapper.
hasPlane({ 1, 4, 0}));
172 BOOST_TEST(!mapper.
hasPlane({ 1, 4, 1}));
173 BOOST_TEST(!mapper.
hasPlane({ 1, 4, 2}));
174 BOOST_TEST(!mapper.
hasPlane({ 2, 0, 0}));
175 BOOST_TEST(!mapper.
hasPlane({ 2, 0, 1}));
176 BOOST_TEST(!mapper.
hasPlane({ 2, 0, 2}));
177 BOOST_TEST(!mapper.
hasPlane({ 2, 1, 0}));
178 BOOST_TEST(!mapper.
hasPlane({ 2, 1, 1}));
179 BOOST_TEST(!mapper.
hasPlane({ 2, 1, 2}));
180 BOOST_TEST(!mapper.
hasPlane({ 2, 2, 0}));
181 BOOST_TEST(!mapper.
hasPlane({ 2, 2, 1}));
182 BOOST_TEST(!mapper.
hasPlane({ 2, 2, 2}));
183 BOOST_TEST(!mapper.
hasPlane({ 2, 3, 0}));
184 BOOST_TEST(!mapper.
hasPlane({ 2, 3, 1}));
185 BOOST_TEST(!mapper.
hasPlane({ 2, 3, 2}));
186 BOOST_TEST(!mapper.
hasPlane({ 2, 4, 0}));
187 BOOST_TEST(!mapper.
hasPlane({ 2, 4, 1}));
188 BOOST_TEST(!mapper.
hasPlane({ 2, 4, 2}));
283 auto const& constMapper = mapper;
285 BOOST_TEST(constMapper.dimSize<0U>() == NCryostats);
286 BOOST_TEST(constMapper.dimSize<1U>() == NTPCs);
287 BOOST_TEST(constMapper.dimSize<2U>() == NPlanes);
288 BOOST_TEST(constMapper.dimSize<3U>() == 0U);
291 BOOST_TEST(mapper.
empty());
ID_t ID(index_type const index) const
Returns the ID corresponding to the specified linear index.
bool hasCryostat(geo::CryostatID const &cryoid) const
Returns whether this mapping covers the specified cryostat.
index_type size() const
Returns the number of elements in the mapping.
GeoID firstID() const
Returns the ID of the first element with GeoID type.
The data type to uniquely identify a Plane.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
static constexpr unsigned int dimensions()
Dimensions of the ID of this mapping.
unsigned int dimSize() const
Dimensions of the Level dimension of this mapping.
GeoID lastID() const
Returns the ID of the last covered element with GeoID type.
bool empty() const
Returns whether the mapping has no elements (false by assumptions).
process_name largeant stream1 can override from command line with o or output physics producers generator N
index_type index(ID_t const &id) const
Returns the linear index corresponding to the specified ID.
bool hasPlane(geo::PlaneID const &planeid) const
Returns whether this mapping covers the specified plane.
bool hasTPC(geo::TPCID const &tpcid) const
Returns whether this mapping covers the specified TPC.
void clear()
Sets all dimension sizes to 0.