File indexing completed on 2025-01-18 09:27:42
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(BinningValue, {{BinningValue::binX, "binX"},
0046 {BinningValue::binY, "binY"},
0047 {BinningValue::binZ, "binZ"},
0048 {BinningValue::binR, "binR"},
0049 {BinningValue::binPhi, "binPhi"},
0050 {BinningValue::binRPhi, "binRPhi"},
0051 {BinningValue::binH, "binH"},
0052 {BinningValue::binEta, "binEta"},
0053 {BinningValue::binMag, "binMag"}})
0054
0055 }