All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
geo_types_fhicl_test.cc File Reference

Test of larcoreobj/SimpleTypesAndConstants/geo_types_fhicl.h. More...

#include "boost/test/unit_test.hpp"
#include "larcoreobj/SimpleTypesAndConstants/geo_types_fhicl.h"
#include "larcoreobj/SimpleTypesAndConstants/geo_types.h"
#include "fhiclcpp/types/Table.h"
#include "fhiclcpp/ParameterSet.h"
#include <array>
#include <iostream>
#include <stdexcept>
#include <string>
#include <type_traits>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   ( geo_types_fhicl_test )
 

Functions

template<typename Config >
fhicl::Table< Config > validateConfig (std::string const &configStr)
 
void test_CryostatID_normal ()
 
void test_CryostatID_invalid ()
 
void test_OptionalCryostatID_present ()
 
void test_OptionalCryostatID_omitted ()
 
void test_CryostatIDsequence_normal ()
 
void test_CryostatIDsequence_empty ()
 
void test_OptionalCryostatIDsequence_normal ()
 
void test_OptionalCryostatIDsequence_empty ()
 
void test_OptionalCryostatIDsequence_omitted ()
 
void test_OpDetID_normal ()
 
void test_OpDetID_invalid ()
 
void test_OptionalOpDetID_present ()
 
void test_OptionalOpDetID_omitted ()
 
void test_OpDetIDsequence_normal ()
 
void test_OpDetIDsequence_empty ()
 
void test_OptionalOpDetIDsequence_normal ()
 
void test_OptionalOpDetIDsequence_empty ()
 
void test_OptionalOpDetIDsequence_omitted ()
 
void test_TPCID_normal ()
 
void test_TPCID_invalid ()
 
void test_OptionalTPCID_present ()
 
void test_OptionalTPCID_omitted ()
 
void test_TPCIDsequence_normal ()
 
void test_TPCIDsequence_empty ()
 
void test_OptionalTPCIDsequence_normal ()
 
void test_OptionalTPCIDsequence_empty ()
 
void test_OptionalTPCIDsequence_omitted ()
 
void test_PlaneID_normal ()
 
void test_PlaneID_invalid ()
 
void test_OptionalPlaneID_present ()
 
void test_OptionalPlaneID_omitted ()
 
void test_PlaneIDsequence_normal ()
 
void test_PlaneIDsequence_empty ()
 
void test_OptionalPlaneIDsequence_normal ()
 
void test_OptionalPlaneIDsequence_empty ()
 
void test_OptionalPlaneIDsequence_omitted ()
 
void test_WireID_normal ()
 
void test_WireID_invalid ()
 
void test_OptionalWireID_present ()
 
void test_OptionalWireID_omitted ()
 
void test_WireIDsequence_normal ()
 
void test_WireIDsequence_empty ()
 
void test_OptionalWireIDsequence_normal ()
 
void test_OptionalWireIDsequence_empty ()
 
void test_OptionalWireIDsequence_omitted ()
 
void test_WireUnifiedInterface ()
 
void test_groupDocumentation_example1 ()
 
void test_groupDocumentation_example2 ()
 
 BOOST_AUTO_TEST_CASE (CryostatID_testcase)
 
 BOOST_AUTO_TEST_CASE (OpDetID_testcase)
 
 BOOST_AUTO_TEST_CASE (TPCID_testcase)
 
 BOOST_AUTO_TEST_CASE (PlaneID_testcase)
 
 BOOST_AUTO_TEST_CASE (WireID_testcase)
 
 BOOST_AUTO_TEST_CASE (documentation_testcase)
 

Detailed Description

Test of larcoreobj/SimpleTypesAndConstants/geo_types_fhicl.h.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.slac..nosp@m.stan.nosp@m.ford..nosp@m.edu)
Date
November 25, 2019

Definition in file geo_types_fhicl_test.cc.

Macro Definition Documentation

#define BOOST_TEST_MODULE   ( geo_types_fhicl_test )

Definition at line 9 of file geo_types_fhicl_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( CryostatID_testcase  )

Definition at line 1589 of file geo_types_fhicl_test.cc.

1589  {
1590 
1593 
1596 
1599 
1603 
1604 } // BOOST_AUTO_TEST_CASE(CryostatID_testcase)
void test_OptionalCryostatIDsequence_omitted()
void test_CryostatID_invalid()
void test_CryostatID_normal()
void test_OptionalCryostatID_omitted()
void test_OptionalCryostatID_present()
void test_CryostatIDsequence_empty()
void test_OptionalCryostatIDsequence_empty()
void test_CryostatIDsequence_normal()
void test_OptionalCryostatIDsequence_normal()
BOOST_AUTO_TEST_CASE ( OpDetID_testcase  )

Definition at line 1611 of file geo_types_fhicl_test.cc.

1611  {
1612 
1615 
1618 
1621 
1625 
1626 } // BOOST_AUTO_TEST_CASE(OpDetID_testcase)
void test_OptionalOpDetIDsequence_omitted()
void test_OptionalOpDetIDsequence_empty()
void test_OpDetIDsequence_empty()
void test_OptionalOpDetID_omitted()
void test_OptionalOpDetIDsequence_normal()
void test_OpDetID_invalid()
void test_OpDetID_normal()
void test_OpDetIDsequence_normal()
void test_OptionalOpDetID_present()
BOOST_AUTO_TEST_CASE ( TPCID_testcase  )

Definition at line 1633 of file geo_types_fhicl_test.cc.

1633  {
1634 
1637 
1640 
1643 
1647 
1648 } // BOOST_AUTO_TEST_CASE(TPCID_testcase)
void test_OptionalTPCIDsequence_omitted()
void test_OptionalTPCIDsequence_empty()
void test_OptionalTPCIDsequence_normal()
void test_TPCID_normal()
void test_TPCIDsequence_normal()
void test_TPCID_invalid()
void test_OptionalTPCID_omitted()
void test_TPCIDsequence_empty()
void test_OptionalTPCID_present()
BOOST_AUTO_TEST_CASE ( PlaneID_testcase  )

Definition at line 1655 of file geo_types_fhicl_test.cc.

1655  {
1656 
1659 
1662 
1665 
1669 
1670 } // BOOST_AUTO_TEST_CASE(PlaneID_testcase)
void test_PlaneIDsequence_normal()
void test_PlaneID_invalid()
void test_OptionalPlaneID_present()
void test_OptionalPlaneIDsequence_normal()
void test_PlaneIDsequence_empty()
void test_OptionalPlaneIDsequence_omitted()
void test_OptionalPlaneID_omitted()
void test_OptionalPlaneIDsequence_empty()
void test_PlaneID_normal()
BOOST_AUTO_TEST_CASE ( WireID_testcase  )

Definition at line 1677 of file geo_types_fhicl_test.cc.

1677  {
1678 
1681 
1684 
1687 
1691 
1693 
1694 } // BOOST_AUTO_TEST_CASE(WireID_testcase)
void test_WireIDsequence_normal()
void test_WireID_normal()
void test_OptionalWireID_omitted()
void test_WireIDsequence_empty()
void test_WireID_invalid()
void test_OptionalWireID_present()
void test_OptionalWireIDsequence_omitted()
void test_OptionalWireIDsequence_normal()
void test_WireUnifiedInterface()
void test_OptionalWireIDsequence_empty()
BOOST_AUTO_TEST_CASE ( documentation_testcase  )

Definition at line 1701 of file geo_types_fhicl_test.cc.

1701  {
1702 
1705 
1706 } // BOOST_AUTO_TEST_CASE(documentation_testcase)
void test_groupDocumentation_example2()
void test_groupDocumentation_example1()
void test_CryostatID_invalid ( )

Definition at line 72 of file geo_types_fhicl_test.cc.

72  {
73 
74  using ID_t = geo::CryostatID;
75  struct Config { geo::fhicl::CryostatID Cryo { fhicl::Name("Cryo") }; };
76 
77  std::string const configStr { "Cryo: { isValid:false }" };
78  ID_t const expectedID {};
79 
80  auto validatedConfig = validateConfig<Config>(configStr)();
81 
82  auto const id = geo::fhicl::readID(validatedConfig.Cryo);
83  static_assert(std::is_same_v<decltype(id), ID_t const>);
84  BOOST_TEST(id.isValid == expectedID.isValid);
85  if (expectedID.isValid) {
86  BOOST_TEST(validatedConfig.Cryo().ID() == expectedID);
87  BOOST_TEST(id == expectedID);
88  }
89 } // test_CryostatID_invalid()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_CryostatID_normal ( )

Definition at line 52 of file geo_types_fhicl_test.cc.

52  {
53 
54  using ID_t = geo::CryostatID;
55  struct Config { geo::fhicl::CryostatID Cryo { fhicl::Name("Cryo") }; };
56 
57  std::string const configStr { "Cryo: { C:2 }" };
58  ID_t const expectedID { 2U };
59 
60  auto validatedConfig = validateConfig<Config>(configStr)();
61 
62  auto const id = geo::fhicl::readID(validatedConfig.Cryo);
63  static_assert(std::is_same_v<decltype(id), ID_t const>);
64  BOOST_TEST(id.isValid == expectedID.isValid);
65  if (expectedID.isValid) {
66  BOOST_TEST(validatedConfig.Cryo().ID() == expectedID);
67  BOOST_TEST(id == expectedID);
68  }
69 } // test_CryostatID_normal()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_CryostatIDsequence_empty ( )

Definition at line 165 of file geo_types_fhicl_test.cc.

