G4OCCT 0.1.0
Geant4 interface to Open CASCADE Technology (OCCT) geometry definitions
Loading...
Searching...
No Matches
G4OCCTEventAction.hh
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2// Copyright (C) 2026 G4OCCT Contributors
3
6
7#ifndef G4OCCT_APP_G4OCCTEventAction_hh
8#define G4OCCT_APP_G4OCCTEventAction_hh
9
10#include <G4Types.hh>
11#include <G4UserEventAction.hh>
12
13class G4OCCTRunAction;
14
22class G4OCCTEventAction : public G4UserEventAction {
23public:
24 explicit G4OCCTEventAction(const G4OCCTRunAction* runAction);
25 ~G4OCCTEventAction() override = default;
26
27 void BeginOfEventAction(const G4Event* event) override;
28 void EndOfEventAction(const G4Event* event) override;
29
31 G4int GetEventId() const { return fEventId; }
32
34 void AddStep(G4double edep, G4double stepLength);
36 void AddTrack();
38 void IncrementPrimaries();
39
40private:
41 const G4OCCTRunAction* fRunAction;
42
43 G4int fEventId = -1;
44 G4double fTotalEdep = 0.0;
45 G4double fTotalLength = 0.0;
46 G4int fNTracks = 0;
47 G4int fNSteps = 0;
48 G4int fNPrimaries = 0;
49};
50
51#endif // G4OCCT_APP_G4OCCTEventAction_hh
Event action that accumulates per-event quantities.
void EndOfEventAction(const G4Event *event) override
G4int GetEventId() const
Returns the current event ID; cached in BeginOfEventAction.
void IncrementPrimaries()
Called from G4OCCTTrackingAction for primary tracks.
void AddTrack()
Called from G4OCCTTrackingAction at the end of each track.
void BeginOfEventAction(const G4Event *event) override
~G4OCCTEventAction() override=default
void AddStep(G4double edep, G4double stepLength)
Called from G4OCCTSteppingAction for each step.
Run action that opens and closes a G4AnalysisManager CSV output file.