Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 07:50: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 #pragma once
0010 
0011 #include "Acts/Geometry/GeometryContext.hpp"
0012 
0013 #include <memory>
0014 #include <vector>
0015 
0016 namespace Acts {
0017 class GeometryContext;
0018 class TrackingGeometry;
0019 class DetectorElementBase;
0020 class Logger;
0021 namespace Experimental {
0022 class Detector;
0023 }  // namespace Experimental
0024 }  // namespace Acts
0025 
0026 namespace ActsExamples {
0027 class IContextDecorator;
0028 struct Geant4ConstructionOptions;
0029 }  // namespace ActsExamples
0030 
0031 class G4VUserDetectorConstruction;
0032 
0033 namespace ActsExamples {
0034 
0035 ///  @brief Baseline class to represent a complete experimental setup. The Detector
0036 ///         is constructed by an external geometry plugin (e.g. DD4Hep,
0037 ///         GeoModel) and holds the tracking geometry representation & the full
0038 ///         Geant4 geometry description.
0039 class Detector {
0040  public:
0041   /// @brief Standard constructor taking a logger object
0042   explicit Detector(std::unique_ptr<const Acts::Logger> logger);
0043   virtual ~Detector();
0044   /// @brief Returns the reference to the empty unaligned geometry context
0045   virtual const Acts::GeometryContext& nominalGeometryContext() const;
0046   /// @brief Returns the valid pointer to the tracking geometry.
0047   ///        Throws an exception if the pointer is invalid
0048   virtual std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry()
0049       const;
0050   /// @brief Returns the valid pointer to the Gen-2 tracking geometry.
0051   ///        Throws an exception if the pointer is invalid
0052   virtual std::shared_ptr<Acts::Experimental::Detector> gen2Geometry() const;
0053   virtual std::vector<std::shared_ptr<IContextDecorator>> contextDecorators()
0054       const;
0055 
0056   /// Build the Geant4 detector construction
0057   /// @note This throws an exception if Geant4 is not enabled
0058   /// @param options The Geant4 construction options
0059   /// @return The Geant4 detector construction
0060   virtual std::unique_ptr<G4VUserDetectorConstruction>
0061   buildGeant4DetectorConstruction(
0062       const Geant4ConstructionOptions& options) const;
0063 
0064  protected:
0065   const Acts::Logger& logger() const;
0066 
0067   std::unique_ptr<const Acts::Logger> m_logger;
0068 
0069   Acts::GeometryContext m_nominalGeometryContext;
0070   std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
0071   std::shared_ptr<Acts::Experimental::Detector> m_gen2Geometry;
0072   std::vector<std::shared_ptr<const Acts::DetectorElementBase>> m_detectorStore;
0073   std::vector<std::shared_ptr<IContextDecorator>> m_contextDecorators;
0074 };
0075 
0076 }  // namespace ActsExamples