File indexing completed on 2026-10-29 08:22:21
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 #include "ActsPlugins/Geant4/Geant4MaterialStepConverter.hpp"
0014
0015 #include <memory>
0016 #include <string>
0017 #include <vector>
0018
0019 #include <G4UserSteppingAction.hh>
0020
0021 class G4Step;
0022
0023 namespace ActsExamples::Geant4 {
0024
0025
0026
0027
0028
0029
0030
0031
0032 class MaterialSteppingAction final : public G4UserSteppingAction {
0033 public:
0034
0035 struct Config {
0036 std::shared_ptr<EventStore> eventStore;
0037
0038 std::vector<std::string> excludeMaterials = {};
0039 bool recordElementFractions = false;
0040 };
0041
0042
0043
0044
0045
0046 explicit MaterialSteppingAction(
0047 const Config& cfg,
0048 std::unique_ptr<const Acts::Logger> logger = Acts::getDefaultLogger(
0049 "SimParticleTranslation", Acts::Logging::INFO));
0050
0051
0052
0053
0054 void UserSteppingAction(const G4Step* stepPtr) override;
0055
0056 private:
0057
0058 Config m_cfg;
0059
0060
0061 ActsPlugins::Geant4MaterialStepConverter m_stepConverter;
0062
0063
0064 const Acts::Logger& logger() const { return *m_logger; }
0065
0066
0067 EventStore& eventStore() const { return *m_cfg.eventStore; }
0068
0069
0070 std::unique_ptr<const Acts::Logger> m_logger;
0071 };
0072
0073 }