LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
readout_types_fhicl.h
Go to the documentation of this file.
1 
10 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_FHICL_H
11 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_FHICL_H
12 
13 // LArSoft libraries
16 
17 // support libraries
18 #include "fhiclcpp/types/Atom.h"
19 
20 namespace geo::fhicl {
21 
23  template <>
24  struct IDConfig<readout::TPCsetID> : public IDConfig<readout::CryostatID> {
26 
28  ::fhicl::Name("S"),
29  ::fhicl::Comment("TPC set number within the cryostat"),
30  [this]() { return valid(); }};
31 
32  ID_t ID() const { return !valid() ? ID_t{} : ID_t{IDConfig<readout::CryostatID>::ID(), S()}; }
33  operator ID_t() const { return ID(); }
34  }; // struct IDConfig<readout::TPCsetID>
35 
37  template <>
38  struct IDConfig<readout::ROPID> : public IDConfig<readout::TPCsetID> {
39  using ID_t = readout::ROPID;
40 
42  ::fhicl::Name("R"),
43  ::fhicl::Comment("Readout plane number within the TPC set"),
44  [this]() { return valid(); }};
45 
46  ID_t ID() const { return !valid() ? ID_t{} : ID_t{IDConfig<readout::TPCsetID>::ID(), R()}; }
47  operator ID_t() const { return ID(); }
48  }; // struct IDConfig<readout::ROPID>
49 
50 } // namespace geo::fhicl
51 
53 namespace readout::fhicl {
54 
55  // --- BEGIN -- Importing from geo::fhicl namespace --------------------------
56 
57  //
58  // types
59  //
61  using geo::fhicl::IDof;
67 
68  //
69  // utilities
70  //
71  using geo::fhicl::readID;
76 
77  // --- END -- Importing from geo::fhicl namespace ----------------------------
78 
79  // --- BEGIN -- Validated configuration parameters for readout ID objects ----
104 
106  // --- BEGIN -- Cryostat ID --------------------------------------------------
107  //
108  // because `readout::CryostatID` is an alias of `geo::CryostatID`,
109  // the following types are also aliases of the corresponding `geo::fhicl` ones
110  //
111 
113  using CryostatID = IDparameter<readout::CryostatID>;
114 
116  using OptionalCryostatID = OptionalID<readout::CryostatID>;
117 
119  using CryostatIDsequence = IDsequence<readout::CryostatID>;
120 
122  using OptionalCryostatIDsequence = OptionalIDsequence<readout::CryostatID>;
123 
124  // --- END -- Cryostat ID ----------------------------------------------------
125 
126  // --- BEGIN -- TPC set ID ---------------------------------------------------
127 
129  using TPCsetID = IDparameter<readout::TPCsetID>;
130 
132  using OptionalTPCsetID = OptionalID<readout::TPCsetID>;
133 
135  using TPCsetIDsequence = IDsequence<readout::TPCsetID>;
136 
138  using OptionalTPCsetIDsequence = OptionalIDsequence<readout::TPCsetID>;
139 
140  // --- END -- TPC set ID -----------------------------------------------------
141 
142  // --- BEGIN -- Readout plane ID ---------------------------------------------
143 
145  using ROPID = IDparameter<readout::ROPID>;
146 
148  using OptionalROPID = OptionalID<readout::ROPID>;
149 
151  using ROPIDsequence = IDsequence<readout::ROPID>;
152 
154  using OptionalROPIDsequence = OptionalIDsequence<readout::ROPID>;
155 
156  // --- END -- Readout plane ID -----------------------------------------------
157 
159  // --- END -- Validated configuration parameters for readout ID objects ------
160 
161 } // namespace readout::fhicl
162 
163 // -----------------------------------------------------------------------------
164 
165 #endif // LARCOREOBJ_SIMPLETYPESANDCONSTANTS_READOUT_TYPES_FHICL_H
::fhicl::OptionalSequence< IDparameter< IDtype >> OptionalIDsequence
Member type of optional sequence of ID parameters.
::fhicl::OptionalTable< IDConfig< IDtype >> OptionalID
Member type of optional validated ID parameter.
OptionalID< readout::TPCsetID > OptionalTPCsetID
Member type of optional validated readout::TPCsetID parameter.
std::vector< ID > readIDsequence(IDsequence< SrcID > const &seq)
Returns a vector of IDs extracted from the specified ID sequence.
Classes identifying readout-related concepts.
IDparameter< readout::ROPID > ROPID
Member type of validated readout::ROPID parameter.
Traits for ID parameter objects.
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:72
OptionalID< readout::ROPID > OptionalROPID
Member type of optional validated readout::ROPID parameter.
OptionalIDsequence< readout::TPCsetID > OptionalTPCsetIDsequence
Member type of optional sequence of readout::TPCsetID parameters.
IDparameter< readout::CryostatID > CryostatID
Member type of validated readout::CryostatID parameter.
ID readID(IDparameter< SrcID > const &atom)
Returns an ID extracted from the specified ID atom.
IDsequence< readout::ROPID > ROPIDsequence
Member type of sequence of readout::ROPID parameters.
OptionalIDsequence< readout::ROPID > OptionalROPIDsequence
Member type of optional sequence of readout::ROPID parameters.
OptionalIDsequence< readout::CryostatID > OptionalCryostatIDsequence
Member type of optional sequence of readout::CryostatID parameters.
std::optional< ID > readOptionalID(OptionalID< SrcID > const &atom)
Returns an ID extracted from the specified optional ID atom.
IDparameter< readout::TPCsetID > TPCsetID
Member type of validated readout::TPCsetID parameter.
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)
::fhicl::Sequence< IDparameter< IDtype >> IDsequence
Member type of sequence of ID parameters.
FHiCL objects representing geometry classes as configuration parameters.
OptionalID< readout::CryostatID > OptionalCryostatID
Member type of optional validated readout::CryostatID parameter.
::fhicl::Table< IDConfig< IDtype >> IDparameter
Member type of validated ID parameter.
IDsequence< readout::TPCsetID > TPCsetIDsequence
Member type of sequence of readout::TPCsetID parameters.
IDsequence< readout::CryostatID > CryostatIDsequence
Member type of sequence of readout::CryostatID parameters.
FHiCL objects representing geometry classes as configuration parameters.
Utilities for using geometry IDs in FHiCL validated configuration.
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/.