10 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_FHICL_H 11 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_FHICL_H 210 template <
typename IDparam>
215 template <
typename IDparam>
233 template <
typename IDtype>
237 template <
typename IDtype>
241 template <
typename IDtype>
245 template <
typename IDtype>
249 template <
typename IDtype>
262 [
this]() {
return valid(); }};
265 operator ID_t()
const {
return ID(); }
291 [
this]() {
return valid(); }};
294 operator ID_t()
const {
return ID(); }
320 [
this]() {
return valid(); }};
323 operator ID_t()
const {
return ID(); }
348 [
this]() {
return valid(); }};
351 operator ID_t()
const {
return ID(); }
376 [
this]() {
return valid(); }};
379 operator ID_t()
const {
return ID(); }
444 template <
typename SrcID,
typename ID = SrcID>
447 template <
typename SrcID,
typename ID = SrcID>
450 return readID<SrcID, ID>(atom);
491 template <
typename SrcID,
typename ID = SrcID>
494 template <
typename SrcID,
typename ID = SrcID>
497 return readOptionalID<SrcID, ID>(atom);
539 template <
typename SrcID,
typename ID = SrcID>
542 template <
typename SrcID,
typename ID = SrcID>
545 template <
typename SrcID,
typename ID = SrcID>
548 return readOptionalID<SrcID, ID>(atom, defValue);
551 template <
typename SrcID,
typename ID = SrcID>
554 return readOptionalID<SrcID, ID>(atom, std::move(defValue));
593 template <
typename SrcID,
typename ID = SrcID>
596 template <
typename SrcID,
typename ID = SrcID>
599 return readIDsequence<SrcID, ID>(seq);
657 template <
typename SrcID,
typename ID = SrcID>
660 template <
typename SrcID,
typename ID = SrcID>
663 return readOptionalIDsequence<SrcID, ID>(seq);
683 template <
typename SrcID,
typename ID = SrcID>
685 std::vector<ID>
const& defValue);
687 template <
typename SrcID,
typename ID = SrcID>
689 std::vector<ID>&& defValue);
691 template <
typename SrcID,
typename ID = SrcID>
693 std::vector<ID>
const& defValue)
695 return readOptionalIDsequence<SrcID, ID>(seq, defValue);
698 template <
typename SrcID,
typename ID = SrcID>
701 return readOptionalIDsequence<SrcID, ID>(seq, std::move(defValue));
718 template <
typename ID>
723 using ID_t =
typename type::ID_t;
725 static constexpr
bool isOptional =
false;
727 static constexpr
bool isAtom =
true;
729 static constexpr
bool isSequence =
false;
733 template <
typename ID>
737 static constexpr
bool isOptional =
true;
740 template <
typename ID>
744 static constexpr
bool isAtom =
false;
745 static constexpr
bool isSequence =
true;
748 template <
typename ID>
752 static constexpr
bool isOptional =
true;
756 template <
typename SrcID,
typename ID >
763 template <
typename SrcID,
typename ID >
769 return atom(cs) ? std::make_optional<ID_t>(cs.ID()) : std::nullopt;
773 template <
typename SrcID,
typename ID >
780 template <
typename SrcID,
typename ID >
787 template <
typename SrcID,
typename ID >
792 std::vector<ID_t> IDs;
793 std::size_t
const n = seq.
size();
795 for (std::size_t i = 0; i <
n; ++i)
796 IDs.push_back(seq(i));
801 template <
typename SrcID,
typename ID >
805 using values_t = std::vector<ID>;
808 if (!seq(values))
return std::nullopt;
811 IDs.reserve(values.
size());
812 std::copy(values.begin(), values.end(), std::back_inserter(IDs));
813 return {std::move(IDs)};
818 template <
typename SrcID,
typename ID >
820 std::vector<ID>
const& defValue)
824 return paramValue.value_or(defValue);
828 template <
typename SrcID,
typename ID >
830 std::vector<ID>&& defValue)
837 #endif // LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_FHICL_H IDparameter< geo::OpDetID > OpDetID
Member type of validated geo::OpDetID parameter.
IDparameter< geo::CryostatID > CryostatID
Member type of validated geo::CryostatID parameter.
std::size_t size() const noexcept
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
std::array< tt::return_type< T >, N > value_type
Traits for ID parameter objects.
Helper class holding the ID validity flag.
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.
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.
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
std::optional< std::vector< ID > > readOptionalIDsequence(OptionalIDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified optional ID sequence.
Type of ID configuration structure (requires specialization)
Definition of data types for geometry description.
FHiCL objects representing geometry classes as configuration parameters.
typename type::ID_t ID_t
Type of ID read.
::fhicl::Atom< bool > isValid
IDparameter< geo::TPCID > TPCID
Member type of validated geo::TPCID parameter.
Namespace collecting geometry-related classes utilities.
ID readParameter(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
typename IDparameterTraits< IDparam >::ID_t IDof
Type of ID of the specified ID FHiCL parameter object/.
The data type to uniquely identify a cryostat.