10 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_FHICL_H 11 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_TYPES_FHICL_H 212 template <
typename IDparam>
218 template <
typename IDparam>
239 template <
typename IDtype>
243 template <
typename IDtype>
247 template <
typename IDtype>
251 template <
typename IDtype>
255 template <
typename IDtype>
270 [
this](){
return valid(); }
302 [
this](){
return valid(); }
334 [
this](){
return valid(); }
366 [
this](){
return valid(); }
398 [
this](){
return valid(); }
469 template <
typename SrcID,
typename ID = SrcID>
472 template <
typename SrcID,
typename ID = SrcID>
474 {
return readID<SrcID, ID>(atom); }
515 template <
typename SrcID,
typename ID = SrcID>
518 template <
typename SrcID,
typename ID = SrcID>
520 {
return readOptionalID<SrcID, ID>(atom); }
562 template <
typename SrcID,
typename ID = SrcID>
565 template <
typename SrcID,
typename ID = SrcID>
568 template <
typename SrcID,
typename ID = SrcID>
570 {
return readOptionalID<SrcID, ID>(atom, defValue); }
572 template <
typename SrcID,
typename ID = SrcID>
574 {
return readOptionalID<SrcID, ID>(atom,
std::move(defValue)); }
613 template <
typename SrcID,
typename ID = SrcID>
616 template <
typename SrcID,
typename ID = SrcID>
618 {
return readIDsequence<SrcID, ID>(seq); }
675 template <
typename SrcID,
typename ID = SrcID>
679 template <
typename SrcID,
typename ID = SrcID>
682 {
return readOptionalIDsequence<SrcID, ID>(seq); }
701 template <
typename SrcID,
typename ID = SrcID>
705 template <
typename SrcID,
typename ID = SrcID>
709 template <
typename SrcID,
typename ID = SrcID>
712 {
return readOptionalIDsequence<SrcID, ID>(seq, defValue); }
714 template <
typename SrcID,
typename ID = SrcID>
717 {
return readOptionalIDsequence<SrcID, ID>(seq,
std::move(defValue)); }
735 template <
typename ID>
740 using ID_t =
typename type::ID_t;
742 static constexpr
bool isOptional =
false;
744 static constexpr
bool isAtom =
true;
746 static constexpr
bool isSequence =
false;
751 template <
typename ID>
756 static constexpr
bool isOptional =
true;
760 template <
typename ID>
765 static constexpr
bool isAtom =
false;
766 static constexpr
bool isSequence =
true;
770 template <
typename ID>
775 static constexpr
bool isOptional =
true;
780 template <
typename SrcID,
typename ID >
787 template <
typename SrcID,
typename ID >
792 return atom(cs)? std::make_optional<ID_t>(cs.ID()): std::nullopt;
797 template <
typename SrcID,
typename ID >
803 template <
typename SrcID,
typename ID >
809 template <
typename SrcID,
typename ID >
813 std::vector<ID_t> IDs;
814 std::size_t
const n = seq.
size();
816 for (std::size_t i = 0; i <
n; ++i)
817 IDs.push_back(seq(i));
823 template <
typename SrcID,
typename ID >
827 using values_t = std::vector<ID>;
830 if (!seq(values))
return std::nullopt;
833 IDs.reserve(values.
size());
834 std::copy(values.begin(), values.end(), std::back_inserter(IDs));
841 template <
typename SrcID,
typename ID >
847 return paramValue.value_or(defValue);
852 template <
typename SrcID,
typename ID >
863 #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.
ChannelGroupService::Name Name
std::pair< float, std::string > P
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.
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.
LArSoft geometry interface.
ID readParameter(IDparameter< SrcID > const &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.