Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // This example is provided by the Geant4-DNA 26 // This example is provided by the Geant4-DNA collaboration 27 // Any report or published results obtained us << 27 // Any report or published results obtained using the Geant4-DNA software 28 // shall cite the following Geant4-DNA collabo 28 // shall cite the following Geant4-DNA collaboration publications: 29 // Med. Phys. 45 (2018) e722-e739 << 30 // Phys. Med. 31 (2015) 861-874 29 // Phys. Med. 31 (2015) 861-874 31 // Med. Phys. 37 (2010) 4692-4708 30 // Med. Phys. 37 (2010) 4692-4708 32 // Int. J. Model. Simul. Sci. Comput. 1 (2010) << 33 // << 34 // The Geant4-DNA web site is available at htt 31 // The Geant4-DNA web site is available at http://geant4-dna.org 35 // 32 // >> 33 // 36 /// \file medical/dna/slowing/src/SteppingActi 34 /// \file medical/dna/slowing/src/SteppingAction.cc 37 /// \brief Implementation of the SteppingActio 35 /// \brief Implementation of the SteppingAction class 38 36 >> 37 #include "Analysis.hh" 39 #include "SteppingAction.hh" 38 #include "SteppingAction.hh" 40 << 41 #include "EventAction.hh" 39 #include "EventAction.hh" 42 40 43 #include "G4AnalysisManager.hh" << 41 #include "G4SystemOfUnits.hh" 44 #include "G4Electron.hh" 42 #include "G4Electron.hh" 45 #include "G4EventManager.hh" 43 #include "G4EventManager.hh" 46 #include "G4SystemOfUnits.hh" << 47 44 48 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 49 46 50 SteppingAction::SteppingAction(EventAction* ev << 47 SteppingAction::SteppingAction(EventAction* event): G4UserSteppingAction() >> 48 ,fEventAction(event) >> 49 {} 51 50 52 //....oooOO0OOooo........oooOO0OOooo........oo 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 53 52 54 SteppingAction::~SteppingAction() {} << 53 SteppingAction::~SteppingAction() >> 54 {} 55 55 56 //....oooOO0OOooo........oooOO0OOooo........oo 56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 57 57 58 void SteppingAction::UserSteppingAction(const 58 void SteppingAction::UserSteppingAction(const G4Step* step) 59 { << 59 { 60 G4double edep = step->GetTotalEnergyDeposit( << 61 60 62 // Total energy deposit << 61 G4double edep = step->GetTotalEnergyDeposit(); 63 fEventAction->AddEdep(edep); << 62 64 << 63 //total energy deposit 65 if (step->GetTrack()->GetDynamicParticle()-> << 64 fEventAction->AddEdep(edep); 66 const G4String& processName = << 65 67 step->GetPostStepPoint()->GetProcessDefi << 66 if (step->GetTrack()->GetDynamicParticle()->GetDefinition() 68 << 67 == G4Electron::ElectronDefinition()) 69 if (processName != "Transportation") { << 68 { 70 // Get analysis manager << 69 const G4String& processName = step->GetPostStepPoint()-> >> 70 GetProcessDefinedStep()->GetProcessName(); >> 71 >> 72 if (processName!="Transportation") >> 73 { >> 74 // get analysis manager 71 G4AnalysisManager* analysisManager = G4A 75 G4AnalysisManager* analysisManager = G4AnalysisManager::Instance(); 72 76 73 // Fill histograms << 77 // fill histo 74 << 78 75 // 1) ALL e- 79 // 1) ALL e- 76 // << 77 // analysisManager 80 // analysisManager 78 // ->FillH1(1, << 81 // ->FillH1(1, 79 // step->GetTrack()->GetKineticEnergy()/ 82 // step->GetTrack()->GetKineticEnergy()/eV,step->GetStepLength()/nm); 80 analysisManager->FillH1(1, step->GetPreS << 83 analysisManager->FillH1(1, 81 step->GetStepLen << 84 step->GetPreStepPoint()->GetKineticEnergy()/eV, >> 85 step->GetStepLength()/nm); 82 86 83 // 2) PARENT e- 87 // 2) PARENT e- 84 // << 88 if (step->GetTrack()->GetParentID()==0 85 if (step->GetTrack()->GetParentID() == 0 << 89 && step->GetTrack()->GetTrackID()==1) 86 // analysisManager->FillH1(2, step->Ge << 90 // analysisManager->FillH1(2, step->GetTrack()->GetKineticEnergy()/eV, 87 // step->GetStepLength()/nm); << 91 // step->GetStepLength()/nm); 88 analysisManager->FillH1(2, step->GetPr << 92 analysisManager->FillH1(2, 89 step->GetStepL << 93 step->GetPreStepPoint()->GetKineticEnergy()/eV, 90 << 94 step->GetStepLength()/nm); >> 95 91 // 3) SECONDARY e- 96 // 3) SECONDARY e- 92 // << 97 if ( !(step->GetTrack()->GetParentID()==0) 93 if (!(step->GetTrack()->GetParentID() == << 98 || !(step->GetTrack()->GetTrackID()==1) ) 94 // analysisManager->FillH1(3, step->Ge << 99 // analysisManager->FillH1(3, step->GetTrack()->GetKineticEnergy()/eV, 95 // step->GetStepLength()/nm); << 100 // step->GetStepLength()/nm); 96 analysisManager->FillH1(3, step->GetPr << 101 analysisManager->FillH1(3, 97 step->GetStepL << 102 step->GetPreStepPoint()->GetKineticEnergy()/eV, 98 } << 103 step->GetStepLength()/nm); 99 } << 104 100 } << 105 } >> 106 >> 107 } >> 108 } >> 109 >> 110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 101 111