165  {
166 
167  using ID_t = geo::CryostatID;
168  struct Config
169  { geo::fhicl::CryostatIDsequence Cryos { fhicl::Name("Cryos") }; };
170 
171  std::string const configStr { "Cryos: []" };
172 
173  auto validatedConfig = validateConfig<Config>(configStr)();
174 
175  auto ids = geo::fhicl::readIDsequence(validatedConfig.Cryos);
176  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
177 
178  BOOST_TEST(ids.size() == 0U);
179 
180 } // test_CryostatIDsequence_empty()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
IDsequence< geo::CryostatID > CryostatIDsequence
Member type of sequence of geo::CryostatID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_CryostatIDsequence_normal ( )

Definition at line 134 of file geo_types_fhicl_test.cc.

134  {
135 
136  using ID_t = geo::CryostatID;
137  struct Config
138  { geo::fhicl::CryostatIDsequence Cryos { fhicl::Name("Cryos") }; };
139 
140  std::string const configStr { "Cryos: [ { C:0 }, { C:2 } ]" };
141  // BUG the double brace syntax is required to work around clang bug 21629
142 // std::array<ID_t, 2U> const expectedIDs { ID_t{ 0U }, ID_t{ 2U } };
143  std::array<ID_t, 2U> const expectedIDs {{ ID_t{ 0U }, ID_t{ 2U } }};
144 
145  auto validatedConfig = validateConfig<Config>(configStr)();
146 
147  auto ids = geo::fhicl::readIDsequence(validatedConfig.Cryos);
148  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
149 
150  BOOST_TEST(ids.size() == expectedIDs.size());
151  auto const n = std::min(ids.size(), expectedIDs.size());
152  for (std::size_t i = 0; i < n; ++i) {
153  auto const& id = ids[i];
154  ID_t const& expectedID = expectedIDs[i];
155 
156  BOOST_TEST_CONTEXT("Item [" << i << "]") {
157  BOOST_TEST(id.isValid == expectedID.isValid);
158  if (expectedID.isValid) BOOST_TEST(id == expectedID);
159  } // BOOST_TEST_CONTEXT
160  } // for
161 
162 } // test_CryostatIDsequence_normal()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
IDsequence< geo::CryostatID > CryostatIDsequence
Member type of sequence of geo::CryostatID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_groupDocumentation_example1 ( )

Definition at line 1412 of file geo_types_fhicl_test.cc.

1412  {
1413  /*
1414  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1415  * struct Config {
1416  *
1417  * geo::fhicl::PlaneIDsequence Planes {
1418  * fhicl::Name("Planes"),
1419  * fhicl::Comment("anode planes to process")
1420  * };
1421  *
1422  * geo::fhicl::OptionalPlaneID ReferencePlane {
1423  * fhicl::Name("ReferencePlane"),
1424  * fhicl::Comment("reference anode plane (first one by default)")
1425  * };
1426  *
1427  * }; // struct Config
1428  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1429  * which can be configured as:
1430  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1431  * Planes: [
1432  * { C:0 T:1 P:0 },
1433  * { C:0 T:1 P:1 },
1434  * { C:0 T:1 P:2 }
1435  * ]
1436  * ReferencePlane: { C:0 T:1 P:2 }
1437  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1438  * and read as:
1439  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1440  * void readParams(art::EDProducer::Table<Config> const& config) {
1441  *
1442  * std::vector<geo::PlaneID> planes
1443  * = geo::fhicl::readIDsequence(config().Planes);
1444  * if (planes.empty()) {
1445  * throw art::Exception(art::errors::Configuration)
1446  * << "At least one plane is needed.\n";
1447  * }
1448  *
1449  * geo::PlaneID refPlane; // invalid by default
1450  * if (!config().ReferencePlane(refPlane)) refPlane = planes.front();
1451  *
1452  * } // readParams()
1453  *
1454  */
1455 
1456  //
1457  // code (adapted to non-art context)
1458  //
1459  struct Config {
1460 
1462  fhicl::Name("Planes"),
1463  fhicl::Comment("anode planes to process")
1464  };
1465 
1466  geo::fhicl::OptionalPlaneID ReferencePlane {
1467  fhicl::Name("ReferencePlane"),
1468  fhicl::Comment("reference anode plane (first one by default)")
1469  };
1470 
1471  }; // struct Config
1472 
1473  std::string const configStr = {
1474  "Planes: ["
1475  "\n { C:0 T:1 P:0 },"
1476  "\n { C:0 T:1 P:1 },"
1477  "\n { C:0 T:1 P:2 }"
1478  "\n ]"
1479  "\nReferencePlane: { C:0 T:1 P:2 }"
1480  "\n"
1481  };
1482 
1483 
1484  fhicl::Table<Config> config = validateConfig<Config>(configStr);
1485 
1486  std::vector<geo::PlaneID> const planes
1487  = geo::fhicl::readIDsequence(config().Planes);
1488  if (planes.empty()) {
1489  throw std::runtime_error("At least one plane is needed.");
1490  }
1491 
1492  geo::PlaneID const refPlane
1493  = geo::fhicl::readOptionalID(config().ReferencePlane)
1494  .value_or(planes.front())
1495  ;
1496 
1497  //
1498  // test
1499  //
1500  BOOST_TEST(planes.size() == 3U);
1501  BOOST_TEST(planes[0U] == geo::PlaneID(0U, 1U, 0U));
1502  BOOST_TEST(planes[1U] == geo::PlaneID(0U, 1U, 1U));
1503  BOOST_TEST(planes[2U] == geo::PlaneID(0U, 1U, 2U));
1504 
1505  BOOST_TEST(refPlane == geo::PlaneID(0U, 1U, 2U));
1506 
1507 } // test_groupDocumentation_example1()
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
IDsequence< geo::PlaneID > PlaneIDsequence
Member type of sequence of geo::PlaneID parameters.
OptionalID< geo::PlaneID > OptionalPlaneID
Member type of optional validated geo::PlaneID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
BEGIN_PROLOG Z planes
void test_groupDocumentation_example2 ( )

Definition at line 1511 of file geo_types_fhicl_test.cc.

1511  {
1512  /*
1513  * struct Config {
1514  *
1515  * geo::fhicl::OptionalPlaneIDsequence Planes {
1516  * fhicl::Name("Planes"),
1517  * fhicl::Comment("anode planes to process (omit or empty processes all)")
1518  * };
1519  *
1520  * }; // struct Config
1521  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1522  * reading as:
1523  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
1524  * void readParams(art::EDProducer::Table<Config> const& config) {
1525  *
1526  * std::vector<geo::PlaneID> planes
1527  * = geo::fhicl::readOptionalIDsequence(config().Planes, {});
1528  *
1529  * } // readParams()
1530  *
1531  */
1532 
1533  //
1534  // code (adapted to non-art context)
1535  //
1536  struct Config {
1537 
1539  fhicl::Name("Planes"),
1540  fhicl::Comment("anode planes to process (omit or empty processes all)")
1541  };
1542 
1543  }; // struct Config
1544 
1545  //
1546  // test A
1547  //
1548  std::string const configStrA = {
1549  "Planes: ["
1550  "\n { C:0 T:1 P:0 },"
1551  "\n { C:0 T:1 P:1 },"
1552  "\n { C:0 T:1 P:2 }"
1553  "\n ]"
1554  "\n"
1555  };
1556 
1557  fhicl::Table<Config> configA = validateConfig<Config>(configStrA);
1558 
1559  std::vector<geo::PlaneID> planes
1560  = geo::fhicl::readOptionalIDsequence(configA().Planes, {});
1561 
1562  BOOST_TEST(planes.size() == 3U);
1563  BOOST_TEST(planes[0U] == geo::PlaneID(0U, 1U, 0U));
1564  BOOST_TEST(planes[1U] == geo::PlaneID(0U, 1U, 1U));
1565  BOOST_TEST(planes[2U] == geo::PlaneID(0U, 1U, 2U));
1566 
1567  //
1568  // test B
1569  //
1570  std::string const configStrB = { "" };
1571 
1572  fhicl::Table<Config> configB = validateConfig<Config>(configStrB);
1573 
1574  planes = geo::fhicl::readOptionalIDsequence(configB().Planes, {});
1575 
1576  BOOST_TEST(planes.empty());
1577 
1578 
1579 } // test_groupDocumentation_example2()
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
BEGIN_PROLOG Z planes
OptionalIDsequence< geo::PlaneID > OptionalPlaneIDsequence
Member type of optional sequence of geo::PlaneID parameters.
void test_OpDetID_invalid ( )

Definition at line 308 of file geo_types_fhicl_test.cc.

308  {
309 
310  using ID_t = geo::OpDetID;
311  struct Config { geo::fhicl::OpDetID OpDet { fhicl::Name("OpDet") }; };
312 
313  std::string const configStr { "OpDet: { isValid:false }" };
314  ID_t const expectedID {};
315 
316  auto validatedConfig = validateConfig<Config>(configStr)();
317 
318  auto const id = geo::fhicl::readID(validatedConfig.OpDet);
319  static_assert(std::is_same_v<decltype(id), ID_t const>);
320  BOOST_TEST(id.isValid == expectedID.isValid);
321  if (expectedID.isValid) {
322  BOOST_TEST(validatedConfig.OpDet().ID() == expectedID);
323  BOOST_TEST(id == expectedID);
324  }
325 } // test_OpDetID_invalid()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OpDetID_normal ( )

Definition at line 288 of file geo_types_fhicl_test.cc.

288  {
289 
290  using ID_t = geo::OpDetID;
291  struct Config { geo::fhicl::OpDetID OpDet { fhicl::Name("OpDet") }; };
292 
293  std::string const configStr { "OpDet: { C:2 O:3 }" };
294  ID_t const expectedID { 2U, 3U };
295 
296  auto validatedConfig = validateConfig<Config>(configStr)();
297 
298  auto const id = geo::fhicl::readID(validatedConfig.OpDet);
299  static_assert(std::is_same_v<decltype(id), ID_t const>);
300  BOOST_TEST(id.isValid == expectedID.isValid);
301  if (expectedID.isValid) {
302  BOOST_TEST(validatedConfig.OpDet().ID() == expectedID);
303  BOOST_TEST(id == expectedID);
304  }
305 } // test_OpDetID_normal()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OpDetIDsequence_empty ( )

