File indexing completed on 2025-09-13 08:28:02
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Plugins/Json/ActsJson.hpp"
0012 #include "Acts/Utilities/BinUtility.hpp"
0013 #include "Acts/Utilities/BinningData.hpp"
0014 #include "Acts/Utilities/BinningType.hpp"
0015 #include "Acts/Utilities/RangeXD.hpp"
0016
0017 #include <nlohmann/json.hpp>
0018
0019
0020
0021
0022 namespace Acts {
0023 class BinningData;
0024
0025 void to_json(nlohmann::json& j, const BinningData& bd);
0026
0027 void from_json(const nlohmann::json& j, BinningData& bd);
0028
0029 void to_json(nlohmann::json& j, const BinUtility& bu);
0030
0031 void from_json(const nlohmann::json& j, BinUtility& bu);
0032
0033 template <typename Type>
0034 void to_json(nlohmann::json& j, const Range1D<Type>& r) {
0035 j["min"] = r.min();
0036 j["max"] = r.max();
0037 }
0038
0039 template <typename Type>
0040 void from_json(const nlohmann::json& j, Range1D<Type>& r) {
0041 r.setMin(static_cast<Type>(j["min"]));
0042 r.setMax(static_cast<Type>(j["max"]));
0043 }
0044
0045 NLOHMANN_JSON_SERIALIZE_ENUM(AxisDirection,
0046 {{AxisDirection::AxisX, "AxisX"},
0047 {AxisDirection::AxisY, "AxisY"},
0048 {AxisDirection::AxisZ, "AxisZ"},
0049 {AxisDirection::AxisR, "AxisR"},
0050 {AxisDirection::AxisPhi, "AxisPhi"},
0051 {AxisDirection::AxisRPhi, "AxisRPhi"},
0052 {AxisDirection::AxisTheta, "AxisTheta"},
0053 {AxisDirection::AxisEta, "AxisEta"},
0054 {AxisDirection::AxisMag, "AxisMag"}})
0055
0056 }