Back to home page

EIC code displayed by LXR

 
 

    


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

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/JsonDetectorElement.hpp"
0010 
0011 #include "Acts/Plugins/Json/AlgebraJsonConverter.hpp"
0012 #include "Acts/Plugins/Json/SurfaceJsonConverter.hpp"
0013 
0014 namespace Acts {
0015 
0016 JsonDetectorElement::JsonDetectorElement(const nlohmann::json &jSurface,
0017                                          double thickness)
0018     : m_thickness(thickness) {
0019   m_surface = Acts::SurfaceJsonConverter::fromJson(jSurface);
0020   m_transform = Transform3JsonConverter::fromJson(jSurface["transform"]);
0021   m_surface->assignDetectorElement(*this);
0022 }
0023 
0024 const Surface &JsonDetectorElement::surface() const {
0025   return *m_surface;
0026 }
0027 
0028 Surface &JsonDetectorElement::surface() {
0029   return *m_surface;
0030 }
0031 
0032 const Transform3 &JsonDetectorElement::transform(
0033     const GeometryContext & /*gctx*/) const {
0034   return m_transform;
0035 }
0036 
0037 double JsonDetectorElement::thickness() const {
0038   return m_thickness;
0039 }
0040 
0041 }  // namespace Acts