6 #include "G4GPILSelection.hh"
7 #include "G4ProcessManager.hh"
8 #include "G4ProcessVector.hh"
10 #include "G4VParticleChange.hh"
11 #include "G4VProcess.hh"
13 using namespace CLHEP;
16 : particleChange(nullptr), pmanager(nullptr), fProcessVector(nullptr), fProcess(nullptr) {
51 G4TrackVector *fSecondary = (const_cast<G4Step *>(&
step))->GetfSecondary();
52 G4int nSecondarySave = fSecondary->size();
55 G4Track *tempSecondaryTrack;
57 for (G4int DSecLoop = 0; DSecLoop < num2ndaries; DSecLoop++) {
61 tempSecondaryTrack->SetCreatorProcess(pRegProcess);
64 fSecondary->push_back(tempSecondaryTrack);
84 G4double testGPIL = DBL_MAX;
85 G4double fStepLength = 0.0;
86 G4ForceCondition fForceCondition = InActivated;
88 fStepLength =
step.GetStepLength();
96 const G4TrackStatus keepStatus =
track.GetTrackStatus();
98 (const_cast<G4Track *>(&
track))->SetTrackStatus(fPostponeToNextEvent);
100 for (G4int ipm = 0; ipm < fpv_entries; ipm++) {
103 if (
fProcess->GetProcessType() == fParameterisation) {
106 testGPIL =
fProcess->PostStepGPIL(
track, fStepLength, &fForceCondition);
111 if (fForceCondition == ExclusivelyForced) {
116 for (G4int DSecLoop = 0; DSecLoop < nsec; DSecLoop++) {
117 G4Track *tempSecondaryTrack =
particleChange->GetSecondary(DSecLoop);
118 delete tempSecondaryTrack;
125 (const_cast<G4Step *>(&
step))->SetStepLength(testGPIL);
126 (const_cast<G4Track *>(&
track))->SetStepLength(testGPIL);
128 step.GetPostStepPoint()->SetStepStatus(fExclusivelyForcedProc);
130 step.GetPostStepPoint()->SetProcessDefinedStep(
fProcess);
131 step.GetPostStepPoint()->SetSafety(0.0);
141 (const_cast<G4Step *>(&
step))->UpdateTrack();
146 step.GetPostStepPoint()->SetSafety(0.0);
152 (const_cast<G4Track *>(&
track))->SetTrackStatus(keepStatus);
164 G4TrackVector::iterator itv = fSecondary->begin();
165 itv += nSecondarySave;
168 fSecondary->erase(itv, itv + num2ndaries);
176 std::cout <<
" GflashHadronWrapperProcess ProcessName, PreStepPosition, "
177 "preStepPoint KE, PostStepPoint KE, DeltaEnergy Nsec \n "
178 <<
step.GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() <<
" "
179 <<
step.GetPostStepPoint()->GetPosition() <<
" " <<
step.GetPreStepPoint()->GetKineticEnergy() /
GeV <<
" "
180 <<
step.GetPostStepPoint()->GetKineticEnergy() /
GeV <<
" " <<
step.GetDeltaEnergy() /
GeV <<
" "