Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 /// \file SteppingAction.cc 28 /// \brief Implementation of the SteppingActio 29 30 #include "SteppingAction.hh" 31 #include "DetectorConstruction.hh" 32 33 #include "G4Step.hh" 34 #include "G4Event.hh" 35 #include "G4RunManager.hh" 36 #include "G4LogicalVolume.hh" 37 #include <CLHEP/Units/SystemOfUnits.h> 38 39 #include "G4AnalysisManager.hh" 40 41 //....oooOO0OOooo........oooOO0OOooo........oo 42 43 void SteppingAction::UserSteppingAction(const 44 { 45 46 G4String volumeName = step->GetPreStepPoin 47 ->GetVolume()->Get 48 49 //if a particle enters the detector volume 50 if (step->GetPreStepPoint()-> GetStepStatu 51 volumeName=="Detector") 52 { 53 G4AnalysisManager* analysisManager = G 54 55 //e- spectrum 56 if(step->GetTrack()->GetDefinition()-> 57 { 58 //coordinate in the horizontal pla 59 G4double eElectron = step->GetPreS 60 61 //filling histogram 62 analysisManager->FillH1(0, eElectr 63 } 64 65 //e+ spectrum 66 if(step->GetTrack()->GetDefinition()-> 67 { 68 //coordinate in the horizontal pla 69 G4double ePositron = step->GetPreS 70 71 //filling histogram 72 analysisManager->FillH1(1, ePositr 73 } 74 75 //gamma spectrum 76 if(step->GetTrack()->GetDefinition()-> 77 { 78 //coordinate in the horizontal pla 79 G4double eGamma = step->GetPreStep 80 81 //filling histogram 82 analysisManager->FillH1(2, eGamma) 83 } 84 } 85 } 86 87 //....oooOO0OOooo........oooOO0OOooo........oo 88 89 //} 90