Definition at line 401 of file geo_types_fhicl_test.cc.

401  {
402 
403  using ID_t = geo::OpDetID;
404  struct Config
405  { geo::fhicl::OpDetIDsequence OpDets { fhicl::Name("OpDets") }; };
406 
407  std::string const configStr { "OpDets: []" };
408 
409  auto validatedConfig = validateConfig<Config>(configStr)();
410 
411  auto ids = geo::fhicl::readIDsequence(validatedConfig.OpDets);
412  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
413 
414  BOOST_TEST(ids.size() == 0U);
415 
416 } // test_OpDetIDsequence_empty()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDsequence< geo::OpDetID > OpDetIDsequence
Member type of sequence of geo::OpDetID parameters.
void test_OpDetIDsequence_normal ( )

Definition at line 370 of file geo_types_fhicl_test.cc.

370  {
371 
372  using ID_t = geo::OpDetID;
373  struct Config
374  { geo::fhicl::OpDetIDsequence OpDets { fhicl::Name("OpDets") }; };
375 
376  std::string const configStr { "OpDets: [ { C:0 O:1 }, { C:2 O:3 } ]" };
377  // BUG the double brace syntax is required to work around clang bug 21629
378 // std::array<ID_t, 2U> const expectedIDs { ID_t{ 0U, 1U }, ID_t{ 2U, 3U } };
379  std::array<ID_t, 2U> const expectedIDs {{ ID_t{ 0U, 1U }, ID_t{ 2U, 3U } }};
380 
381  auto validatedConfig = validateConfig<Config>(configStr)();
382 
383  auto ids = geo::fhicl::readIDsequence(validatedConfig.OpDets);
384  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
385 
386  BOOST_TEST(ids.size() == expectedIDs.size());
387  auto const n = std::min(ids.size(), expectedIDs.size());
388  for (std::size_t i = 0; i < n; ++i) {
389  auto const& id = ids[i];
390  ID_t const& expectedID = expectedIDs[i];
391 
392  BOOST_TEST_CONTEXT("Item [" << i << "]") {
393  BOOST_TEST(id.isValid == expectedID.isValid);
394  if (expectedID.isValid) BOOST_TEST(id == expectedID);
395  } // BOOST_TEST_CONTEXT
396  } // for
397 
398 } // test_OpDetIDsequence_normal()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDsequence< geo::OpDetID > OpDetIDsequence
Member type of sequence of geo::OpDetID parameters.
void test_OptionalCryostatID_omitted ( )

Definition at line 112 of file geo_types_fhicl_test.cc.

112  {
113 
114  using ID_t = geo::CryostatID;
115  struct Config { geo::fhicl::OptionalCryostatID Cryo { fhicl::Name("Cryo") }; };
116 
117  std::string const configStr { "" };
118 
119  std::optional<ID_t> const expectedID;
120 
121  auto validatedConfig = validateConfig<Config>(configStr)();
122 
123  std::optional<ID_t> const id
124  = geo::fhicl::readOptionalID(validatedConfig.Cryo);
125  BOOST_TEST(id.has_value() == expectedID.has_value());
126  if (expectedID.has_value()) {
127  BOOST_TEST(id->isValid == expectedID->isValid);
128  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
129  }
130 
131 } // test_OptionalCryostatID_omitted()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
OptionalID< geo::CryostatID > OptionalCryostatID
Member type of optional validated geo::CryostatID parameter.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalCryostatID_present ( )

Definition at line 92 of file geo_types_fhicl_test.cc.

92  {
93 
94  using ID_t = geo::CryostatID;
95  struct Config { geo::fhicl::OptionalCryostatID Cryo { fhicl::Name("Cryo") }; };
96 
97  std::string const configStr { "Cryo: { C:1 }" };
98  auto const expectedID = std::make_optional<ID_t>(1U);
99 
100  auto validatedConfig = validateConfig<Config>(configStr)();
101 
102  std::optional<ID_t> const id = readOptionalID(validatedConfig.Cryo);
103  BOOST_TEST(id.has_value() == expectedID.has_value());
104  if (expectedID.has_value()) {
105  BOOST_TEST(id->isValid == expectedID->isValid);
106  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
107  }
108 
109 } // test_OptionalCryostatID_present()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
OptionalID< geo::CryostatID > OptionalCryostatID
Member type of optional validated geo::CryostatID parameter.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalCryostatIDsequence_empty ( )

Definition at line 217 of file geo_types_fhicl_test.cc.

217  {
218 
219  using ID_t = geo::CryostatID;
220  struct Config
221  { geo::fhicl::OptionalCryostatIDsequence Cryos { fhicl::Name("Cryos") }; };
222 
223  std::string const configStr { "Cryos: []" };
224  std::optional<std::vector<ID_t>> const expectedIDs(std::in_place);
225 
226  auto validatedConfig = validateConfig<Config>(configStr)();
227 
228  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Cryos);
229  static_assert
230  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
231 
232  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
233  if (expectedIDs.has_value()) {
234  BOOST_TEST(ids->size() == expectedIDs->size());
235  auto const n = std::min(ids->size(), expectedIDs->size());
236  for (std::size_t i = 0; i < n; ++i) {
237  auto const& id = ids.value()[i];
238  ID_t const& expectedID = expectedIDs.value()[i];
239 
240  BOOST_TEST_CONTEXT("Item [" << i << "]") {
241  BOOST_TEST(id.isValid == expectedID.isValid);
242  if (expectedID.isValid) BOOST_TEST(id == expectedID);
243  } // BOOST_TEST_CONTEXT
244  } // for
245  }
246 
247 } // test_OptionalCryostatIDsequence_empty()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
OptionalIDsequence< geo::CryostatID > OptionalCryostatIDsequence
Member type of optional sequence of geo::CryostatID parameters.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalCryostatIDsequence_normal ( )

Definition at line 183 of file geo_types_fhicl_test.cc.

183  {
184 
185  using ID_t = geo::CryostatID;
186  struct Config
187  { geo::fhicl::OptionalCryostatIDsequence Cryos { fhicl::Name("Cryos") }; };
188 
189  std::string const configStr { "Cryos: [ { C:0 }, { C:2 } ]" };
190  std::optional<std::vector<ID_t>> const expectedIDs
191  (std::in_place, { ID_t{ 0U }, ID_t{ 2U } });
192 
193  auto validatedConfig = validateConfig<Config>(configStr)();
194 
195  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Cryos);
196  static_assert
197  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
198 
199  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
200  if (expectedIDs.has_value()) {
201  BOOST_TEST(ids->size() == expectedIDs->size());
202  auto const n = std::min(ids->size(), expectedIDs->size());
203  for (std::size_t i = 0; i < n; ++i) {
204  auto const& id = ids.value()[i];
205  ID_t const& expectedID = expectedIDs.value()[i];
206 
207  BOOST_TEST_CONTEXT("Item [" << i << "]") {
208  BOOST_TEST(id.isValid == expectedID.isValid);
209  if (expectedID.isValid) BOOST_TEST(id == expectedID);
210  } // BOOST_TEST_CONTEXT
211  } // for
212  }
213 
214 } // test_OptionalCryostatIDsequence_normal()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
OptionalIDsequence< geo::CryostatID > OptionalCryostatIDsequence
Member type of optional sequence of geo::CryostatID parameters.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalCryostatIDsequence_omitted ( )

Definition at line 250 of file geo_types_fhicl_test.cc.

250  {
251 
252  using ID_t = geo::CryostatID;
253  struct Config
254  { geo::fhicl::OptionalCryostatIDsequence Cryos { fhicl::Name("Cryos") }; };
255 
256  std::string const configStr { "" };
257  std::optional<std::vector<ID_t>> const expectedIDs(std::nullopt);
258 
259  auto validatedConfig = validateConfig<Config>(configStr)();
260 
261  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Cryos);
262  static_assert
263  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
264 
265  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
266  if (expectedIDs.has_value()) {
267  BOOST_TEST(ids->size() == expectedIDs->size());
268  auto const n = std::min(ids->size(), expectedIDs->size());
269  for (std::size_t i = 0; i < n; ++i) {
270  auto const& id = ids.value()[i];
271  ID_t const& expectedID = expectedIDs.value()[i];
272 
273  BOOST_TEST_CONTEXT("Item [" << i << "]") {
274  BOOST_TEST(id.isValid == expectedID.isValid);
275  if (expectedID.isValid) BOOST_TEST(id == expectedID);
276  } // BOOST_TEST_CONTEXT
277  } // for
278  }
279 
280 } // test_OptionalCryostatIDsequence_omitted()
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
OptionalIDsequence< geo::CryostatID > OptionalCryostatIDsequence
Member type of optional sequence of geo::CryostatID parameters.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalOpDetID_omitted ( )

Definition at line 348 of file geo_types_fhicl_test.cc.

348  {
349 
350  using ID_t = geo::OpDetID;
351  struct Config { geo::fhicl::OptionalOpDetID OpDet { fhicl::Name("OpDet") }; };
352 
353  std::string const configStr { "" };
354 
355  std::optional<ID_t> const expectedID { std::nullopt };
356 
357  auto validatedConfig = validateConfig<Config>(configStr)();
358 
359  std::optional<ID_t> const id
360  = geo::fhicl::readOptionalID(validatedConfig.OpDet);
361  BOOST_TEST(id.has_value() == expectedID.has_value());
362  if (expectedID.has_value()) {
363  BOOST_TEST(id->isValid == expectedID->isValid);
364  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
365  }
366 
367 } // test_OptionalOpDetID_omitted()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
OptionalID< geo::OpDetID > OptionalOpDetID
Member type of optional validated geo::OpDetID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalOpDetID_present ( )

