7 #include "G4GPILSelection.hh" 8 #include "G4ProcessManager.hh" 9 #include "G4ProcessVector.hh" 11 #include "G4VParticleChange.hh" 12 #include "G4VProcess.hh" 14 using namespace CLHEP;
17 : particleChange(nullptr), pmanager(nullptr), fProcessVector(nullptr), fProcess(nullptr) {
52 G4TrackVector *fSecondary = (
const_cast<G4Step *
>(&
step))->GetfSecondary();
53 G4int nSecondarySave = fSecondary->size();
56 G4Track *tempSecondaryTrack;
58 for (G4int DSecLoop = 0; DSecLoop < num2ndaries; DSecLoop++) {
62 tempSecondaryTrack->SetCreatorProcess(pRegProcess);
65 fSecondary->push_back(tempSecondaryTrack);
85 G4double testGPIL = DBL_MAX;
86 G4double fStepLength = 0.0;
87 G4ForceCondition fForceCondition = InActivated;
89 fStepLength =
step.GetStepLength();
97 const G4TrackStatus keepStatus =
track.GetTrackStatus();
99 (
const_cast<G4Track *
>(&
track))->SetTrackStatus(fPostponeToNextEvent);
101 for (G4int ipm = 0; ipm < fpv_entries; ipm++) {
104 if (
fProcess->GetProcessType() == fParameterisation) {
107 testGPIL =
fProcess->PostStepGPIL(
track, fStepLength, &fForceCondition);
112 if (fForceCondition == ExclusivelyForced) {
117 for (G4int DSecLoop = 0; DSecLoop < nsec; DSecLoop++) {
118 G4Track *tempSecondaryTrack =
particleChange->GetSecondary(DSecLoop);
119 delete tempSecondaryTrack;
126 (
const_cast<G4Step *
>(&
step))->SetStepLength(testGPIL);
127 (
const_cast<G4Track *
>(&
track))->SetStepLength(testGPIL);
129 step.GetPostStepPoint()->SetStepStatus(fExclusivelyForcedProc);
131 step.GetPostStepPoint()->SetProcessDefinedStep(
fProcess);
132 step.GetPostStepPoint()->SetSafety(0.0);
142 (
const_cast<G4Step *
>(&
step))->UpdateTrack();
147 step.GetPostStepPoint()->SetSafety(0.0);
153 (
const_cast<G4Track *
>(&
track))->SetTrackStatus(keepStatus);
165 G4TrackVector::iterator itv = fSecondary->begin();
166 itv += nSecondarySave;
169 fSecondary->erase(itv, itv + num2ndaries);
177 G4cout <<
" GflashHadronWrapperProcess ProcessName, PreStepPosition, preStepPoint KE, PostStepPoint KE, DeltaEnergy " 179 <<
step.GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() <<
" " 180 <<
step.GetPostStepPoint()->GetPosition() <<
" " <<
step.GetPreStepPoint()->GetKineticEnergy() / CLHEP::GeV
181 <<
" " <<
step.GetPostStepPoint()->GetKineticEnergy() / CLHEP::GeV <<
" " <<
step.GetDeltaEnergy() / CLHEP::GeV
GflashHadronWrapperProcess(G4String processName)
G4ProcessVector * fProcessVector
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step) override
~GflashHadronWrapperProcess() override
G4ProcessManager * pmanager
void Print(const G4Step &astep)
G4VParticleChange * particleChange