Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-11 09:40:22

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/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/DetectorElementBase.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Surfaces/Surface.hpp"
0015 
0016 #include <memory>
0017 
0018 class G4VPhysicalVolume;
0019 
0020 namespace Acts {
0021 
0022 class ISurfaceMaterial;
0023 class Surface;
0024 
0025 }  // namespace Acts
0026 
0027 namespace ActsPlugins {
0028 /// @class Geant4DetectorElement
0029 ///
0030 /// Detector element representative for Geant4 sensitive
0031 /// elements.
0032 class Geant4DetectorElement : public Acts::DetectorElementBase {
0033  public:
0034   /// Broadcast the context type
0035   using ContextType = Acts::GeometryContext;
0036 
0037   /// @brief  Constructor with arguments
0038   /// @param surface the surface representing this detector element
0039   /// @param g4physVol the physical volume representing this detector element
0040   /// @param toGlobal the global transformation before the volume
0041   /// @param thickness the thickness of this detector element
0042   Geant4DetectorElement(std::shared_ptr<Acts::Surface> surface,
0043                         const G4VPhysicalVolume& g4physVol,
0044                         const Acts::Transform3& toGlobal, double thickness);
0045 
0046   /// Return local to global transform associated with this detector element
0047   ///
0048   /// @param gctx The current geometry context object, e.g. alignment
0049   const Acts::Transform3& transform(
0050       const Acts::GeometryContext& gctx) const override;
0051   /// @return Reference to the local-to-global transformation matrix
0052 
0053   /// Return surface associated with this detector element
0054   const Acts::Surface& surface() const override;
0055   /// @return Const reference to the associated surface
0056 
0057   /// Non-const access to surface associated with this detector element
0058   Acts::Surface& surface() override;
0059   /// @return Mutable reference to the associated surface
0060 
0061   /// Return the thickness of this detector element
0062   /// @return The thickness value in length units
0063   double thickness() const override;
0064 
0065   /// @return to the Geant4 physical volume
0066   const G4VPhysicalVolume& g4PhysicalVolume() const;
0067 
0068  private:
0069   /// Corresponding Surface
0070   std::shared_ptr<Acts::Surface> m_surface;
0071   /// The GEant4 physical volume
0072   const G4VPhysicalVolume* m_g4physVol{nullptr};
0073   /// The global transformation before the volume
0074   Acts::Transform3 m_toGlobal;
0075   ///  Thickness of this detector element
0076   double m_thickness{0.};
0077 };
0078 
0079 }  // namespace ActsPlugins