LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ReadoutDataContainers.h
Go to the documentation of this file.
1 
11 #ifndef LARCOREALG_GEOMETRY_READOUTDATACONTAINERS_H
12 #define LARCOREALG_GEOMETRY_READOUTDATACONTAINERS_H
13 
14 // LArSoft libraries
18 
19 namespace readout {
20 
21  template <typename T>
23 
24  template <typename T>
26 
27 } // namespace geo
28 
29 // --- BEGIN Readout data containers -------------------------------------------
33 
34 //------------------------------------------------------------------------------
56 template <typename T>
57 class readout::TPCsetDataContainer : public geo::GeoIDdataContainer<T, readout::TPCsetIDmapper<>> {
58 
60 
61 public:
63 
72  TPCsetDataContainer() = default;
73 
82  TPCsetDataContainer(unsigned int nCryo, unsigned int nTPCsets)
83  : BaseContainer_t({nCryo, nTPCsets})
84  {}
85 
100  TPCsetDataContainer(unsigned int nCryo, unsigned int nTPCsets, value_type const& defValue)
101  : BaseContainer_t({nCryo, nTPCsets}, defValue)
102  {}
103 
104  // --- BEGIN Container modification ------------------------------------------
107 
120  void resize(unsigned int nCryo, unsigned int nTPCsets)
121  {
122  BaseContainer_t::resize({nCryo, nTPCsets});
123  }
124 
142  void resize(unsigned int nCryo, unsigned int nTPCsets, T const& defValue)
143  {
144  BaseContainer_t::resize({nCryo, nTPCsets}, defValue);
145  }
146 
148  // --- END Container modification --------------------------------------------
149 
150  // --- BEGIN Container status query ------------------------------------------
153 
155  bool hasCryostat(readout::CryostatID const& cryoid) const
156  {
157  return BaseContainer_t::hasElement(cryoid);
158  }
159 
161  bool hasTPCset(readout::TPCsetID const& tpcsetid) const
162  {
163  return BaseContainer_t::hasElement(tpcsetid);
164  }
165 
167  // --- END Container status query --------------------------------------------
168 
169 }; // class readout::TPCsetDataContainer<>
170 
171 //------------------------------------------------------------------------------
193 template <typename T>
194 class readout::ROPDataContainer : public geo::GeoIDdataContainer<T, readout::ROPIDmapper<>> {
195 
198 
199 public:
208  ROPDataContainer() = default;
209 
220  ROPDataContainer(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
221  : BaseContainer_t({nCryo, nTPCsets, nROPs})
222  {}
223 
240  ROPDataContainer(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs, T const& defValue)
241  : BaseContainer_t{{nCryo, nTPCsets, nROPs}, defValue}
242  {}
243 
244  // --- BEGIN Container modification ------------------------------------------
247 
262  void resize(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
263  {
264  BaseContainer_t::resize({nCryo, nTPCsets, nROPs});
265  }
266 
282  void resize(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs, T const& defValue)
283  {
284  BaseContainer_t::resize({nCryo, nTPCsets, nROPs}, defValue);
285  }
286 
288  // --- END Container modification --------------------------------------------
289 
290  // --- BEGIN Container status query ------------------------------------------
293 
295  bool hasCryostat(readout::CryostatID const& cryoid) const
296  {
297  return BaseContainer_t::hasElement(cryoid);
298  }
299 
301  bool hasTPCset(readout::TPCsetID const& tpcsetid) const
302  {
303  return BaseContainer_t::hasElement(tpcsetid);
304  }
305 
307  bool hasROP(readout::ROPID const& ropid) const { return BaseContainer_t::hasElement(ropid); }
308 
310  // --- END Container status query --------------------------------------------
311 
312 }; // class readout::ROPDataContainer<>
313 
315 // --- END Readout data containers ---------------------------------------------
316 //------------------------------------------------------------------------------
317 
318 #endif // LARCOREALG_GEOMETRY_READOUTDATACONTAINERS_H
Container with one element per readout TPC set.
Classes identifying readout-related concepts.
bool hasCryostat(readout::CryostatID const &cryoid) const
Returns whether this container hosts data for the specified cryostat.
Container with one element per readout plane.
ROPDataContainer(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs, T const &defValue)
Prepares the container with copies of the specified default value.
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:72
void resize(unsigned int nCryo, unsigned int nTPCsets)
Prepares the container with default-constructed data.
Container with one element per geometry TPC.
void resize(unsigned int nCryo, unsigned int nTPCsets, T const &defValue)
Prepares the container initializing all its data.
void resize(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
Prepares the container with default-constructed data.
Containers to hold one datum per TPC or plane.
typename BaseContainer_t::value_type value_type
void resize(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs, T const &defValue)
Prepares the container initializing all its data.
Class identifying a set of planes sharing readout channels.
bool hasTPCset(readout::TPCsetID const &tpcsetid) const
Returns whether this container hosts data for the specified TPC set.
bool hasROP(readout::ROPID const &ropid) const
Returns whether this container hosts data for the specified readout plane.
TPCsetDataContainer()=default
Default constructor: empty container.
bool hasCryostat(readout::CryostatID const &cryoid) const
Returns whether this container hosts data for the specified cryostat.
TPCsetDataContainer(unsigned int nCryo, unsigned int nTPCsets, value_type const &defValue)
Prepares the container with copies of the specified default value.
bool hasTPCset(readout::TPCsetID const &tpcsetid) const
Returns whether this container hosts data for the specified TPC set.
TPCsetDataContainer(unsigned int nCryo, unsigned int nTPCsets)
Prepares the container with default-constructed data.
Mapping between geometry/readout ID and flat index.
typename Container_t::value_type value_type
Special iterator dereferencing to pairs ( ID, value ) (see items()).
ROPDataContainer(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
Prepares the container with default-constructed data.
void resize(std::initializer_list< unsigned int > dims)
Prepares the container with default-constructed data.
bool hasElement(GeoID const &id) const
Returns whether this container hosts data for the specified ID.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:192