LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
ReadoutDataContainers.h
Go to the documentation of this file.
1 
9 #ifndef LARCOREALG_GEOMETRY_READOUTDATACONTAINERS_H
10 #define LARCOREALG_GEOMETRY_READOUTDATACONTAINERS_H
11 
12 // LArSoft libraries
16 
17 namespace readout {
18 
19  template <typename T>
21 
22  template <typename T>
24 
25 } // namespace geo
26 
27 // --- BEGIN Readout data containers -------------------------------------------
31 
32 //------------------------------------------------------------------------------
54 template <typename T>
55 class readout::TPCsetDataContainer : public geo::GeoIDdataContainer<T, readout::TPCsetIDmapper<>> {
56 
58 
59 public:
61 
70  TPCsetDataContainer() = default;
71 
80  TPCsetDataContainer(unsigned int nCryo, unsigned int nTPCsets)
81  : BaseContainer_t({nCryo, nTPCsets})
82  {}
83 
98  TPCsetDataContainer(unsigned int nCryo, unsigned int nTPCsets, value_type const& defValue)
99  : BaseContainer_t({nCryo, nTPCsets}, defValue)
100  {}
101 
102  // --- BEGIN Container modification ------------------------------------------
105 
118  void resize(unsigned int nCryo, unsigned int nTPCsets)
119  {
120  BaseContainer_t::resize({nCryo, nTPCsets});
121  }
122 
140  void resize(unsigned int nCryo, unsigned int nTPCsets, T const& defValue)
141  {
142  BaseContainer_t::resize({nCryo, nTPCsets}, defValue);
143  }
144 
146  // --- END Container modification --------------------------------------------
147 
148  // --- BEGIN Container status query ------------------------------------------
151 
153  bool hasCryostat(readout::CryostatID const& cryoid) const
154  {
155  return BaseContainer_t::hasElement(cryoid);
156  }
157 
159  bool hasTPCset(readout::TPCsetID const& tpcsetid) const
160  {
161  return BaseContainer_t::hasElement(tpcsetid);
162  }
163 
165  // --- END Container status query --------------------------------------------
166 
167 }; // class readout::TPCsetDataContainer<>
168 
169 //------------------------------------------------------------------------------
191 template <typename T>
192 class readout::ROPDataContainer : public geo::GeoIDdataContainer<T, readout::ROPIDmapper<>> {
193 
196 
197 public:
206  ROPDataContainer() = default;
207 
218  ROPDataContainer(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
219  : BaseContainer_t({nCryo, nTPCsets, nROPs})
220  {}
221 
238  ROPDataContainer(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs, T const& defValue)
239  : BaseContainer_t{{nCryo, nTPCsets, nROPs}, defValue}
240  {}
241 
242  // --- BEGIN Container modification ------------------------------------------
245 
260  void resize(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs)
261  {
262  BaseContainer_t::resize({nCryo, nTPCsets, nROPs});
263  }
264 
280  void resize(unsigned int nCryo, unsigned int nTPCsets, unsigned int nROPs, T const& defValue)
281  {
282  BaseContainer_t::resize({nCryo, nTPCsets, nROPs}, defValue);
283  }
284 
286  // --- END Container modification --------------------------------------------
287 
288  // --- BEGIN Container status query ------------------------------------------
291 
293  bool hasCryostat(readout::CryostatID const& cryoid) const
294  {
295  return BaseContainer_t::hasElement(cryoid);
296  }
297 
299  bool hasTPCset(readout::TPCsetID const& tpcsetid) const
300  {
301  return BaseContainer_t::hasElement(tpcsetid);
302  }
303 
305  bool hasROP(readout::ROPID const& ropid) const { return BaseContainer_t::hasElement(ropid); }
306 
308  // --- END Container status query --------------------------------------------
309 
310 }; // class readout::ROPDataContainer<>
311 
313 // --- END Readout data containers ---------------------------------------------
314 //------------------------------------------------------------------------------
315 
316 #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:54
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.This is a header-only library.
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.This is a header-only library. ...
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:187