31#include "DetectorConstruction.hh"
32#include "EventAction.hh"
34#include <G4LogicalVolume.hh>
35#include <G4RunManager.hh>
37#include <G4TouchableHandle.hh>
38#include <G4VPhysicalVolume.hh>
44 if (fScoringVolume ==
nullptr) {
46 G4RunManager::GetRunManager()->GetUserDetectorConstruction());
47 if (detectorConstruction !=
nullptr) {
48 fScoringVolume = detectorConstruction->GetScoringVolume();
53 G4VPhysicalVolume* pv = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
58 G4LogicalVolume* volume = pv->GetLogicalVolume();
59 if (volume != fScoringVolume) {
63 fEventAction->
AddEdep(step->GetTotalEnergyDeposit());
Stepping action for the G4OCCT B1 example.
Detector construction class to define materials and geometry.
Collects total energy deposited in shape2 per event.
void AddEdep(G4double edep)
Accumulate edep for the current event.
SteppingAction(EventAction *eventAction)
void UserSteppingAction(const G4Step *step) override