Definition at line 328 of file geo_types_fhicl_test.cc.

328  {
329 
330  using ID_t = geo::OpDetID;
331  struct Config { geo::fhicl::OptionalOpDetID OpDet { fhicl::Name("OpDet") }; };
332 
333  std::string const configStr { "OpDet: { C:1 O:2 }" };
334  std::optional<ID_t> const expectedID { std::in_place, 1U, 2U };
335 
336  auto validatedConfig = validateConfig<Config>(configStr)();
337 
338  std::optional<ID_t> const id = readOptionalID(validatedConfig.OpDet);
339  BOOST_TEST(id.has_value() == expectedID.has_value());
340  if (expectedID.has_value()) {
341  BOOST_TEST(id->isValid == expectedID->isValid);
342  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
343  }
344 
345 } // test_OptionalOpDetID_present()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
OptionalID< geo::OpDetID > OptionalOpDetID
Member type of optional validated geo::OpDetID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalOpDetIDsequence_empty ( )

Definition at line 453 of file geo_types_fhicl_test.cc.

453  {
454 
455  using ID_t = geo::OpDetID;
456  struct Config
457  { geo::fhicl::OptionalOpDetIDsequence OpDets { fhicl::Name("OpDets") }; };
458 
459  std::string const configStr { "OpDets: []" };
460  std::optional<std::vector<ID_t>> const expectedIDs(std::in_place);
461 
462  auto validatedConfig = validateConfig<Config>(configStr)();
463 
464  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.OpDets);
465  static_assert
466  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
467 
468  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
469  if (expectedIDs.has_value()) {
470  BOOST_TEST(ids->size() == expectedIDs->size());
471  auto const n = std::min(ids->size(), expectedIDs->size());
472  for (std::size_t i = 0; i < n; ++i) {
473  auto const& id = ids.value()[i];
474  ID_t const& expectedID = expectedIDs.value()[i];
475 
476  BOOST_TEST_CONTEXT("Item [" << i << "]") {
477  BOOST_TEST(id.isValid == expectedID.isValid);
478  if (expectedID.isValid) BOOST_TEST(id == expectedID);
479  } // BOOST_TEST_CONTEXT
480  } // for
481  }
482 
483 } // test_OptionalOpDetIDsequence_empty()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
OptionalIDsequence< geo::OpDetID > OptionalOpDetIDsequence
Member type of optional sequence of geo::OpDetID parameters.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalOpDetIDsequence_normal ( )

Definition at line 419 of file geo_types_fhicl_test.cc.

419  {
420 
421  using ID_t = geo::OpDetID;
422  struct Config
423  { geo::fhicl::OptionalOpDetIDsequence OpDets { fhicl::Name("OpDets") }; };
424 
425  std::string const configStr { "OpDets: [ { C:0 O:1 }, { C:2 O:3 } ]" };
426  std::optional<std::vector<ID_t>> const expectedIDs
427  (std::in_place, { ID_t{ 0U, 1U }, ID_t{ 2U, 3U } });
428 
429  auto validatedConfig = validateConfig<Config>(configStr)();
430 
431  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.OpDets);
432  static_assert
433  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
434 
435  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
436  if (expectedIDs.has_value()) {
437  BOOST_TEST(ids->size() == expectedIDs->size());
438  auto const n = std::min(ids->size(), expectedIDs->size());
439  for (std::size_t i = 0; i < n; ++i) {
440  auto const& id = ids.value()[i];
441  ID_t const& expectedID = expectedIDs.value()[i];
442 
443  BOOST_TEST_CONTEXT("Item [" << i << "]") {
444  BOOST_TEST(id.isValid == expectedID.isValid);
445  if (expectedID.isValid) BOOST_TEST(id == expectedID);
446  } // BOOST_TEST_CONTEXT
447  } // for
448  }
449 
450 } // test_OptionalOpDetIDsequence_normal()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
OptionalIDsequence< geo::OpDetID > OptionalOpDetIDsequence
Member type of optional sequence of geo::OpDetID parameters.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalOpDetIDsequence_omitted ( )

Definition at line 486 of file geo_types_fhicl_test.cc.

486  {
487 
488  using ID_t = geo::OpDetID;
489  struct Config
490  { geo::fhicl::OptionalOpDetIDsequence OpDets { fhicl::Name("OpDets") }; };
491 
492  std::string const configStr { "" };
493  std::optional<std::vector<ID_t>> const expectedIDs(std::nullopt);
494 
495  auto validatedConfig = validateConfig<Config>(configStr)();
496 
497  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.OpDets);
498  static_assert
499  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
500 
501  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
502  if (expectedIDs.has_value()) {
503  BOOST_TEST(ids->size() == expectedIDs->size());
504  auto const n = std::min(ids->size(), expectedIDs->size());
505  for (std::size_t i = 0; i < n; ++i) {
506  auto const& id = ids.value()[i];
507  ID_t const& expectedID = expectedIDs.value()[i];
508 
509  BOOST_TEST_CONTEXT("Item [" << i << "]") {
510  BOOST_TEST(id.isValid == expectedID.isValid);
511  if (expectedID.isValid) BOOST_TEST(id == expectedID);
512  } // BOOST_TEST_CONTEXT
513  } // for
514  }
515 
516 } // test_OptionalOpDetIDsequence_omitted()
IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
OptionalIDsequence< geo::OpDetID > OptionalOpDetIDsequence
Member type of optional sequence of geo::OpDetID parameters.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalPlaneID_omitted ( )

Definition at line 818 of file geo_types_fhicl_test.cc.

818  {
819 
820  using ID_t = geo::PlaneID;
821  struct Config { geo::fhicl::OptionalPlaneID Plane { fhicl::Name("Plane") }; };
822 
823  std::string const configStr { "" };
824 
825  std::optional<ID_t> const expectedID { std::nullopt };
826 
827  auto validatedConfig = validateConfig<Config>(configStr)();
828 
829  std::optional<ID_t> const id
830  = geo::fhicl::readOptionalID(validatedConfig.Plane);
831  BOOST_TEST(id.has_value() == expectedID.has_value());
832  if (expectedID.has_value()) {
833  BOOST_TEST(id->isValid == expectedID->isValid);
834  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
835  }
836 
837 } // test_OptionalPlaneID_omitted()
BEGIN_PROLOG true icarus_rawdigitfilter FilterTools FilterPlane1 Plane
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
OptionalID< geo::PlaneID > OptionalPlaneID
Member type of optional validated geo::PlaneID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalPlaneID_present ( )

Definition at line 798 of file geo_types_fhicl_test.cc.

798  {
799 
800  using ID_t = geo::PlaneID;
801  struct Config { geo::fhicl::OptionalPlaneID Plane { fhicl::Name("Plane") }; };
802 
803  std::string const configStr { "Plane: { C:1 T:2 P:1 }" };
804  std::optional<ID_t> const expectedID { std::in_place, 1U, 2U, 1U };
805 
806  auto validatedConfig = validateConfig<Config>(configStr)();
807 
808  std::optional<ID_t> const id = readOptionalID(validatedConfig.Plane);
809  BOOST_TEST(id.has_value() == expectedID.has_value());
810  if (expectedID.has_value()) {
811  BOOST_TEST(id->isValid == expectedID->isValid);
812  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
813  }
814 
815 } // test_OptionalPlaneID_present()
BEGIN_PROLOG true icarus_rawdigitfilter FilterTools FilterPlane1 Plane
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
OptionalID< geo::PlaneID > OptionalPlaneID
Member type of optional validated geo::PlaneID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalPlaneIDsequence_empty ( )

Definition at line 926 of file geo_types_fhicl_test.cc.

926  {
927 
928  using ID_t = geo::PlaneID;
929  struct Config
930  { geo::fhicl::OptionalPlaneIDsequence Planes { fhicl::Name("Planes") }; };
931 
932  std::string const configStr { "Planes: []" };
933  std::optional<std::vector<ID_t>> const expectedIDs(std::in_place);
934 
935  auto validatedConfig = validateConfig<Config>(configStr)();
936 
937  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Planes);
938  static_assert
939  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
940 
941  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
942  if (expectedIDs.has_value()) {
943  BOOST_TEST(ids->size() == expectedIDs->size());
944  auto const n = std::min(ids->size(), expectedIDs->size());
945  for (std::size_t i = 0; i < n; ++i) {
946  auto const& id = ids.value()[i];
947  ID_t const& expectedID = expectedIDs.value()[i];
948 
949  BOOST_TEST_CONTEXT("Item [" << i << "]") {
950  BOOST_TEST(id.isValid == expectedID.isValid);
951  if (expectedID.isValid) BOOST_TEST(id == expectedID);
952  } // BOOST_TEST_CONTEXT
953  } // for
954  }
955 
956 } // test_OptionalPlaneIDsequence_empty()
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
OptionalIDsequence< geo::PlaneID > OptionalPlaneIDsequence
Member type of optional sequence of geo::PlaneID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalPlaneIDsequence_normal ( )

Definition at line 891 of file geo_types_fhicl_test.cc.

