File indexing completed on 2026-09-09 08:29:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 #include "SteppingAction.hh"
0044
0045 #include "PrimaryGeneratorAction.hh"
0046 #include "Run.hh"
0047 #include "RunAction.hh"
0048
0049 #include "G4AnalysisManager.hh"
0050 #include "G4LogicalVolume.hh"
0051 #include "G4LogicalVolumeStore.hh"
0052 #include "G4PhysicalVolumeStore.hh"
0053 #include "G4RunManager.hh"
0054 #include "G4SteppingManager.hh"
0055 #include "G4SystemOfUnits.hh"
0056 #include "G4VPhysicalVolume.hh"
0057 #include "G4VTouchable.hh"
0058 #include "G4ios.hh"
0059
0060
0061
0062 SteppingAction::SteppingAction(RunAction* run) : G4UserSteppingAction(), fRunAction(run) {}
0063
0064
0065
0066 void SteppingAction::UserSteppingAction(const G4Step* step)
0067 {
0068 if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() != "Transportation") {
0069 G4double edepStep = step->GetTotalEnergyDeposit();
0070 G4VPhysicalVolume* volumeStep = step->GetPreStepPoint()->GetPhysicalVolume();
0071 G4TouchableHandle touchStep = step->GetPreStepPoint()->GetTouchableHandle();
0072 G4VPhysicalVolume* volumeMedium = G4PhysicalVolumeStore::GetInstance()->GetVolume("Medium");
0073 G4VPhysicalVolume* volumeSlice =
0074 G4PhysicalVolumeStore::GetInstance()->GetVolume("BoundingSlice");
0075
0076
0077
0078 const G4StepPoint* endPoint = step->GetPostStepPoint();
0079 const G4VProcess* process = endPoint->GetProcessDefinedStep();
0080 Run* run = static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
0081 run->CountProcesses(process);
0082
0083
0084 if (edepStep > 0.) {
0085 fRunAction->AddEdepALL(edepStep);
0086
0087
0088 if (volumeStep == volumeSlice) {
0089 fRunAction->AddEdepSlice(edepStep);
0090 }
0091
0092
0093 if (volumeStep->GetName() == "Soma") {
0094 fRunAction->AddEdepSoma(edepStep);
0095 run->AddSomaCompart(touchStep->GetCopyNumber(), edepStep);
0096 }
0097
0098
0099 if (volumeStep->GetName() == "Dendrites") {
0100 fRunAction->AddEdepDend(edepStep);
0101 run->AddDendCompart(touchStep->GetCopyNumber(), edepStep);
0102 }
0103
0104
0105 if (volumeStep->GetName() == "Axon") {
0106 fRunAction->AddEdepAxon(edepStep);
0107 run->AddAxonCompart(touchStep->GetCopyNumber(), edepStep);
0108 }
0109
0110
0111 if (volumeStep != volumeMedium && volumeStep != volumeSlice) {
0112 fRunAction->AddEdepNeuron(edepStep);
0113 }
0114
0115
0116 if (volumeStep == volumeMedium) {
0117 fRunAction->AddEdepMedium(edepStep);
0118 }
0119 }
0120 }
0121 }