File indexing completed on 2026-05-27 07:24:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "detray/navigation/volume_graph.hpp"
0011 #include "detray/utils/logging.hpp"
0012
0013
0014 #include "detray/test/common/build_toy_detector.hpp"
0015 #include "detray/test/utils/hash_tree.hpp"
0016
0017
0018 #include "detray/tutorial/types.hpp"
0019
0020
0021 #include <vecmem/memory/host_memory_resource.hpp>
0022
0023
0024 #include <iostream>
0025
0026
0027 constexpr std::size_t root_hash = 9563506807235398581ul;
0028
0029
0030
0031
0032
0033
0034
0035
0036 int main() {
0037 std::clog << "Volume Graph Tutorial\n=====================\n\n";
0038
0039
0040 vecmem::host_memory_resource host_mr;
0041 const auto [det, names] =
0042 detray::build_toy_detector<detray::tutorial::algebra_t>(host_mr);
0043
0044
0045 detray::volume_graph graph(det);
0046 const auto &adj_mat = graph.adjacency_matrix();
0047
0048
0049
0050 auto geo_checker = detray::hash_tree(adj_mat);
0051
0052 if (geo_checker.root() == root_hash) {
0053 DETRAY_INFO_HOST("Geometry links are consistent");
0054 } else {
0055 DETRAY_ERROR_HOST("Geometry linking has changed! Root hash is "
0056 << geo_checker.root() << ". Please check geometry:\n"
0057 << graph.to_string());
0058 }
0059 }