File indexing completed on 2025-09-17 08:53:37
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <memory>
0010 #include <vector>
0011
0012 #include "celeritas/Types.hh"
0013 #include "celeritas/Units.hh"
0014
0015 #include "TouchableUpdaterInterface.hh"
0016
0017 class G4Navigator;
0018 class G4LogicalVolume;
0019 class G4VPhysicalVolume;
0020
0021 namespace celeritas
0022 {
0023 namespace detail
0024 {
0025
0026
0027
0028
0029
0030
0031 class NaviTouchableUpdater final : public TouchableUpdaterInterface
0032 {
0033 public:
0034
0035
0036 using SPConstVecLV
0037 = std::shared_ptr<std::vector<G4LogicalVolume const*> const>;
0038
0039
0040 public:
0041
0042 static constexpr double max_step() { return 1.0 * units::millimeter; }
0043
0044
0045 static constexpr double max_quiet_step()
0046 {
0047 return 1e-3 * units::millimeter;
0048 }
0049
0050
0051 explicit NaviTouchableUpdater(SPConstVecLV detector_volumes);
0052
0053
0054 NaviTouchableUpdater(SPConstVecLV detector_volumes,
0055 G4VPhysicalVolume const* world);
0056
0057
0058 ~NaviTouchableUpdater() final;
0059
0060
0061 bool operator()(DetectorStepOutput const& out,
0062 size_type step_index,
0063 StepPoint step_point,
0064 GeantTouchableBase* touchable) final;
0065
0066
0067 bool operator()(Real3 const& pos,
0068 Real3 const& dir,
0069 G4LogicalVolume const* lv,
0070 GeantTouchableBase* touchable);
0071
0072 private:
0073 std::unique_ptr<G4Navigator> navi_;
0074 SPConstVecLV detector_volumes_;
0075 };
0076
0077
0078 }
0079 }