GeometryConfigurationInfo.h
Go to the documentation of this file.
1 #ifndef SUMMARYDATA_GEOMETRYCONFIGURATIONINFO_H
2 #define SUMMARYDATA_GEOMETRYCONFIGURATIONINFO_H
3 
4 // C/C++ standard library
5 #include <string>
6 #include <iosfwd>
7 
8 // -----------------------------------------------------------------------------
9 namespace gar {
10  namespace sumdata {
12  std::ostream& operator<< (std::ostream&, GeometryConfigurationInfo const&);
13  } //namespace sumdata
14 } //namespace gar
15 
16 /**
17  * @brief Description of the current configuration of detector geometry.
18  *
19  * This data class contains enough information to determine if the detector
20  * geometry configuration it describes is compatible with another one.
21  *
22  * The version of the data is explicitly included, so that the software can
23  * determine which is the most complete test possible when the version of the
24  * input is older than the current one.
25  *
26  * The information in this object should be as compact as possible to avoid
27  * bloating the data files it is stored into.
28  * Currently, three categories of information are included:
29  *
30  * * the version of this data (just a monotonically increasing integral value);
31  * * the full configuration of `Geometry` service as a string;
32  * * selected information for easier access
33  *
34  * @note The logic determining the compatibility between two
35  * `sumdata::GeometryConfigurationInfo` objects is not part of the object
36  * definition and it is delegated to the appropriate algorithms.
37  *
38  *
39  * Versions
40  * =========
41  *
42  * 1. legacy version; includes
43  * * the version (`1`)
44  * * detector name (`geo::Geometry::DetectorName()`)
45  * 2. includes version 1 information and:
46  * * the configuration of `geo::Geometry` service as a FHiCL string
47  *
48  *
49  */
50 
52 
53  using DataVersion_t = unsigned int; ///< Type used for the version of data.
54 
55  /// Value denoting an invalid data version.
56  static constexpr DataVersion_t InvalidDataVersion = 0U;
57 
58  /// Version of the data in this object (`0` is invalid version).
60 
61  /// `geo::Geometry` service configuration, as FHiCL table.
63 
64  ///< Name of the geometry (`geo::GeometryCore::DetectorName()`).
66 
67  /// Protocol: whether the data content is valid.
68  bool isDataValid() const noexcept { return dataVersion != InvalidDataVersion; }
69 }; // sumdata::GeometryConfigurationInfo
70 
71 // -----------------------------------------------------------------------------
72 
73 #endif // SUMMARYDATA_GEOMETRYCONFIGURATIONINFO_H
std::ostream & operator<<(std::ostream &, GeometryConfigurationInfo const &)
std::string string
Definition: nybbler.cc:12
DataVersion_t dataVersion
Version of the data in this object (0 is invalid version).
Description of the current configuration of detector geometry.
std::string geometryServiceConfiguration
geo::Geometry service configuration, as FHiCL table.
unsigned int DataVersion_t
Type used for the version of data.
General GArSoft Utilities.
bool isDataValid() const noexcept
Protocol: whether the data content is valid.
static constexpr DataVersion_t InvalidDataVersion
Value denoting an invalid data version.