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

@@ -0,0 +1,36 @@
#ifndef U_GEANT_DETECTORSTEPPINGACTION_HH
#define U_GEANT_DETECTORSTEPPINGACTION_HH
#include "G4UserSteppingAction.hh"
#include "G4UserEventAction.hh"
#include "Core/Vector.h"
#include "HEP/Detectors/MuonEvent.h"
#include "HEP/Detectors/DetectorChamber.h"
#include <mutex>
namespace uLib {
namespace Geant {
class DetectorSteppingAction : public G4UserSteppingAction, public G4UserEventAction {
public:
DetectorSteppingAction(Vector<MuonEvent> *output, const Vector<HLine3f> &planes);
virtual ~DetectorSteppingAction();
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:
Vector<MuonEvent> *m_Output;
Vector<HLine3f> m_Planes; // World projection planes
MuonEvent m_Current;
int m_CrossCount = 0;
int m_Verbosity = 0;
};
} // namespace Geant
} // namespace uLib
#endif