Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:15:19

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/Plugins/Json/VolumeJsonConverter.hpp"
0010 
0011 #include "Acts/Geometry/TrackingVolume.hpp"
0012 #include "Acts/Plugins/Json/GeometryJsonKeys.hpp"
0013 #include "Acts/Plugins/Json/MaterialJsonConverter.hpp"
0014 
0015 void Acts::to_json(
0016     nlohmann::json& j,
0017     const std::pair<const Acts::TrackingVolume*,
0018                     std::shared_ptr<const Acts::IVolumeMaterial>>& volume) {
0019   j[Acts::jsonKey().namekey] = volume.first->volumeName();
0020   to_json(j, volume.second.get());
0021 }
0022 
0023 void Acts::to_json(nlohmann::json& j, const Acts::TrackingVolume& volume) {
0024   j[Acts::jsonKey().namekey] = volume.volumeName();
0025   if (volume.volumeMaterial() != nullptr) {
0026     to_json(j, volume.volumeMaterial());
0027   }
0028   return;
0029 }