File indexing completed on 2025-02-23 09:22:04
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 #include "SteppingAction.hh"
0043
0044 #include "PrimaryGeneratorAction.hh"
0045 #include "Run.hh"
0046 #include "RunAction.hh"
0047
0048 #include "G4AnalysisManager.hh"
0049 #include "G4LogicalVolume.hh"
0050 #include "G4LogicalVolumeStore.hh"
0051 #include "G4PhysicalVolumeStore.hh"
0052 #include "G4RunManager.hh"
0053 #include "G4SteppingManager.hh"
0054 #include "G4SystemOfUnits.hh"
0055 #include "G4VPhysicalVolume.hh"
0056 #include "G4VTouchable.hh"
0057 #include "G4ios.hh"
0058
0059
0060
0061 SteppingAction::SteppingAction(RunAction* run) : G4UserSteppingAction(), fRunAction(run) {}
0062
0063
0064
0065 void SteppingAction::UserSteppingAction(const G4Step* step)
0066 {
0067 if (step->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() != "Transportation") {
0068 G4double edepStep = step->GetTotalEnergyDeposit();
0069 G4VPhysicalVolume* volumeStep = step->GetPreStepPoint()->GetPhysicalVolume();
0070 G4TouchableHandle touchStep = step->GetPreStepPoint()->GetTouchableHandle();
0071 G4VPhysicalVolume* volumeMedium = G4PhysicalVolumeStore::GetInstance()->GetVolume("Medium");
0072 G4VPhysicalVolume* volumeSlice =
0073 G4PhysicalVolumeStore::GetInstance()->GetVolume("BoundingSlice");
0074
0075
0076
0077 const G4StepPoint* endPoint = step->GetPostStepPoint();
0078 const G4VProcess* process = endPoint->GetProcessDefinedStep();
0079 Run* run = static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
0080 run->CountProcesses(process);
0081
0082
0083 if (edepStep > 0.) {
0084 fRunAction->AddEdepALL(edepStep);
0085
0086
0087 if (volumeStep == volumeSlice) {
0088 fRunAction->AddEdepSlice(edepStep);
0089 }
0090
0091
0092 if (volumeStep->GetName() == "Soma") {
0093 fRunAction->AddEdepSoma(edepStep);
0094 run->AddSomaCompart(touchStep->GetCopyNumber(), edepStep);
0095 }
0096
0097
0098 if (volumeStep->GetName() == "Dendrites") {
0099 fRunAction->AddEdepDend(edepStep);
0100 run->AddDendCompart(touchStep->GetCopyNumber(), edepStep);
0101 }
0102
0103
0104 if (volumeStep->GetName() == "Axon") {
0105 fRunAction->AddEdepAxon(edepStep);
0106 run->AddAxonCompart(touchStep->GetCopyNumber(), edepStep);
0107 }
0108
0109
0110 if (volumeStep != volumeMedium && volumeStep != volumeSlice) {
0111 fRunAction->AddEdepNeuron(edepStep);
0112 }
0113
0114
0115 if (volumeStep == volumeMedium) {
0116 fRunAction->AddEdepMedium(edepStep);
0117 }
0118 }
0119 }
0120 }