Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-05 08:19:03

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/Definitions/Algebra.hpp"
0010 #include "Acts/Definitions/Units.hpp"
0011 #include "Acts/Geometry/BlueprintNode.hpp"
0012 #include "Acts/Geometry/CylinderVolumeBounds.hpp"
0013 #include "Acts/Geometry/MaterialDesignatorBlueprintNode.hpp"
0014 #include "Acts/Material/HomogeneousSurfaceMaterial.hpp"
0015 #include "Acts/Material/Material.hpp"
0016 #include "Acts/Material/MaterialSlab.hpp"
0017 #include "Acts/Utilities/AxisDefinitions.hpp"
0018 #include "Acts/Utilities/AxisSpec.hpp"
0019 
0020 #include <memory>
0021 
0022 using namespace Acts::UnitLiterals;
0023 
0024 /// Designate material on volume faces that is to be filled in by the material
0025 /// mapping. This is the Gen3 equivalent of setting "mapMaterial": true plus a
0026 /// bin count in the Gen1 JSON geometry map.
0027 void exampleDesignateProtoMaterial(Acts::BlueprintNode& parent) {
0028   //! [Designate Proto Material]
0029   parent.addMaterial("PixelMaterial", [&](auto& mat) {
0030     using enum Acts::AxisDirection;
0031     using enum Acts::CylinderVolumeBounds::Face;
0032     using Acts::AxisSpec;
0033 
0034     // Two proto axes per face: the mapping fills these bins in later. The axes
0035     // are deferred: only the bin count is fixed here, the range and boundary
0036     // type are taken from the portal surface during mapping.
0037     mat.configureFace(OuterCylinder,
0038                       AxisSpec::DeferredEquidistant(20, AxisRPhi),
0039                       AxisSpec::DeferredEquidistant(20, AxisZ));
0040     mat.configureFace(NegativeDisc, AxisSpec::DeferredEquidistant(15, AxisR),
0041                       AxisSpec::DeferredEquidistant(25, AxisPhi));
0042     mat.configureFace(PositiveDisc, AxisSpec::DeferredEquidistant(15, AxisR),
0043                       AxisSpec::DeferredEquidistant(25, AxisPhi));
0044 
0045     // The material node wraps exactly one child: the volume it applies to.
0046     mat.addCylinderContainer("Pixel", Acts::AxisDirection::AxisZ,
0047                              [&](auto& /*pixel*/) {
0048                                // ... build the pixel detector here
0049                              });
0050   });
0051   //! [Designate Proto Material]
0052 }
0053 
0054 /// Assign known material directly at construction. Nothing is mapped onto these
0055 /// faces: they already carry their final material.
0056 void exampleDesignateHomogeneousMaterial(Acts::BlueprintNode& parent) {
0057   //! [Designate Homogeneous Material]
0058   // Beryllium, 0.8 mm thick.
0059   auto beampipeMaterial =
0060       std::make_shared<const Acts::HomogeneousSurfaceMaterial>(
0061           Acts::MaterialSlab(Acts::Material::fromMassDensity(
0062                                  352.8_mm, 407_mm, 9.012, 4, 1.848_g / 1_cm3),
0063                              0.8_mm));
0064 
0065   parent.addMaterial("BeampipeMaterial", [&](auto& bpMat) {
0066     using enum Acts::CylinderVolumeBounds::Face;
0067 
0068     bpMat.configureFace(OuterCylinder, beampipeMaterial);
0069     bpMat.addStaticVolume(
0070         Acts::Transform3::Identity(),
0071         std::make_shared<Acts::CylinderVolumeBounds>(0_mm, 25_mm, 1000_mm),
0072         "Beampipe");
0073   });
0074   //! [Designate Homogeneous Material]
0075 }