File indexing completed on 2025-01-31 09:22:10
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 #include "G4ios.hh"
0031 #include "G4SteppingManager.hh"
0032 #include "G4Step.hh"
0033 #include "G4Track.hh"
0034 #include "G4StepPoint.hh"
0035 #include "G4VPhysicalVolume.hh"
0036 #include "SteppingAction.hh"
0037 #include "AnalysisManager.hh"
0038 #include "G4SystemOfUnits.hh"
0039
0040 SteppingAction::SteppingAction(AnalysisManager* pAnalysis)
0041 {
0042 analysis = pAnalysis;
0043 fSecondary = 0;
0044 }
0045
0046 SteppingAction::~SteppingAction()
0047 {
0048 }
0049
0050 void SteppingAction::UserSteppingAction(const G4Step* aStep)
0051 {
0052 G4SteppingManager* steppingManager = fpSteppingManager;
0053 G4Track* theTrack = aStep -> GetTrack();
0054
0055
0056 if(theTrack-> GetTrackStatus() == fAlive) { return; }
0057
0058
0059 fSecondary = steppingManager -> GetfSecondary();
0060
0061
0062
0063 #ifdef ANALYSIS_USE
0064 for(size_t lp1=0;lp1<(*fSecondary).size(); lp1++)
0065 {
0066
0067 G4String volumeName = (*fSecondary)[lp1] -> GetVolume() -> GetName();
0068 G4String secondaryParticleName = (*fSecondary)[lp1]->GetDefinition() -> GetParticleName();
0069 G4double secondaryParticleKineticEnergy = (*fSecondary)[lp1] -> GetKineticEnergy();
0070
0071 G4double charge = (*fSecondary)[lp1] -> GetDynamicParticle() -> GetDefinition() -> GetPDGCharge();
0072 G4int AA = (*fSecondary)[lp1] -> GetDynamicParticle() -> GetDefinition() -> GetBaryonNumber();
0073
0074 if (G4StrUtil::contains(volumeName, "SV_phys") || volumeName == "sen_bridge" || volumeName == "physSensitiveBridgeVolume")
0075
0076
0077 {
0078
0079 if ((secondaryParticleName == "proton") ||
0080 (secondaryParticleName == "neutron")||
0081 (secondaryParticleName == "alpha") ||
0082 (secondaryParticleName == "deuton") ||
0083 (secondaryParticleName == "triton") ||
0084 (secondaryParticleName == "He3") ||
0085 (secondaryParticleName =="GenericIon"))
0086 analysis -> FillSecondaries(AA, charge, secondaryParticleKineticEnergy/MeV);
0087 }
0088 }
0089 #endif
0090 }
0091