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/Definitions/Algebra.hpp"
0012 #include "Acts/Material/ISurfaceMaterial.hpp"
0013 #include "Acts/Material/IVolumeMaterial.hpp"
0014 #include "Acts/Material/Material.hpp"
0015 #include "Acts/Material/MaterialSlab.hpp"
0016 #include "Acts/Plugins/Json/ActsJson.hpp"
0017
0018 #include <nlohmann/json.hpp>
0019
0020
0021
0022 namespace Acts {
0023
0024 class ISurfaceMaterial;
0025 class IVolumeMaterial;
0026 class BinUtility;
0027
0028 using volumeMaterialPointer = const Acts::IVolumeMaterial*;
0029 using surfaceMaterialPointer = const Acts::ISurfaceMaterial*;
0030
0031 void to_json(nlohmann::json& j, const Material& t);
0032
0033 void from_json(const nlohmann::json& j, Material& t);
0034
0035 void to_json(nlohmann::json& j, const MaterialSlab& t);
0036
0037 void from_json(const nlohmann::json& j, MaterialSlab& t);
0038
0039 void from_json(const nlohmann::json& j, MaterialSlabMatrix& t);
0040
0041 void to_json(nlohmann::json& j, const volumeMaterialPointer& material);
0042
0043 void from_json(const nlohmann::json& j, volumeMaterialPointer& material);
0044
0045 void to_json(nlohmann::json& j, const surfaceMaterialPointer& material);
0046
0047 void from_json(const nlohmann::json& j, surfaceMaterialPointer& material);
0048
0049
0050 NLOHMANN_JSON_SERIALIZE_ENUM(Acts::MappingType,
0051 {
0052 {Acts::MappingType::PreMapping, "PreMapping"},
0053 {Acts::MappingType::Default, "Default"},
0054 {Acts::MappingType::PostMapping,
0055 "PostMapping"},
0056 {Acts::MappingType::Sensor, "Sensor"},
0057 })
0058
0059 namespace MaterialJsonConverter {
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071 nlohmann::json toJsonDetray(const ISurfaceMaterial& material,
0072 const Acts::Surface& surface,
0073 std::size_t surfaceIndex,
0074 std::map<std::size_t, std::size_t>& gridLink);
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 nlohmann::json toJsonDetray(const Acts::BinUtility& binUtility,
0085 const Acts::Surface& surface);
0086
0087 }
0088
0089 }