891  {
892 
893  using ID_t = geo::PlaneID;
894  struct Config
895  { geo::fhicl::OptionalPlaneIDsequence Planes { fhicl::Name("Planes") }; };
896 
897  std::string const configStr
898  { "Planes: [ { C:0 T:1 P:1 }, { C:2 T:3 P:0 } ]" };
899  std::optional<std::vector<ID_t>> const expectedIDs
900  (std::in_place, { ID_t{ 0U, 1U, 1U }, ID_t{ 2U, 3U, 0U } });
901 
902  auto validatedConfig = validateConfig<Config>(configStr)();
903 
904  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Planes);
905  static_assert
906  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
907 
908  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
909  if (expectedIDs.has_value()) {
910  BOOST_TEST(ids->size() == expectedIDs->size());
911  auto const n = std::min(ids->size(), expectedIDs->size());
912  for (std::size_t i = 0; i < n; ++i) {
913  auto const& id = ids.value()[i];
914  ID_t const& expectedID = expectedIDs.value()[i];
915 
916  BOOST_TEST_CONTEXT("Item [" << i << "]") {
917  BOOST_TEST(id.isValid == expectedID.isValid);
918  if (expectedID.isValid) BOOST_TEST(id == expectedID);
919  } // BOOST_TEST_CONTEXT
920  } // for
921  }
922 
923 } // test_OptionalPlaneIDsequence_normal()
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
OptionalIDsequence< geo::PlaneID > OptionalPlaneIDsequence
Member type of optional sequence of geo::PlaneID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalPlaneIDsequence_omitted ( )

Definition at line 959 of file geo_types_fhicl_test.cc.

959  {
960 
961  using ID_t = geo::PlaneID;
962  struct Config
963  { geo::fhicl::OptionalPlaneIDsequence Planes { fhicl::Name("Planes") }; };
964 
965  std::string const configStr { "" };
966  std::optional<std::vector<ID_t>> const expectedIDs(std::nullopt);
967 
968  auto validatedConfig = validateConfig<Config>(configStr)();
969 
970  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Planes);
971  static_assert
972  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
973 
974  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
975  if (expectedIDs.has_value()) {
976  BOOST_TEST(ids->size() == expectedIDs->size());
977  auto const n = std::min(ids->size(), expectedIDs->size());
978  for (std::size_t i = 0; i < n; ++i) {
979  auto const& id = ids.value()[i];
980  ID_t const& expectedID = expectedIDs.value()[i];
981 
982  BOOST_TEST_CONTEXT("Item [" << i << "]") {
983  BOOST_TEST(id.isValid == expectedID.isValid);
984  if (expectedID.isValid) BOOST_TEST(id == expectedID);
985  } // BOOST_TEST_CONTEXT
986  } // for
987  }
988 
989 } // test_OptionalPlaneIDsequence_omitted()
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
OptionalIDsequence< geo::PlaneID > OptionalPlaneIDsequence
Member type of optional sequence of geo::PlaneID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_OptionalTPCID_omitted ( )

Definition at line 583 of file geo_types_fhicl_test.cc.

583  {
584 
585  using ID_t = geo::TPCID;
586  struct Config { geo::fhicl::OptionalTPCID TPC { fhicl::Name("TPC") }; };
587 
588  std::string const configStr { "" };
589 
590  std::optional<ID_t> const expectedID { std::nullopt };
591 
592  auto validatedConfig = validateConfig<Config>(configStr)();
593 
594  std::optional<ID_t> const id
595  = geo::fhicl::readOptionalID(validatedConfig.TPC);
596  BOOST_TEST(id.has_value() == expectedID.has_value());
597  if (expectedID.has_value()) {
598  BOOST_TEST(id->isValid == expectedID->isValid);
599  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
600  }
601 
602 } // test_OptionalTPCID_omitted()
BEGIN_PROLOG TPC
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
OptionalID< geo::TPCID > OptionalTPCID
Member type of optional validated geo::TPCID parameter.
void test_OptionalTPCID_present ( )

Definition at line 563 of file geo_types_fhicl_test.cc.

563  {
564 
565  using ID_t = geo::TPCID;
566  struct Config { geo::fhicl::OptionalTPCID TPC { fhicl::Name("TPC") }; };
567 
568  std::string const configStr { "TPC: { C:1 T:2 }" };
569  std::optional<ID_t> const expectedID { std::in_place, 1U, 2U };
570 
571  auto validatedConfig = validateConfig<Config>(configStr)();
572 
573  std::optional<ID_t> const id = readOptionalID(validatedConfig.TPC);
574  BOOST_TEST(id.has_value() == expectedID.has_value());
575  if (expectedID.has_value()) {
576  BOOST_TEST(id->isValid == expectedID->isValid);
577  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
578  }
579 
580 } // test_OptionalTPCID_present()
BEGIN_PROLOG TPC
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
OptionalID< geo::TPCID > OptionalTPCID
Member type of optional validated geo::TPCID parameter.
void test_OptionalTPCIDsequence_empty ( )

Definition at line 688 of file geo_types_fhicl_test.cc.

688  {
689 
690  using ID_t = geo::TPCID;
691  struct Config
693 
694  std::string const configStr { "TPCs: []" };
695  std::optional<std::vector<ID_t>> const expectedIDs(std::in_place);
696 
697  auto validatedConfig = validateConfig<Config>(configStr)();
698 
699  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.TPCs);
700  static_assert
701  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
702 
703  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
704  if (expectedIDs.has_value()) {
705  BOOST_TEST(ids->size() == expectedIDs->size());
706  auto const n = std::min(ids->size(), expectedIDs->size());
707  for (std::size_t i = 0; i < n; ++i) {
708  auto const& id = ids.value()[i];
709  ID_t const& expectedID = expectedIDs.value()[i];
710 
711  BOOST_TEST_CONTEXT("Item [" << i << "]") {
712  BOOST_TEST(id.isValid == expectedID.isValid);
713  if (expectedID.isValid) BOOST_TEST(id == expectedID);
714  } // BOOST_TEST_CONTEXT
715  } // for
716  }
717 
718 } // test_OptionalTPCIDsequence_empty()
BEGIN_PROLOG opflashtpc1 TPCs
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
OptionalIDsequence< geo::TPCID > OptionalTPCIDsequence
Member type of optional sequence of geo::TPCID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
void test_OptionalTPCIDsequence_normal ( )

Definition at line 654 of file geo_types_fhicl_test.cc.

654  {
655 
656  using ID_t = geo::TPCID;
657  struct Config
659 
660  std::string const configStr { "TPCs: [ { C:0 T:1 }, { C:2 T:3 } ]" };
661  std::optional<std::vector<ID_t>> const expectedIDs
662  (std::in_place, { ID_t{ 0U, 1U }, ID_t{ 2U, 3U } });
663 
664  auto validatedConfig = validateConfig<Config>(configStr)();
665 
666  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.TPCs);
667  static_assert
668  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
669 
670  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
671  if (expectedIDs.has_value()) {
672  BOOST_TEST(ids->size() == expectedIDs->size());
673  auto const n = std::min(ids->size(), expectedIDs->size());
674  for (std::size_t i = 0; i < n; ++i) {
675  auto const& id = ids.value()[i];
676  ID_t const& expectedID = expectedIDs.value()[i];
677 
678  BOOST_TEST_CONTEXT("Item [" << i << "]") {
679  BOOST_TEST(id.isValid == expectedID.isValid);
680  if (expectedID.isValid) BOOST_TEST(id == expectedID);
681  } // BOOST_TEST_CONTEXT
682  } // for
683  }
684 
685 } // test_OptionalTPCIDsequence_normal()
BEGIN_PROLOG opflashtpc1 TPCs
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
OptionalIDsequence< geo::TPCID > OptionalTPCIDsequence
Member type of optional sequence of geo::TPCID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
void test_OptionalTPCIDsequence_omitted ( )

Definition at line 721 of file geo_types_fhicl_test.cc.

721  {
722 
723  using ID_t = geo::TPCID;
724  struct Config
726 
727  std::string const configStr { "" };
728  std::optional<std::vector<ID_t>> const expectedIDs(std::nullopt);
729 
730  auto validatedConfig = validateConfig<Config>(configStr)();
731 
732  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.TPCs);
733  static_assert
734  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
735 
736  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
737  if (expectedIDs.has_value()) {
738  BOOST_TEST(ids->size() == expectedIDs->size());
739  auto const n = std::min(ids->size(), expectedIDs->size());
740  for (std::size_t i = 0; i < n; ++i) {
741  auto const& id = ids.value()[i];
742  ID_t const& expectedID = expectedIDs.value()[i];
743 
744  BOOST_TEST_CONTEXT("Item [" << i << "]") {
745  BOOST_TEST(id.isValid == expectedID.isValid);
746  if (expectedID.isValid) BOOST_TEST(id == expectedID);
747  } // BOOST_TEST_CONTEXT
748  } // for
749  }
750 
751 } // test_OptionalTPCIDsequence_omitted()
BEGIN_PROLOG opflashtpc1 TPCs
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
OptionalIDsequence< geo::TPCID > OptionalTPCIDsequence
Member type of optional sequence of geo::TPCID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
void test_OptionalWireID_omitted ( )

Definition at line 1056 of file geo_types_fhicl_test.cc.

1056  {
1057 
1058  using ID_t = geo::WireID;
1059  struct Config { geo::fhicl::OptionalWireID Wire { fhicl::Name("Wire") }; };
1060 
1061  std::string const configStr { "" };
1062 
1063  std::optional<ID_t> const expectedID { std::nullopt };
1064 
1065  auto validatedConfig = validateConfig<Config>(configStr)();
1066 
1067  std::optional<ID_t> const id
1068  = geo::fhicl::readOptionalID(validatedConfig.Wire);
1069  BOOST_TEST(id.has_value() == expectedID.has_value());
1070  if (expectedID.has_value()) {
1071  BOOST_TEST(id->isValid == expectedID->isValid);
1072  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
1073  }
1074 
1075 } // test_OptionalWireID_omitted()
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
OptionalID< geo::WireID > OptionalWireID
Member type of optional validated geo::WireID parameter.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalWireID_present ( )

Definition at line 1036 of file geo_types_fhicl_test.cc.

