Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:17:10

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file orange/g4org/Volume.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include <memory>
0011 #include <vector>
0012 
0013 #include "orange/OrangeTypes.hh"
0014 #include "orange/transform/VariantTransform.hh"
0015 
0016 class G4LogicalVolume;
0017 
0018 namespace celeritas
0019 {
0020 namespace orangeinp
0021 {
0022 class ObjectInterface;
0023 }
0024 
0025 namespace g4org
0026 {
0027 //---------------------------------------------------------------------------//
0028 struct LogicalVolume;
0029 
0030 //---------------------------------------------------------------------------//
0031 /*!
0032  * An unconstructed ORANGE CSG Object with a transform.
0033  *
0034  * This holds equivalent information to a Geant4 \c G4VPhysicalVolume, but with
0035  * \em only ORANGE data structures.
0036  */
0037 struct PhysicalVolume
0038 {
0039     std::string name;
0040     size_type copy_number{};
0041     VariantTransform transform;
0042     std::shared_ptr<LogicalVolume const> lv;
0043 };
0044 
0045 //---------------------------------------------------------------------------//
0046 /*!
0047  * A reusable Object that can be turned into a UnitProto or a Material.
0048  *
0049  * This holds equivalent information to a Geant4 \c G4LogicalVolume, but with
0050  * \em only ORANGE data structures plus a reference to the original G4LV.
0051  */
0052 struct LogicalVolume
0053 {
0054     using SPConstObject = std::shared_ptr<orangeinp::ObjectInterface const>;
0055 
0056     //! Associated Geant4 logical volume
0057     G4LogicalVolume const* g4lv{nullptr};
0058 
0059     //! Logical volume name
0060     std::string name;
0061     //! Filled material ID
0062     GeoMaterialId material_id;
0063 
0064     //! "Unplaced" parent shape
0065     SPConstObject solid;
0066     //! Embedded child volumes
0067     std::vector<PhysicalVolume> children;
0068 };
0069 
0070 //---------------------------------------------------------------------------//
0071 }  // namespace g4org
0072 }  // namespace celeritas