File indexing completed on 2026-01-09 10:20:17
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <memory>
0010 #include <unordered_map>
0011
0012 #include "orange/orangeinp/ObjectInterface.hh"
0013 #include "orange/orangeinp/UnitProto.hh"
0014
0015 #include "Volume.hh"
0016
0017 namespace celeritas
0018 {
0019 class GeantGeoParams;
0020 namespace g4org
0021 {
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 class ProtoConstructor
0034 {
0035 public:
0036
0037
0038 using SPConstObject = std::shared_ptr<orangeinp::ObjectInterface const>;
0039 using ObjLv = std::pair<SPConstObject, LogicalVolume const*>;
0040 using SPUnitProto = std::shared_ptr<orangeinp::UnitProto>;
0041 using ProtoInput = orangeinp::UnitProto::Input;
0042
0043
0044 public:
0045
0046 ProtoConstructor(GeantGeoParams const& geo, bool verbose)
0047 : geo_{geo}, verbose_{verbose}
0048 {
0049 }
0050
0051
0052 SPUnitProto operator()(LogicalVolume const& lv);
0053
0054 private:
0055 GeantGeoParams const& geo_;
0056 std::unordered_map<LogicalVolume const*, SPUnitProto> protos_;
0057 int depth_{0};
0058 bool verbose_{false};
0059
0060 Label const& get_label(LogicalVolume const& lv);
0061 Label const& get_label(PhysicalVolume const& lv);
0062
0063
0064 void place_pv(VariantTransform const& parent_transform,
0065 PhysicalVolume const& pv,
0066 ProtoInput* proto);
0067
0068 SPConstObject make_explicit_background(LogicalVolume const& lv,
0069 VariantTransform const& transform);
0070
0071
0072
0073 static constexpr int fill_daughter_threshold() { return 2; }
0074 };
0075
0076
0077 }
0078 }