Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:47:28

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/Geometry/Blueprint.hpp"
0010 #include "Acts/Geometry/CuboidVolumeBounds.hpp"
0011 #include "Acts/Geometry/GeometryContext.hpp"
0012 #include "Acts/Geometry/GeometryModuleHelper.hpp"
0013 #include "Acts/Geometry/StaticBlueprintNode.hpp"
0014 #include "Acts/Geometry/TrackingGeometry.hpp"
0015 #include "Acts/Geometry/TrackingVolume.hpp"
0016 
0017 #include <memory>
0018 #include <stdexcept>
0019 
0020 namespace {
0021 
0022 std::unique_ptr<Acts::TrackingGeometry> buildGeometryModule(
0023     const Acts::Logger& logger) {
0024   using namespace Acts;
0025 
0026   ACTS_INFO("Building geometry module");
0027 
0028   const auto gctx = GeometryContext::dangerouslyDefaultConstruct();
0029 
0030   Experimental::Blueprint::Config cfg;
0031   cfg.envelope = ExtentEnvelope{{
0032       .x = {10., 10.},
0033       .y = {10., 10.},
0034       .z = {10., 10.},
0035   }};
0036 
0037   Experimental::Blueprint root{cfg};
0038 
0039   auto outerBounds = std::make_shared<CuboidVolumeBounds>(1000., 1000., 1000.);
0040   auto outerVol = std::make_unique<TrackingVolume>(Transform3::Identity(),
0041                                                    outerBounds, "Outer");
0042   auto outerNode =
0043       std::make_shared<Experimental::StaticBlueprintNode>(std::move(outerVol));
0044   root.addChild(outerNode);
0045 
0046   auto trackingGeometry = root.construct({}, gctx, *logger.clone("Geometry"));
0047   if (trackingGeometry == nullptr) {
0048     throw std::runtime_error(
0049         "Failed to build Gen3 tracking geometry in downstream module");
0050   }
0051 
0052   return trackingGeometry;
0053 }
0054 
0055 }  // namespace
0056 
0057 ACTS_DEFINE_GEOMETRY_MODULE(buildGeometryModule)