File indexing completed on 2025-01-18 09:11:35
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/Geant4/EventStore.hpp"
0013
0014 #include <memory>
0015 #include <string>
0016 #include <vector>
0017
0018 #include <G4UserSteppingAction.hh>
0019
0020 class G4Step;
0021
0022 namespace ActsExamples::Geant4 {
0023
0024
0025
0026
0027
0028
0029
0030
0031 class MaterialSteppingAction final : public G4UserSteppingAction {
0032 public:
0033
0034 struct Config {
0035 std::shared_ptr<EventStore> eventStore;
0036
0037 std::vector<std::string> excludeMaterials = {};
0038 };
0039
0040
0041
0042
0043
0044 MaterialSteppingAction(const Config& cfg,
0045 std::unique_ptr<const Acts::Logger> logger =
0046 Acts::getDefaultLogger("SimParticleTranslation",
0047 Acts::Logging::INFO));
0048 ~MaterialSteppingAction() override;
0049
0050
0051
0052
0053 void UserSteppingAction(const G4Step* step) override;
0054
0055 private:
0056
0057 Config m_cfg;
0058
0059
0060 const Acts::Logger& logger() const { return *m_logger; }
0061
0062
0063 EventStore& eventStore() const { return *m_cfg.eventStore; }
0064
0065
0066 std::unique_ptr<const Acts::Logger> m_logger;
0067 };
0068
0069 }