1036  {
1037 
1038  using ID_t = geo::WireID;
1039  struct Config { geo::fhicl::OptionalWireID Wire { fhicl::Name("Wire") }; };
1040 
1041  std::string const configStr { "Wire: { C:1 T:2 P:1 W:9 }" };
1042  std::optional<ID_t> const expectedID { std::in_place, 1U, 2U, 1U, 9U };
1043 
1044  auto validatedConfig = validateConfig<Config>(configStr)();
1045 
1046  std::optional<ID_t> const id = readOptionalID(validatedConfig.Wire);
1047  BOOST_TEST(id.has_value() == expectedID.has_value());
1048  if (expectedID.has_value()) {
1049  BOOST_TEST(id->isValid == expectedID->isValid);
1050  if (expectedID->isValid) BOOST_TEST(id.value() == expectedID.value());
1051  }
1052 
1053 } // test_OptionalWireID_present()
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
BEGIN_PROLOG vertical distance to the surface Name
OptionalID< geo::WireID > OptionalWireID
Member type of optional validated geo::WireID parameter.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
temporary value
void test_OptionalWireIDsequence_empty ( )

Definition at line 1164 of file geo_types_fhicl_test.cc.

1164  {
1165 
1166  using ID_t = geo::WireID;
1167  struct Config
1168  { geo::fhicl::OptionalWireIDsequence Wires { fhicl::Name("Wires") }; };
1169 
1170  std::string const configStr { "Wires: []" };
1171  std::optional<std::vector<ID_t>> const expectedIDs(std::in_place);
1172 
1173  auto validatedConfig = validateConfig<Config>(configStr)();
1174 
1175  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Wires);
1176  static_assert
1177  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
1178 
1179  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
1180  if (expectedIDs.has_value()) {
1181  BOOST_TEST(ids->size() == expectedIDs->size());
1182  auto const n = std::min(ids->size(), expectedIDs->size());
1183  for (std::size_t i = 0; i < n; ++i) {
1184  auto const& id = ids.value()[i];
1185  ID_t const& expectedID = expectedIDs.value()[i];
1186 
1187  BOOST_TEST_CONTEXT("Item [" << i << "]") {
1188  BOOST_TEST(id.isValid == expectedID.isValid);
1189  if (expectedID.isValid) BOOST_TEST(id == expectedID);
1190  } // BOOST_TEST_CONTEXT
1191  } // for
1192  }
1193 
1194 } // test_OptionalWireIDsequence_empty()
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
OptionalIDsequence< geo::WireID > OptionalWireIDsequence
Member type of optional sequence of geo::WireID parameters.
void test_OptionalWireIDsequence_normal ( )

Definition at line 1129 of file geo_types_fhicl_test.cc.

1129  {
1130 
1131  using ID_t = geo::WireID;
1132  struct Config
1133  { geo::fhicl::OptionalWireIDsequence Wires { fhicl::Name("Wires") }; };
1134 
1135  std::string const configStr
1136  { "Wires: [ { C:0 T:1 P:1 W:9 }, { C:2 T:3 P:0 W:7 } ]" };
1137  std::optional<std::vector<ID_t>> const expectedIDs
1138  (std::in_place, { ID_t{ 0U, 1U, 1U, 9U }, ID_t{ 2U, 3U, 0U, 7U } });
1139 
1140  auto validatedConfig = validateConfig<Config>(configStr)();
1141 
1142  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Wires);
1143  static_assert
1144  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
1145 
1146  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
1147  if (expectedIDs.has_value()) {
1148  BOOST_TEST(ids->size() == expectedIDs->size());
1149  auto const n = std::min(ids->size(), expectedIDs->size());
1150  for (std::size_t i = 0; i < n; ++i) {
1151  auto const& id = ids.value()[i];
1152  ID_t const& expectedID = expectedIDs.value()[i];
1153 
1154  BOOST_TEST_CONTEXT("Item [" << i << "]") {
1155  BOOST_TEST(id.isValid == expectedID.isValid);
1156  if (expectedID.isValid) BOOST_TEST(id == expectedID);
1157  } // BOOST_TEST_CONTEXT
1158  } // for
1159  }
1160 
1161 } // test_OptionalWireIDsequence_normal()
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
OptionalIDsequence< geo::WireID > OptionalWireIDsequence
Member type of optional sequence of geo::WireID parameters.
void test_OptionalWireIDsequence_omitted ( )

Definition at line 1197 of file geo_types_fhicl_test.cc.

1197  {
1198 
1199  using ID_t = geo::WireID;
1200  struct Config
1201  { geo::fhicl::OptionalWireIDsequence Wires { fhicl::Name("Wires") }; };
1202 
1203  std::string const configStr { "" };
1204  std::optional<std::vector<ID_t>> const expectedIDs(std::nullopt);
1205 
1206  auto validatedConfig = validateConfig<Config>(configStr)();
1207 
1208  auto ids = geo::fhicl::readOptionalIDsequence(validatedConfig.Wires);
1209  static_assert
1210  (std::is_same_v<decltype(ids), std::optional<std::vector<ID_t>>>);
1211 
1212  BOOST_TEST(ids.has_value() == expectedIDs.has_value());
1213  if (expectedIDs.has_value()) {
1214  BOOST_TEST(ids->size() == expectedIDs->size());
1215  auto const n = std::min(ids->size(), expectedIDs->size());
1216  for (std::size_t i = 0; i < n; ++i) {
1217  auto const& id = ids.value()[i];
1218  ID_t const& expectedID = expectedIDs.value()[i];
1219 
1220  BOOST_TEST_CONTEXT("Item [" << i << "]") {
1221  BOOST_TEST(id.isValid == expectedID.isValid);
1222  if (expectedID.isValid) BOOST_TEST(id == expectedID);
1223  } // BOOST_TEST_CONTEXT
1224  } // for
1225  }
1226 
1227 } // test_OptionalWireIDsequence_omitted()
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
OptionalIDsequence< geo::WireID > OptionalWireIDsequence
Member type of optional sequence of geo::WireID parameters.
void test_PlaneID_invalid ( )

Definition at line 778 of file geo_types_fhicl_test.cc.

778  {
779 
780  using ID_t = geo::PlaneID;
781  struct Config { geo::fhicl::PlaneID Plane { fhicl::Name("Plane") }; };
782 
783  std::string const configStr { "Plane: { isValid:false }" };
784  ID_t const expectedID {};
785 
786  auto validatedConfig = validateConfig<Config>(configStr)();
787 
788  auto const id = geo::fhicl::readID(validatedConfig.Plane);
789  static_assert(std::is_same_v<decltype(id), ID_t const>);
790  BOOST_TEST(id.isValid == expectedID.isValid);
791  if (expectedID.isValid) {
792  BOOST_TEST(validatedConfig.Plane().ID() == expectedID);
793  BOOST_TEST(id == expectedID);
794  }
795 } // test_PlaneID_invalid()
BEGIN_PROLOG true icarus_rawdigitfilter FilterTools FilterPlane1 Plane
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_PlaneID_normal ( )

Definition at line 758 of file geo_types_fhicl_test.cc.

758  {
759 
760  using ID_t = geo::PlaneID;
761  struct Config { geo::fhicl::PlaneID Plane { fhicl::Name("Plane") }; };
762 
763  std::string const configStr { "Plane: { C:2 T:3 P:1 }" };
764  ID_t const expectedID { 2U, 3U, 1U };
765 
766  auto validatedConfig = validateConfig<Config>(configStr)();
767 
768  auto const id = geo::fhicl::readID(validatedConfig.Plane);
769  static_assert(std::is_same_v<decltype(id), ID_t const>);
770  BOOST_TEST(id.isValid == expectedID.isValid);
771  if (expectedID.isValid) {
772  BOOST_TEST(validatedConfig.Plane().ID() == expectedID);
773  BOOST_TEST(id == expectedID);
774  }
775 } // test_PlaneID_normal()
BEGIN_PROLOG true icarus_rawdigitfilter FilterTools FilterPlane1 Plane
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_PlaneIDsequence_empty ( )

Definition at line 873 of file geo_types_fhicl_test.cc.

873  {
874 
875  using ID_t = geo::PlaneID;
876  struct Config
877  { geo::fhicl::PlaneIDsequence Planes { fhicl::Name("Planes") }; };
878 
879  std::string const configStr { "Planes: []" };
880 
881  auto validatedConfig = validateConfig<Config>(configStr)();
882 
883  auto ids = geo::fhicl::readIDsequence(validatedConfig.Planes);
884  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
885 
886  BOOST_TEST(ids.size() == 0U);
887 
888 } // test_PlaneIDsequence_empty()
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
IDsequence< geo::PlaneID > PlaneIDsequence
Member type of sequence of geo::PlaneID parameters.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_PlaneIDsequence_normal ( )

Definition at line 840 of file geo_types_fhicl_test.cc.

840  {
841 
842  using ID_t = geo::PlaneID;
843  struct Config
844  { geo::fhicl::PlaneIDsequence Planes { fhicl::Name("Planes") }; };
845 
846  std::string const configStr
847  { "Planes: [ { C:0 T:1 P:1 }, { C:2 T:3 P:0 } ]" };
848  std::array<ID_t, 2U> const expectedIDs
849  // BUG the double brace syntax is required to work around clang bug 21629
850 // { ID_t{ 0U, 1U, 1U }, ID_t{ 2U, 3U, 0U } };
851  {{ ID_t{ 0U, 1U, 1U }, ID_t{ 2U, 3U, 0U } }};
852 
853  auto validatedConfig = validateConfig<Config>(configStr)();
854 
855  auto ids = geo::fhicl::readIDsequence(validatedConfig.Planes);
856  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
857 
858  BOOST_TEST(ids.size() == expectedIDs.size());
859  auto const n = std::min(ids.size(), expectedIDs.size());
860  for (std::size_t i = 0; i < n; ++i) {
861  auto const& id = ids[i];
862  ID_t const& expectedID = expectedIDs[i];
863 
864  BOOST_TEST_CONTEXT("Item [" << i << "]") {
865  BOOST_TEST(id.isValid == expectedID.isValid);
866  if (expectedID.isValid) BOOST_TEST(id == expectedID);
867  } // BOOST_TEST_CONTEXT
868  } // for
869 
870 } // test_PlaneIDsequence_normal()
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
IDsequence< geo::PlaneID > PlaneIDsequence
Member type of sequence of geo::PlaneID parameters.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_TPCID_invalid ( )

