38 lines
1020 B
C++
38 lines
1020 B
C++
#ifndef U_GEANT_STEPPINGACTION_HH
|
|
#define U_GEANT_STEPPINGACTION_HH
|
|
|
|
#include "G4UserSteppingAction.hh"
|
|
#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.
|
|
class SteppingAction : public G4UserSteppingAction, public G4UserEventAction {
|
|
public:
|
|
SteppingAction(SimulationContext *context);
|
|
virtual ~SteppingAction();
|
|
|
|
virtual void UserSteppingAction(const G4Step *step) override;
|
|
virtual void BeginOfEventAction(const G4Event *event) override;
|
|
virtual void EndOfEventAction(const G4Event *event) override;
|
|
|
|
void SetVerbosity(int level) { m_Verbosity = level; }
|
|
|
|
private:
|
|
SimulationContext *m_Context;
|
|
GeantEvent m_CurrentGeant;
|
|
MuonEvent m_CurrentMuon;
|
|
int m_MuonCrossCount = 0;
|
|
int m_Verbosity = 0;
|
|
};
|
|
|
|
} // namespace Geant
|
|
} // namespace uLib
|
|
|
|
#endif
|