add detector simulation

This commit is contained in:
AndreaRigoni
2026-03-20 00:16:55 +00:00
parent c44a7738c0
commit 033fb598c7
17 changed files with 441 additions and 211 deletions

View File

@@ -5,16 +5,16 @@
#include "G4UserEventAction.hh"
#include "Core/Vector.h"
#include "GeantEvent.h"
#include "HEP/Detectors/MuonEvent.h"
#include "SimulationContext.h"
namespace uLib {
namespace Geant {
/// SteppingAction collects scattering data at each Geant4 step and
/// builds GeantEvent objects in the output buffer.
/// SteppingAction collects scattering data at each Geant4 step.
class SteppingAction : public G4UserSteppingAction, public G4UserEventAction {
public:
/// @param output pointer to the results vector owned by the Scene
SteppingAction(Vector<GeantEvent> *output);
SteppingAction(SimulationContext *context);
virtual ~SteppingAction();
virtual void UserSteppingAction(const G4Step *step) override;
@@ -24,10 +24,11 @@ public:
void SetVerbosity(int level) { m_Verbosity = level; }
private:
Vector<GeantEvent> *m_Output; ///< destination for finished events
GeantEvent m_Current; ///< event being built
int m_LastEventID; ///< track event transitions
int m_Verbosity = 0;
SimulationContext *m_Context;
GeantEvent m_CurrentGeant;
MuonEvent m_CurrentMuon;
int m_MuonCrossCount = 0;
int m_Verbosity = 0;
};
} // namespace Geant