Definition at line 543 of file geo_types_fhicl_test.cc.

543  {
544 
545  using ID_t = geo::TPCID;
546  struct Config { geo::fhicl::TPCID TPC { fhicl::Name("TPC") }; };
547 
548  std::string const configStr { "TPC: { isValid:false }" };
549  ID_t const expectedID {};
550 
551  auto validatedConfig = validateConfig<Config>(configStr)();
552 
553  auto const id = geo::fhicl::readID(validatedConfig.TPC);
554  static_assert(std::is_same_v<decltype(id), ID_t const>);
555  BOOST_TEST(id.isValid == expectedID.isValid);
556  if (expectedID.isValid) {
557  BOOST_TEST(validatedConfig.TPC().ID() == expectedID);
558  BOOST_TEST(id == expectedID);
559  }
560 } // test_TPCID_invalid()
BEGIN_PROLOG TPC
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
void test_TPCID_normal ( )

Definition at line 523 of file geo_types_fhicl_test.cc.

523  {
524 
525  using ID_t = geo::TPCID;
526  struct Config { geo::fhicl::TPCID TPC { fhicl::Name("TPC") }; };
527 
528  std::string const configStr { "TPC: { C:2 T:3 }" };
529  ID_t const expectedID { 2U, 3U };
530 
531  auto validatedConfig = validateConfig<Config>(configStr)();
532 
533  auto const id = geo::fhicl::readID(validatedConfig.TPC);
534  static_assert(std::is_same_v<decltype(id), ID_t const>);
535  BOOST_TEST(id.isValid == expectedID.isValid);
536  if (expectedID.isValid) {
537  BOOST_TEST(validatedConfig.TPC().ID() == expectedID);
538  BOOST_TEST(id == expectedID);
539  }
540 } // test_TPCID_normal()
BEGIN_PROLOG TPC
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
void test_TPCIDsequence_empty ( )

Definition at line 636 of file geo_types_fhicl_test.cc.

636  {
637 
638  using ID_t = geo::TPCID;
639  struct Config
640  { geo::fhicl::TPCIDsequence TPCs { fhicl::Name("TPCs") }; };
641 
642  std::string const configStr { "TPCs: []" };
643 
644  auto validatedConfig = validateConfig<Config>(configStr)();
645 
646  auto ids = geo::fhicl::readIDsequence(validatedConfig.TPCs);
647  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
648 
649  BOOST_TEST(ids.size() == 0U);
650 
651 } // test_TPCIDsequence_empty()
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
BEGIN_PROLOG opflashtpc1 TPCs
IDsequence< geo::TPCID > TPCIDsequence
Member type of sequence of geo::TPCID parameters.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
void test_TPCIDsequence_normal ( )

Definition at line 605 of file geo_types_fhicl_test.cc.

605  {
606 
607  using ID_t = geo::TPCID;
608  struct Config
609  { geo::fhicl::TPCIDsequence TPCs { fhicl::Name("TPCs") }; };
610 
611  std::string const configStr { "TPCs: [ { C:0 T:1 }, { C:2 T:3 } ]" };
612  // BUG the double brace syntax is required to work around clang bug 21629
613 // std::array<ID_t, 2U> const expectedIDs { ID_t{ 0U, 1U }, ID_t{ 2U, 3U } };
614  std::array<ID_t, 2U> const expectedIDs {{ ID_t{ 0U, 1U }, ID_t{ 2U, 3U } }};
615 
616  auto validatedConfig = validateConfig<Config>(configStr)();
617 
618  auto ids = geo::fhicl::readIDsequence(validatedConfig.TPCs);
619  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
620 
621  BOOST_TEST(ids.size() == expectedIDs.size());
622  auto const n = std::min(ids.size(), expectedIDs.size());
623  for (std::size_t i = 0; i < n; ++i) {
624  auto const& id = ids[i];
625  ID_t const& expectedID = expectedIDs[i];
626 
627  BOOST_TEST_CONTEXT("Item [" << i << "]") {
628  BOOST_TEST(id.isValid == expectedID.isValid);
629  if (expectedID.isValid) BOOST_TEST(id == expectedID);
630  } // BOOST_TEST_CONTEXT
631  } // for
632 
633 } // test_TPCIDsequence_normal()
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
BEGIN_PROLOG opflashtpc1 TPCs
IDsequence< geo::TPCID > TPCIDsequence
Member type of sequence of geo::TPCID parameters.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
void test_WireID_invalid ( )

Definition at line 1016 of file geo_types_fhicl_test.cc.

1016  {
1017 
1018  using ID_t = geo::WireID;
1019  struct Config { geo::fhicl::WireID Wire { fhicl::Name("Wire") }; };
1020 
1021  std::string const configStr { "Wire: { isValid:false }" };
1022  ID_t const expectedID {};
1023 
1024  auto validatedConfig = validateConfig<Config>(configStr)();
1025 
1026  auto const id = geo::fhicl::readID(validatedConfig.Wire);
1027  static_assert(std::is_same_v<decltype(id), ID_t const>);
1028  BOOST_TEST(id.isValid == expectedID.isValid);
1029  if (expectedID.isValid) {
1030  BOOST_TEST(validatedConfig.Wire().ID() == expectedID);
1031  BOOST_TEST(id == expectedID);
1032  }
1033 } // test_WireID_invalid()
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_WireID_normal ( )

Definition at line 996 of file geo_types_fhicl_test.cc.

996  {
997 
998  using ID_t = geo::WireID;
999  struct Config { geo::fhicl::WireID Wire { fhicl::Name("Wire") }; };
1000 
1001  std::string const configStr { "Wire: { C:2 T:3 P:1 W:9 }" };
1002  ID_t const expectedID { 2U, 3U, 1U, 9U };
1003 
1004  auto validatedConfig = validateConfig<Config>(configStr)();
1005 
1006  auto const id = geo::fhicl::readID(validatedConfig.Wire);
1007  static_assert(std::is_same_v<decltype(id), ID_t const>);
1008  BOOST_TEST(id.isValid == expectedID.isValid);
1009  if (expectedID.isValid) {
1010  BOOST_TEST(validatedConfig.Wire().ID() == expectedID);
1011  BOOST_TEST(id == expectedID);
1012  }
1013 } // test_WireID_normal()
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
BEGIN_PROLOG vertical distance to the surface Name
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_WireIDsequence_empty ( )

Definition at line 1111 of file geo_types_fhicl_test.cc.

1111  {
1112 
1113  using ID_t = geo::WireID;
1114  struct Config
1115  { geo::fhicl::WireIDsequence Wires { fhicl::Name("Wires") }; };
1116 
1117  std::string const configStr { "Wires: []" };
1118 
1119  auto validatedConfig = validateConfig<Config>(configStr)();
1120 
1121  auto ids = geo::fhicl::readIDsequence(validatedConfig.Wires);
1122  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
1123 
1124  BOOST_TEST(ids.size() == 0U);
1125 
1126 } // test_WireIDsequence_empty()
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
BEGIN_PROLOG vertical distance to the surface Name
IDsequence< geo::WireID > WireIDsequence
Member type of sequence of geo::WireID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_WireIDsequence_normal ( )

Definition at line 1078 of file geo_types_fhicl_test.cc.

1078  {
1079 
1080  using ID_t = geo::WireID;
1081  struct Config
1082  { geo::fhicl::WireIDsequence Wires { fhicl::Name("Wires") }; };
1083 
1084  std::string const configStr
1085  { "Wires: [ { C:0 T:1 P:1 W:9 }, { C:2 T:3 P:0 W:7 } ]" };
1086  std::array<ID_t, 2U> const expectedIDs
1087  // BUG the double brace syntax is required to work around clang bug 21629
1088 // { ID_t{ 0U, 1U, 1U, 9U }, ID_t{ 2U, 3U, 0U, 7U } };
1089  {{ ID_t{ 0U, 1U, 1U, 9U }, ID_t{ 2U, 3U, 0U, 7U } }};
1090 
1091  auto validatedConfig = validateConfig<Config>(configStr)();
1092 
1093  auto ids = geo::fhicl::readIDsequence(validatedConfig.Wires);
1094  static_assert(std::is_same_v<decltype(ids), std::vector<ID_t>>);
1095 
1096  BOOST_TEST(ids.size() == expectedIDs.size());
1097  auto const n = std::min(ids.size(), expectedIDs.size());
1098  for (std::size_t i = 0; i < n; ++i) {
1099  auto const& id = ids[i];
1100  ID_t const& expectedID = expectedIDs[i];
1101 
1102  BOOST_TEST_CONTEXT("Item [" << i << "]") {
1103  BOOST_TEST(id.isValid == expectedID.isValid);
1104  if (expectedID.isValid) BOOST_TEST(id == expectedID);
1105  } // BOOST_TEST_CONTEXT
1106  } // for
1107 
1108 } // test_WireIDsequence_normal()
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
BEGIN_PROLOG vertical distance to the surface Name
IDsequence< geo::WireID > WireIDsequence
Member type of sequence of geo::WireID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
void test_WireUnifiedInterface ( )

Definition at line 1230 of file geo_types_fhicl_test.cc.

