Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:45

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 "ActsExamples/GenericDetector/GenericDetectorElement.hpp"
0010 
0011 #include "Acts/Surfaces/DiscSurface.hpp"
0012 #include "Acts/Surfaces/PlaneSurface.hpp"
0013 
0014 #include <utility>
0015 
0016 namespace ActsExamples {
0017 
0018 GenericDetectorElement::GenericDetectorElement(
0019     const Identifier identifier,
0020     std::shared_ptr<const Acts::Transform3> transform,
0021     std::shared_ptr<const Acts::PlanarBounds> pBounds, double thickness,
0022     std::shared_ptr<const Acts::ISurfaceMaterial> material)
0023     : Acts::DetectorElementBase(),
0024       m_elementIdentifier(identifier),
0025       m_elementTransform(std::move(transform)),
0026       m_elementSurface(
0027           Acts::Surface::makeShared<Acts::PlaneSurface>(pBounds, *this)),
0028       m_elementThickness(thickness),
0029       m_elementPlanarBounds(std::move(pBounds)),
0030       m_elementDiscBounds(nullptr) {
0031   m_elementSurface->assignSurfaceMaterial(std::move(material));
0032 }
0033 
0034 GenericDetectorElement::GenericDetectorElement(
0035     const Identifier identifier,
0036     std::shared_ptr<const Acts::Transform3> transform,
0037     std::shared_ptr<const Acts::DiscBounds> dBounds, double thickness,
0038     std::shared_ptr<const Acts::ISurfaceMaterial> material)
0039     : Acts::DetectorElementBase(),
0040       m_elementIdentifier(identifier),
0041       m_elementTransform(std::move(transform)),
0042       m_elementSurface(
0043           Acts::Surface::makeShared<Acts::DiscSurface>(dBounds, *this)),
0044       m_elementThickness(thickness),
0045       m_elementPlanarBounds(nullptr),
0046       m_elementDiscBounds(std::move(dBounds)) {
0047   m_elementSurface->assignSurfaceMaterial(std::move(material));
0048 }
0049 
0050 const Acts::Transform3& GenericDetectorElement::transform(
0051     const Acts::GeometryContext& /*gctx*/) const {
0052   return *m_elementTransform;
0053 }
0054 
0055 const Acts::Surface& GenericDetectorElement::surface() const {
0056   return *m_elementSurface;
0057 }
0058 
0059 Acts::Surface& GenericDetectorElement::surface() {
0060   return *m_elementSurface;
0061 }
0062 
0063 double GenericDetectorElement::thickness() const {
0064   return m_elementThickness;
0065 }
0066 
0067 GenericDetectorElement::Identifier GenericDetectorElement::identifier() const {
0068   return m_elementIdentifier;
0069 }
0070 
0071 }  // namespace ActsExamples