geant events for multiple scattering

This commit is contained in:
AndreaRigoni
2026-03-14 23:33:31 +00:00
parent 692cdf7ae3
commit c63a1ae047
18 changed files with 681 additions and 90 deletions

View File

@@ -0,0 +1,30 @@
#ifndef U_GEANT_STEPPINGACTION_HH
#define U_GEANT_STEPPINGACTION_HH
#include "G4UserSteppingAction.hh"
#include "Core/Vector.h"
#include "GeantEvent.h"
namespace uLib {
namespace Geant {
/// SteppingAction collects scattering data at each Geant4 step and
/// builds GeantEvent objects in the output buffer.
class SteppingAction : public G4UserSteppingAction {
public:
/// @param output pointer to the results vector owned by the Scene
SteppingAction(Vector<GeantEvent> *output);
virtual ~SteppingAction();
virtual void UserSteppingAction(const G4Step *step) override;
private:
Vector<GeantEvent> *m_Output; ///< destination for finished events
GeantEvent m_Current; ///< event being built
int m_LastEventID; ///< track event transitions
};
} // namespace Geant
} // namespace uLib
#endif