All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeometryConfigurationInfo.h
Go to the documentation of this file.
1 /**
2  * @file larcoreobj/SummaryData/GeometryConfigurationInfo.h
3  * @brief Description of the current configuration of detector geometry.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date May 13, 2020
6  *
7  * This is a header-only library.
8  */
9 
10 #ifndef LARCOREOBJ_SUMMARYDATA_GEOMETRYCONFIGURATIONINFO_H
11 #define LARCOREOBJ_SUMMARYDATA_GEOMETRYCONFIGURATIONINFO_H
12 
13 // C/C++ standard library
14 #include <string>
15 #include <iosfwd>
16 
17 
18 // -----------------------------------------------------------------------------
19 namespace sumdata {
21  std::ostream& operator<< (std::ostream&, GeometryConfigurationInfo const&);
22 } // namespace sumdata
23 
24 /**
25  * @brief Description of the current configuration of detector geometry.
26  *
27  * This data class contains enough information to determine if the detector
28  * geometry configuration it describes is compatible with another one.
29  *
30  * The version of the data is explicitly included, so that the software can
31  * determine which is the most complete test possible when the version of the
32  * input is older than the current one.
33  *
34  * The information in this object should be as compact as possible to avoid
35  * bloating the data files it is stored into.
36  * Currently, three categories of information are included:
37  *
38  * * the version of this data (just a monotonically increasing integral value);
39  * * the full configuration of `Geometry` service as a string;
40  * * selected information for easier access
41  *
42  * @note The logic determining the compatibility between two
43  * `sumdata::GeometryConfigurationInfo` objects is not part of the object
44  * definition and it is delegated to the appropriate algorithms.
45  *
46  *
47  * Versions
48  * =========
49  *
50  * 1. legacy version; includes
51  * * the version (`1`)
52  * * detector name (`geo::Geometry::DetectorName()`)
53  * 2. includes version 1 information and:
54  * * the configuration of `geo::Geometry` service as a FHiCL string
55  *
56  *
57  */
59 
60  using DataVersion_t = unsigned int; ///< Type used for the version of data.
61 
62  /// Value denoting an invalid data version.
63  static constexpr DataVersion_t InvalidDataVersion = 0U;
64 
65 
66  /// Version of the data in this object (`0` is invalid version).
68 
69  /// `geo::Geometry` service configuration, as FHiCL table.
71 
72  ///< Name of the geometry (`geo::GeometryCore::DetectorName()`).
73  std::string detectorName;
74 
75 
76  /// Protocol: whether the data content is valid.
77  bool isDataValid() const noexcept { return dataVersion != InvalidDataVersion; }
78 
79 }; // sumdata::GeometryConfigurationInfo
80 
81 
82 // -----------------------------------------------------------------------------
83 
84 #endif // LARCOREOBJ_SUMMARYDATA_GEOMETRYCONFIGURATIONINFO_H
DataVersion_t dataVersion
Version of the data in this object (0 is invalid version).
std::string geometryServiceConfiguration
geo::Geometry service configuration, as FHiCL table.
static constexpr DataVersion_t InvalidDataVersion
Value denoting an invalid data version.
bool isDataValid() const noexcept
Protocol: whether the data content is valid.
std::ostream & operator<<(std::ostream &, GeometryConfigurationInfo const &)
unsigned int DataVersion_t
Type used for the version of data.
Description of the current configuration of detector geometry.