ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
io_metadata.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/core/concepts.hpp"
13#include "detray/utils/logging.hpp"
14#include "detray/utils/type_list.hpp"
15#include "detray/version.hpp" // generated by cmake
16
17// System include(s).
18#include <chrono>
19#include <iomanip>
20#include <iostream>
21#include <locale>
22#include <sstream>
23#include <string>
24#include <string_view>
25
26namespace detray::io::detail {
27
28template <concepts::detector detector_t>
29inline void print_type_warning([[maybe_unused]] const std::string& subject) {
30 DETRAY_WARN_HOST("Detector of type \n"
31 << DETRAY_TYPENAME(typename detector_t::metadata)
32 << "does not support " << subject);
33}
34
37inline std::string get_current_date() {
38 const std::chrono::time_point now{std::chrono::system_clock::now()};
39 const std::chrono::year_month_day ymd{
40 std::chrono::floor<std::chrono::days>(now)};
41
42 std::ostringstream stream{};
43 stream << ymd;
44
45 return stream.str();
46}
47
49inline std::string get_detray_version() {
50 return "detray - " + std::string(detray::version);
51}
52
53static constexpr std::string_view minimal_io_version = "detray - 0.112.0";
54
55} // namespace detray::io::detail