1230  {
1231 
1232  using ID_t = geo::WireID;
1233  struct Config {
1234 
1235  geo::fhicl::WireID Wire { fhicl::Name("Wire") };
1236 
1237  geo::fhicl::OptionalWireID MaybeWire { fhicl::Name("MaybeWire") };
1238 
1239  geo::fhicl::OptionalWireID NoWire { fhicl::Name("NoWire") };
1240 
1241  geo::fhicl::WireIDsequence Wires { fhicl::Name("Wires") };
1242 
1243  geo::fhicl::OptionalWireIDsequence MaybeWires { fhicl::Name("MaybeWires") };
1244 
1245  geo::fhicl::OptionalWireIDsequence NoWires { fhicl::Name("NoWires") };
1246 
1247  }; // struct Config
1248 
1249  std::string const configStr {
1250  "Wire: { C:1 T:5 P:2 W:9 }"
1251  "\nMaybeWire: { C:1 T:5 P:2 W:8 }"
1252  "\n# NoWire: @nil"
1253  "\n"
1254  "\nWires: [ { C:1 T:5 P:2 W:7 }, { C:1 T:5 P:2 W:6 } ] "
1255  "\nMaybeWires: [ { C:1 T:5 P:2 W:5 } ] "
1256  "\n# NoWires: @nil"
1257  "\n"
1258  };
1259 
1260  auto const& config = validateConfig<Config>(configStr);
1261 
1262  ID_t const expected1 { 1U, 5U, 2U, 9U };
1263  ID_t const expected2 { 1U, 5U, 2U, 8U };
1264  std::array<ID_t, 2U> const expected4
1265  // BUG the double brace syntax is required to work around clang bug 21629
1266 // { ID_t{ 1U, 5U, 2U, 7U }, ID_t{ 1U, 5U, 2U, 6U } };
1267  {{ ID_t{ 1U, 5U, 2U, 7U }, ID_t{ 1U, 5U, 2U, 6U } }};
1268  std::array<ID_t, 1U> const expected5
1269  // BUG the double brace syntax is required to work around clang bug 21629
1270 // { ID_t{ 1U, 5U, 2U, 5U } };
1271  {{ ID_t{ 1U, 5U, 2U, 5U } }};
1272 
1273  ID_t const default3 { 1U, 5U, 0U, 9U };
1274  auto default3value = default3;
1275 
1276  std::vector<ID_t> const default6({
1277  ID_t{ 1U, 5U, 0U, 4U }, ID_t{ 1U, 5U, 0U, 3U }, ID_t{ 1U, 5U, 0U, 2U }
1278  });
1279  auto default6value = default6;
1280 
1281  //
1282  // read simple atom
1283  //
1284  auto id11 = geo::fhicl::readParameter(config().Wire);
1285  static_assert(std::is_same_v<decltype(id11), ID_t>);
1286  BOOST_TEST(id11 == expected1);
1287 
1288  //
1289  // read optional atom
1290  //
1291 
1292  // this one is present (default values should be ignored):
1293  auto id21 = geo::fhicl::readParameter(config().MaybeWire);
1294  static_assert(std::is_same_v<decltype(id21), std::optional<ID_t>>);
1295  BOOST_TEST(id21.has_value());
1296  if (id21.has_value()) BOOST_TEST(id21.value() == expected2);
1297 
1298  default3value = default3;
1299  auto id22 = geo::fhicl::readParameter(config().MaybeWire, default3);
1300  static_assert(std::is_same_v<decltype(id22), ID_t>);
1301  BOOST_TEST(id22 == expected2);
1302  BOOST_TEST(default3value == default3);
1303 
1304  default3value = default3;
1305  auto id23
1306  = geo::fhicl::readParameter(config().MaybeWire, std::move(default3));
1307  static_assert(std::is_same_v<decltype(id23), ID_t>);
1308  BOOST_TEST(id23 == expected2);
1309  BOOST_TEST(default3value == default3);
1310 
1311  // this one is omitted:
1312  auto id31 = geo::fhicl::readParameter(config().NoWire);
1313  static_assert(std::is_same_v<decltype(id31), std::optional<ID_t>>);
1314  BOOST_TEST(!id31.has_value());
1315 
1316  default3value = default3;
1317  auto id32 = geo::fhicl::readParameter(config().NoWire, default3);
1318  static_assert(std::is_same_v<decltype(id32), ID_t>);
1319  BOOST_TEST(id32 == default3);
1320  BOOST_TEST(default3value == default3);
1321 
1322  default3value = default3;
1323  auto id33 = geo::fhicl::readParameter(config().NoWire, std::move(default3));
1324  static_assert(std::is_same_v<decltype(id33), ID_t>);
1325  BOOST_TEST(id33 == default3);
1326 
1327  // test for compilation
1328  auto id34 = geo::fhicl::readParameter(config().NoWire, { 1U, 3U, 6U, 9U });
1329  BOOST_TEST(id34 == (geo::WireID{ 1U, 3U, 6U, 9U }));
1330 
1331 
1332  //
1333  // read sequence
1334  //
1335  auto id41 = geo::fhicl::readParameter(config().Wires);
1336  static_assert(std::is_same_v<decltype(id41), std::vector<ID_t>>);
1337  BOOST_TEST(id41.size() == expected4.size());
1338  std::size_t max41 = std::max(id41.size(), expected4.size());
1339  for (std::size_t i = 0U; i < max41; ++i) BOOST_TEST_CONTEXT("element " << i) {
1340  BOOST_TEST(id41[i] == expected4[i]);
1341  }
1342 
1343  //
1344  // read optional sequence
1345  //
1346  // this one is present (default values should be ignored):
1347  auto id51 = geo::fhicl::readParameter(config().MaybeWires);
1348  static_assert
1349  (std::is_same_v<decltype(id51), std::optional<std::vector<ID_t>>>);
1350  BOOST_TEST(id51.has_value());
1351  if (id51.has_value()) {
1352  BOOST_CHECK_EQUAL_COLLECTIONS
1353  (id51->begin(), id51->end(), expected5.begin(), expected5.end());
1354  }
1355 
1356  default6value = default6;
1357  auto id52 = geo::fhicl::readParameter(config().MaybeWires, default6value);
1358  static_assert(std::is_same_v<decltype(id52), std::vector<ID_t>>);
1359  BOOST_CHECK_EQUAL_COLLECTIONS
1360  (id52.begin(), id52.end(), expected5.begin(), expected5.end());
1361  BOOST_CHECK_EQUAL_COLLECTIONS(
1362  default6value.begin(), default6value.end(),
1363  default6.begin(), default6.end()
1364  );
1365 
1366  default6value = default6;
1367  auto id53
1368  = geo::fhicl::readParameter(config().MaybeWires, std::move(default6value));
1369  static_assert(std::is_same_v<decltype(id53), std::vector<ID_t>>);
1370  BOOST_CHECK_EQUAL_COLLECTIONS
1371  (id53.begin(), id53.end(), expected5.begin(), expected5.end());
1372  BOOST_CHECK_EQUAL_COLLECTIONS(
1373  default6value.begin(), default6value.end(),
1374  default6.begin(), default6.end()
1375  );
1376 
1377  // this one is omitted:
1378  auto id61 = geo::fhicl::readParameter(config().NoWires);
1379  static_assert
1380  (std::is_same_v<decltype(id61), std::optional<std::vector<ID_t>>>);
1381  BOOST_TEST(!id61.has_value());
1382 
1383  default6value = default6;
1384  auto id62 = geo::fhicl::readParameter(config().NoWires, default6value);
1385  static_assert(std::is_same_v<decltype(id62), std::vector<ID_t>>);
1386  BOOST_CHECK_EQUAL_COLLECTIONS
1387  (id62.begin(), id62.end(), default6.begin(), default6.end());
1388  BOOST_CHECK_EQUAL_COLLECTIONS(
1389  default6value.begin(), default6value.end(),
1390  default6.begin(), default6.end()
1391  );
1392 
1393  default6value = default6;
1394  auto id63
1395  = geo::fhicl::readParameter(config().NoWires, std::move(default6value));
1396  static_assert(std::is_same_v<decltype(id63), std::vector<ID_t>>);
1397  BOOST_CHECK_EQUAL_COLLECTIONS
1398  (id63.begin(), id63.end(), default6.begin(), default6.end());
1399  // this is a bit out of standard, since after moving an object is guaranteed
1400  // only to be good for destruction; yet usually implementations of std::vector
1401  // leave it as a fully valid empty vector:
1402  BOOST_TEST(default6value.empty());
1403 
1404 } // test_WireUnifiedInterface()
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
BEGIN_PROLOG vertical distance to the surface Name
OptionalID< geo::WireID > OptionalWireID
Member type of optional validated geo::WireID parameter.
IDsequence< geo::WireID > WireIDsequence
Member type of sequence of geo::WireID parameters.
size_t ID_t
Index used to identify Flash_t/QPointCollection_t uniquely in an event.
OptionalIDsequence< geo::WireID > OptionalWireIDsequence
Member type of optional sequence of geo::WireID parameters.
ID readParameter(IDparameter< SrcID > const &atom)
template<typename Config >
fhicl::Table<Config> validateConfig ( std::string const &  configStr)

Definition at line 31 of file geo_types_fhicl_test.cc.

31  {
32  fhicl::ParameterSet pset;
33  pset = fhicl::ParameterSet::make(configStr);
34  fhicl::Table<Config> validatedConfig { fhicl::Name("validatedConfig") };
35 
36  std::cout << std::string(80, '-') << std::endl;
37  std::cout << "===> FHiCL configuration:";
38  if (configStr.empty()) std::cout << " <empty>";
39  else std::cout << "\n" << configStr;
40  std::cout << std::endl;
41  validatedConfig.print_allowed_configuration
42  (std::cout << "===> Expected configuration: ");
43  std::cout << std::endl;
44 
45  validatedConfig.validate_ParameterSet(pset);
46  return validatedConfig;
47 } // validateConfig()
BEGIN_PROLOG vertical distance to the surface Name
BEGIN_PROLOG could also be cout