Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:46:35

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 "ActsPlugins/Json/JsonDetectorElement.hpp"
0010 
0011 #include "ActsPlugins/Json/AlgebraJsonConverter.hpp"
0012 #include "ActsPlugins/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->assignSurfacePlacement(*this);
0022   m_surface->assignThickness(thickness);
0023 }
0024 
0025 const Surface &JsonDetectorElement::surface() const {
0026   return *m_surface;
0027 }
0028 
0029 Surface &JsonDetectorElement::surface() {
0030   return *m_surface;
0031 }
0032 
0033 const Transform3 &JsonDetectorElement::localToGlobalTransform(
0034     const GeometryContext & /*gctx*/) const {
0035   return m_transform;
0036 }
0037 
0038 double JsonDetectorElement::thickness() const {
0039   return m_thickness;
0040 }
0041 
0042 }  // namespace Acts