#include "SteppingAction.hh" #include "EventAction.hh" #include "G4SteppingManager.hh" #include "G4RunManager.hh" #include "Analysis.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... SteppingAction::SteppingAction(EventAction* EvAct) :G4UserSteppingAction(),fEventAction(EvAct) { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... SteppingAction::~SteppingAction() { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void SteppingAction::UserSteppingAction(const G4Step* aStep) { G4double EdepStep = aStep->GetTotalEnergyDeposit(); G4String postName; if (aStep->GetPostStepPoint()->GetStepStatus() == fWorldBoundary) postName="out"; else postName = aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume()->GetName(); G4String volume =aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetName(); auto parentid = aStep->GetTrack()->GetParentID(); auto particleName = aStep->GetTrack()->GetDefinition()->GetParticleName(); // auto EdepStep1 = aStep->GetPreStepPoint()->GetProcessDefinedStep(); //auto pka1 = aStep->GetPreStepPoint(); auto pka2 = aStep->GetPostStepPoint(); //auto pre = pka1->GetKineticEnergy(); auto post = pka2->GetKineticEnergy(); if (volume=="detector"&&particleName=="neutron") { // fEventAction->AddEdep(EdepStep); // &&parentid!=0 //std::fstream dataEfile; // dataEfile.open("energy.txt",std::ios::app|std::ios::out); // dataEfile<FillH1(2, post); fEventAction->AddEdep(EdepStep); } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......